Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(data []byte, to interface{}) error
- func DelCache(key string) error
- func Encode(data interface{}) ([]byte, error)
- func GetCache(key string, to interface{}) error
- func InitCache()
- func JSONreflectStruct(jsonData map[string]interface{}, obj interface{}) (err error)
- func LogOut(level, v interface{})
- func PasswordMD5(passwd, salt string) string
- func SetCache(key string, value interface{}, timeout int) error
- func StringsJoin(strs ...string) string
- func ToInt64(v interface{}) (re int64, err error)
- func ToSlice(arr interface{}) []interface{}
- func ToString(v interface{}) (re string)
- type AccessResult
- type LangType
- type Paginator
Constants ¶
View Source
const FailedCode = "failed"
FailedCode 请求失败
View Source
const FailedMsg = "操作失败"
FailedMsg 失败提示信息
View Source
const SuccessCode = "success"
SuccessCode 请求成功
View Source
const SuccessMsg = "操作成功"
SuccessMsg 成功提示信息
Variables ¶
View Source
var DefaultPageLimit = 20
DefaultPageLimit 默认每页数量
View Source
var FilterUser = func(ctx *context.Context) { _, ok := ctx.Input.Session("uid").(int) if !ok && ctx.Request.RequestURI != "/login" { ctx.Redirect(302, "/login") } }
View Source
var GlobalGroupMenus = make(map[string]interface{})
GlobalGroupMenus 全局权限组菜单
View Source
var GlobalSessions *session.Manager
GlobalSessions 全局session
Functions ¶
func JSONreflectStruct ¶
JSONreflectStruct json数据反射为结构体
func LogOut ¶
func LogOut(level, v interface{})
LogOut 输出日志 @Title LogOut @Param body body models.AccountAccountTag true "body for AccountAccountTag content"
func PasswordMD5 ¶
@Title 生成密码 @Description create AccountAccount @Param body body models.AccountAccount true "body for AccountAccount content" @Success 201 {int} models.AccountAccount @Failure 403 body is empty
Types ¶
type AccessResult ¶
AccessResult 表访问权限
type Paginator ¶
type Paginator struct { CurrentPage int64 `json:"currentPage"` //当前页 NextPage int64 `json:"nextPage"` //下一页 PrePage int64 `json:"prePage"` //上一页 PageSize int64 `json:"pageSize"` //每页数量 CurrentPageSize int64 `json:"currentPageSize"` //当前页数量 TotalPage int64 `json:"totalPage"` //总页数 TotalCount int64 `json:"totalCount"` //总数量 FirstPage bool `json:"firstPage"` //为第一页 LastPage bool `json:"lastPage"` //为最后一页 // PageList []int64 `json:"pageList"` //显示的页 Max int64 }
func GenPaginator ¶
Click to show internal directories.
Click to hide internal directories.