Documentation ¶
Index ¶
- Constants
- Variables
- func Insert(ctx context.Context, c *app.RequestContext)
- func ResponseErr(ctx *app.RequestContext, code int)
- func ResponseErrWithMsg(ctx *app.RequestContext, code int, msgErr string)
- func ResponseSuccess(ctx *app.RequestContext, data interface{})
- func SearchAll(ctx context.Context, c *app.RequestContext)
- func SearchAllWithPost(ctx context.Context, c *app.RequestContext)
- func SearchOne(ctx context.Context, c *app.RequestContext)
- func Update(ctx context.Context, c *app.RequestContext)
- type Response
Constants ¶
View Source
const ( CodeSuccess = 1000 + iota CodeInvalidParams CodeUserExist CodeCategoryExist CodeUserNotExist CodeErrUserPsw CodeServerBusy CodeAuthNull CodeAuthErrFormat CodeAuthInvalidToken CodeParamTypeErr CodeUserNotLogin CodeUserErrLogin )
Variables ¶
View Source
var CodeMsgText = map[int]string{ CodeSuccess: "success", CodeInvalidParams: "请求参数错误 ", CodeUserExist: "用户已经存在", CodeUserNotExist: "用户不存在", CodeErrUserPsw: "密码或者用户名输入有误", CodeServerBusy: "服务器繁忙", CodeAuthNull: "请求头中auth为空,需要登陆", CodeAuthErrFormat: "请求头中auth格式有误,需要登陆", CodeAuthInvalidToken: "无效的Token", CodeParamTypeErr: "参数类型错误", CodeUserNotLogin: "用户没有登陆", CodeUserErrLogin: "用户名或密码输入有误", CodeCategoryExist: "分类已经存在", }
Functions ¶
func ResponseErr ¶
func ResponseErr(ctx *app.RequestContext, code int)
func ResponseErrWithMsg ¶
func ResponseErrWithMsg(ctx *app.RequestContext, code int, msgErr string)
func ResponseSuccess ¶
func ResponseSuccess(ctx *app.RequestContext, data interface{})
func SearchAllWithPost ¶
func SearchAllWithPost(ctx context.Context, c *app.RequestContext)
Types ¶
Click to show internal directories.
Click to hide internal directories.