#6 usermanager.PageUserParams{"0", "", template, user.Username, "", user.Admin, []string{"ayy", "lmao"}} vereinfachen

Gesloten
9 jaren geleden werd geopend door Moe · 2 opmerkingen

PageParams, PageUserParams, ... in ein Einheitliches Prinzip

PageParams, PageUserParams, ... in ein Einheitliches Prinzip
Moritz Schmidt reageerde 9 jaren geleden
Eigenaar

WIRD NICHT UMGESETZT

PageParams:

  • NotificationType:
    • -1: No notification
    • 0: Error
    • 1: Success
  • Notification:
    • Empty string or string with const-Error
  • ReqDir:
    • Empty string or string with current location (GET/POST location)
  • Username:
    • Empyty string: not logged in, else username
  • IsAdmin
    • 0: User
    • 1: Admin
  • Custom:
    • String-Array/slice for custom params etc.

Outsource to:

  • [x] templatehelpers

  • +: richtige Datentypen (int für UserID, string f. name usw.)

WIRD NICHT UMGESETZT ==================== PageParams: - NotificationType: - -1: No notification - 0: Error - 1: Success - Notification: - Empty string or string with const-Error - ReqDir: - Empty string or string with current location (GET/POST location) - Username: - Empyty string: not logged in, else username - IsAdmin - 0: User - 1: Admin - Custom: - String-Array/slice for custom params etc. Outsource to: - [x] templatehelpers - +: richtige Datentypen (int für UserID, string f. name usw.)
Moritz Schmidt reageerde 9 jaren geleden
Eigenaar

WIRD UMGESETZT

Alternative: 100% Dynamisch machen, ein großer String-Slice, der jeweils dynamisch verarbeitet wird.

  • golang maps (https://blog.golang.org/go-maps-in-action)

  • -: einheitlicher datentyp (string)

  • NotificationType:

    • -1: No notification
    • 0: Error
    • 1: Success
  • Notification:

    • Empty string or string with const-Error
  • Custom:

    • String-Array/slice for custom params etc.

DONE:

  • admin:
    • 1: Admin
    • ""(?): k. Admin
  • reqDir:
    • Empty string or string with current location (GET/POST location)
  • username:
    • Empyty string: not logged in, else username
WIRD UMGESETZT ============== Alternative: 100% Dynamisch machen, ein großer String-Slice, der jeweils dynamisch verarbeitet wird. - golang maps (https://blog.golang.org/go-maps-in-action) - -: einheitlicher datentyp (string) - NotificationType: - -1: No notification - 0: Error - 1: Success - Notification: - Empty string or string with const-Error - Custom: - String-Array/slice for custom params etc. DONE: - admin: - 1: Admin - ""(?): k. Admin - reqDir: - Empty string or string with current location (GET/POST location) - username: - Empyty string: not logged in, else username
Moe gesloten om 9 jaren geleden
Sign in to join this conversation.
Geen label
Geen mijlpaal
Geen verantwoordelijke
1 deelnemers
Laden...
Annuleren
Opslaan
Er is nog geen inhoud.