Documentation ¶
Index ¶
- Constants
- func GetCache() *cache.Cache
- func GetConfig(section, key string) string
- func GetGormDB() *gorm.DB
- func GetSectionConfig(section string) map[string]string
- func GetUserDataByToken(token string) (data interface{})
- func GetUserIdByToken(token string) (id uint)
- func GetUserUniqueCodeByToken(token string) (uniqueCode string)
- func OssUpload(objectKey string, reader io.Reader) (string, error)
- func SetUserToken(id uint, uniqueCode string, data interface{}) string
- func WhereBuild(where map[string]interface{}) (whereSQL string, vals []interface{})
- type NullType
- type Output
Constants ¶
View Source
const ( SuccessCode = "100000" ErrorCode = "100001" NoPermCode = "100002" )
View Source
const ( SuccessMsg = "操作成功" ErrorMsg = "系统异常" NoPermMsg = "没有权限" )
View Source
const UserTokenForIdPrefix = "user_id_"
View Source
const UserTokenForUniqueCodePrefix = "user_uniqueCode_"
View Source
const UserTokenPrefix = "user_token_"
Variables ¶
This section is empty.
Functions ¶
func GetSectionConfig ¶
func GetUserDataByToken ¶
func GetUserDataByToken(token string) (data interface{})
* 根据token获取用户信息 @param string token
func GetUserIdByToken ¶
* 根据token获取用户id @param string token
func GetUserUniqueCodeByToken ¶
* 根据token获取用户UniqueCode @param string token
func SetUserToken ¶
* 设置用户token @param id uint 用户id @param uniqueCode string 用户唯一码 @param data interface 用户信息
func WhereBuild ¶
Types ¶
type NullType ¶
type NullType byte
const ( // IsNull the same as `is null` IsNull NullType // IsNotNull the same as `is not null` IsNotNull )
type Output ¶
type Output struct { Code string `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` Custom interface{} `json:"custom"` Token string `json:"token"` }
func (*Output) ErrorOutput ¶
func (*Output) SuccessOutput ¶
Click to show internal directories.
Click to hide internal directories.