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

Suljettu
9 vuotta sitten avasi Moe · 2 kommenttia

PageParams, PageUserParams, ... in ein Einheitliches Prinzip

PageParams, PageUserParams, ... in ein Einheitliches Prinzip
Moritz Schmidt kommentoitu 9 vuotta sitten
Omistaja

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 kommentoitu 9 vuotta sitten
Omistaja

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
Kirjaudu sisään osallistuaksesi tähän keskusteluun.
Ei tunnistetta
Ei merkkipaalua
Ei osoitettua
1 osallistujaa
Ladataan...
Peruuta
Tallenna
Sisältöä ei vielä ole.