Documentation ¶
Index ¶
- Constants
- Variables
- func CsbinAddRoleForUser(userid uint64) (err error)
- func CsbinCheckPermission(userID, url, methodtype string) (bool, error)
- func CsbinDeleteRole(roleids []uint64)
- func CsbinSetRolePermission(roleid uint64)
- func GetPageIndex(c *gin.Context) uint64
- func GetPageKey(c *gin.Context) string
- func GetPageLimit(c *gin.Context) uint64
- func GetPageSort(c *gin.Context) string
- func GetQueryToStr(c *gin.Context, key string, defaultValues ...string) string
- func GetQueryToStrE(c *gin.Context, key string) (string, error)
- func GetQueryToUint(c *gin.Context, key string, defaultValues ...uint) uint
- func GetQueryToUint64(c *gin.Context, key string, defaultValues ...uint64) uint64
- func GetQueryToUint64E(c *gin.Context, key string) (uint64, error)
- func GetQueryToUintE(c *gin.Context, key string) (uint, error)
- func InitCsbinEnforcer() (err error)
- func ResErrCli(c *gin.Context, err error)
- func ResErrSrv(c *gin.Context, err error)
- func ResFail(c *gin.Context, msg string)
- func ResFailCode(c *gin.Context, msg string, code int)
- func ResJSON(c *gin.Context, status int, v interface{})
- func ResSuccess(c *gin.Context, v interface{})
- func ResSuccessMsg(c *gin.Context)
- func ResSuccessPage(c *gin.Context, total uint64, list interface{})
- func UploadFiles(c *gin.Context)
- type ResponseModel
- type ResponseModelBase
- type ResponsePage
- type ResponsePageData
Constants ¶
View Source
const ( PrefixUserID = "u" PrefixRoleID = "r" )
View Source
const ( SUCCESS_CODE = 20000 //成功的状态码 FAIL_CODE = 30000 //失败的状态码 MD5_PREFIX = "jkfldfsf" //MD5加密前缀字符串 TOKEN_KEY = "X-Token" //页面token键名 USER_ID_Key = "X-USERID" //页面用户ID键名 USER_UUID_Key = "X-UUID" //页面UUID键名 SUPER_ADMIN_ID uint64 = 956986 // 超级管理员账号ID )
Variables ¶
View Source
var Enforcer *casbin.Enforcer
Functions ¶
func CsbinCheckPermission ¶
检查用户是否有权限
func GetQueryToStr ¶
GetQueryToStr
func GetQueryToStrE ¶
GetQueryToStrE
func GetQueryToUint ¶
QueryToUint
func GetQueryToUint64 ¶
QueryToUint
func GetQueryToUint64E ¶
QueryToUintE
Types ¶
type ResponseModel ¶
type ResponseModelBase ¶
type ResponsePage ¶
type ResponsePage struct { Code int `json:"code"` Message string `json:"message"` Data ResponsePageData `json:"data"` }
type ResponsePageData ¶
type ResponsePageData struct { Total uint64 `json:"total"` Items interface{} `json:"items"` }
Click to show internal directories.
Click to hide internal directories.