Documentation ¶
Index ¶
- func ClearUserFromRedis(uid string) error
- func CreateAuthAccount(data *model.AuthAccountCreateReq) error
- func FileExist(filename string) bool
- func GetAuth(id string) (model.Auth, error)
- func GetAuthWithRoles(id string) (model.Auth, error)
- func GetAuthWithUser(id string) (model.Auth, error)
- func GetCurrentUser(c *gin.Context) (model.User, error)
- func GetCurrentUserGroups(c *gin.Context) ([]model.UserGroup, error)
- func GetCurrentUserMenus(c *gin.Context) ([]model.Menu, error)
- func GetCurrentUserRoles(c *gin.Context) ([]model.Role, error)
- func GetFileContentType(file *os.File) (string, error)
- func GetFileHeaderContentType(file *multipart.FileHeader) string
- func GetReqInfo(c *gin.Context) model.ReqInfo
- func GetUser(id string) (model.User, error)
- func GetUserFromRedis(uid string) (model.UserCurrent, error)
- func GetUserMenus(user model.User) ([]model.Menu, error)
- func HTTPAbortError(c *gin.Context, msg string, code int, err error)
- func HTTPError(c *gin.Context, msg string, code int, err error)
- func HTTPSuccess(c *gin.Context, msg string)
- func ImageResize(srcPath string, outPath string) error
- func MakeToken(user *model.UserJWT) (int64, string, error)
- func NewError(msg string, code int, errs []error, c *gin.Context) model.HTTPError
- func RemoveDuplicateMenu(menus []model.Menu) []model.Menu
- func RolesToNames(roles []model.Role) []string
- func SaveFile(c *gin.Context, file *multipart.FileHeader) (model.UploadRes, error)
- func SetUserToRedis(user *model.UserCurrent) error
- type JWTClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAuthAccount ¶
func CreateAuthAccount(data *model.AuthAccountCreateReq) error
CreateAuthAccount 创建帐号
func GetAuthWithRoles ¶
GetAuthWithRoles 获取指定ID认证帐号
func GetAuthWithUser ¶
GetAuthWithUser 获取指定ID认证帐号及用户资料
func GetCurrentUserGroups ¶
GetCurrentUserGroups 获取当前用户组列表
func GetCurrentUserMenus ¶
GetCurrentUserMenus 获取当前用户菜单列表
func GetCurrentUserRoles ¶
GetCurrentUserRoles 获取当前用户角色列表
func GetFileContentType ¶
GetFileContentType 获取文件类型
func GetFileHeaderContentType ¶
func GetFileHeaderContentType(file *multipart.FileHeader) string
GetFileHeaderContentType 获取文件类型
func GetUserFromRedis ¶
func GetUserFromRedis(uid string) (model.UserCurrent, error)
GetUserFromRedis 从缓存中获取用户信息
func GetUserMenus ¶
GetUserMenus 获取用户菜单(作废)
func HTTPAbortError ¶
HTTPAbortError 返回错误
func ImageResize ¶
ImageResize 图片处理 https://github.com/h2non/bimg(依赖libvips,不推荐) https://github.com/disintegration/imaging(推荐)
func RemoveDuplicateMenu ¶
RemoveDuplicateMenu Menu去重(作废,已用IFUniqueItem接口实现)
func SetUserToRedis ¶
func SetUserToRedis(user *model.UserCurrent) error
SetUserToRedis 保存用户登录信息到redis
Types ¶
Click to show internal directories.
Click to hide internal directories.