Documentation
¶
Index ¶
- func BoundPageSize(pageSize int) int
- func BoundPageSizeWithRange[T cmp.Ordered](pageSize T, minN, maxN T) T
- func BuildCanonicalHref(c *gin.Context) string
- func GetBaseUri(c *gin.Context) string
- func GetHost(c *gin.Context) string
- func GetLoginUser(c *gin.Context) *vo.UserInfoShow
- func GetUserShowByUserId(userId uint64) *vo.UserInfoShow
- func LoginUserId(c *gin.Context) uint64
- func SendAEmail4User(userEntity *users.EntityComplete) error
- func ValidatePassword(password string) error
- func ValidateUsername(username string) bool
- type BetterRequest
- type DataMap
- type Null
- type NullRequest
- type Page
- type Response
- type ResultStruct
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoundPageSize ¶ added in v0.0.9
func BoundPageSizeWithRange ¶ added in v0.0.9
func BuildCanonicalHref ¶ added in v0.0.9
func GetBaseUri ¶ added in v0.0.9
func GetLoginUser ¶ added in v0.0.9
func GetLoginUser(c *gin.Context) *vo.UserInfoShow
func GetUserShowByUserId ¶ added in v0.0.9
func GetUserShowByUserId(userId uint64) *vo.UserInfoShow
func LoginUserId ¶ added in v0.0.9
func SendAEmail4User ¶ added in v0.0.9
func SendAEmail4User(userEntity *users.EntityComplete) error
func ValidatePassword ¶ added in v0.0.9
ValidatePassword 验证密码复杂度
func ValidateUsername ¶ added in v0.0.9
Types ¶
type BetterRequest ¶
type BetterRequest[T any] struct { Params T UserId uint64 GinContext *gin.Context // contains filtered or unexported fields }
func (*BetterRequest[T]) GetParams ¶
func (r *BetterRequest[T]) GetParams() T
func (*BetterRequest[T]) GetUser ¶
func (r *BetterRequest[T]) GetUser() (users.EntityComplete, error)
type NullRequest ¶
type NullRequest BetterRequest[Null]
type Response ¶
type Response struct {
Code int
Data ResultStruct
}
func BuildResponse ¶
func BuildResponse(code int, data ResultStruct) Response
func FailResponse ¶
func SuccessResponse ¶
type ResultStruct ¶
type ResultStruct struct {
Msg any `json:"msg"`
Result any `json:"result"`
Code Status `json:"code"`
}
func FailData ¶
func FailData(msg any) ResultStruct
func SuccessData ¶
func SuccessData(data any) ResultStruct
Click to show internal directories.
Click to hide internal directories.