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

Đã đóng
%! (template.HTML=9 năm trước cách đây)đang mở bởi Moe · 2 ý kiến

PageParams, PageUserParams, ... in ein Einheitliches Prinzip

PageParams, PageUserParams, ... in ein Einheitliches Prinzip
Moritz Schmidt đã nhận xét 9 năm trước cách đây
Chủ sở hữu

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 đã nhận xét 9 năm trước cách đây
Chủ sở hữu

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
Đăng nhập để tham gia bình luận.
Không có nhãn
Không có Milestone
Không có người được phân công
1 tham gia
Đang tải...
Hủy bỏ
Lưu
Ở đây vẫn chưa có nội dung nào.