constant.go 954 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package global
  2. const (
  3. // ContextKeyUserObj 上下文用户对象
  4. ContextKeyUserObj = "authedUserObj"
  5. // ContextKeyServiceId 上下文服务对象
  6. ContextKeyServiceId = "serviceId"
  7. // RedisPrefixAuth redis 权限验证前缀
  8. RedisPrefixAuth = "auth:"
  9. // RedisPrefixRoleApi redis 角色api
  10. RedisPrefixRoleApi = "role_api:"
  11. )
  12. const (
  13. // MsgOk 成功
  14. MsgOk = 200
  15. // Found 资源发生改变
  16. Found = 302
  17. // BadRequest 请求错误
  18. BadRequest = 400
  19. // Unauthorized 未认证
  20. Unauthorized = 401
  21. // PageNotFoundErr 页面未找到
  22. PageNotFoundErr = 404
  23. // NotAcceptable 不被允许的操作
  24. NotAcceptable = 406
  25. // MsgErr 异常
  26. MsgErr = 500
  27. // ConvertErr 转换异常
  28. ConvertErr = 501
  29. // ArgsValidErr 参数验证错误
  30. ArgsValidErr = 503
  31. // DatabaseOperationErr 数据库操作出错
  32. DatabaseOperationErr = 504
  33. UnmarshalErr = 505
  34. // ParseFormErr 解析表单数据异常
  35. ParseFormErr = 506
  36. )
  37. var (
  38. ServiceId int
  39. )