Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoginUser ¶
type LoginUser struct {
Token string `json:"token,omitempty"` // stored token used for inter-service REST calls; not included when generating a new token
TokenType string `json:"tokenType,omitempty"` // token purpose: "access" or "refresh"
UserId uint64 `json:"userId"`
Username string `json:"username"`
ProductId uint64 `json:"productId"`
Roles []string `json:"roles"`
}
LoginUser holds the claims embedded inside a JWT token for an authenticated user. Fields such as UserId, Username, ProductId, and Roles must not use omitempty so that zero values are always serialised.
type ResponseMessage ¶
type ResponseMessage struct {
Code int `json:"code"` // 0: success; others: failed
Message string `json:"message,omitempty"` // omit in success response
Data any `json:"data,omitempty"` // omit in failed response
}
ResponseMessage is the standard response envelope returned by all API endpoints. Code 0 indicates success; any other value indicates failure.
Click to show internal directories.
Click to hide internal directories.