Documentation ¶
Index ¶
- func EncodePwd(value string) string
- func EncodeSha1(value string) string
- func GenerateToken(userId int, username string, userType int) (string, error)
- func GetJwtSecret() string
- func GetPageNum(c *gin.Context) int
- func GetPageOffset(page, pageSize int) int
- func GetPageSize(c *gin.Context) int
- func InitPagination(pageNum, pageSize int) (int, int)
- type Claims
- type Response
- type ValidError
- type ValidErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeSha1 ¶
func GetJwtSecret ¶
func GetJwtSecret() string
func GetPageNum ¶
func GetPageOffset ¶
func GetPageSize ¶
func InitPagination ¶
Types ¶
type Claims ¶
type Claims struct { Id int `json:"id"` Username string `json:"username"` UserType int `json:"userType"` jwt.StandardClaims }
func ParseToken ¶
type Response ¶
func NewResponse ¶
func (*Response) ToResponse ¶
func (r *Response) ToResponse(data interface{})
func (*Response) ToResponseError ¶
func (*Response) ToResponseList ¶
type ValidError ¶
func (*ValidError) Error ¶
func (v *ValidError) Error() string
type ValidErrors ¶
type ValidErrors []*ValidError
func BindAndValid ¶
func BindAndValid(c *gin.Context, v interface{}) (bool, ValidErrors)
func (ValidErrors) Errors ¶
func (v ValidErrors) Errors() []string
Click to show internal directories.
Click to hide internal directories.