constant.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. // NoAccessErr 无权访问
  22. NoAccessErr = 402
  23. // PageNotFoundErr 页面未找到
  24. PageNotFoundErr = 404
  25. // NotAcceptable 不被允许的操作
  26. NotAcceptable = 406
  27. // MsgErr 异常
  28. MsgErr = 500
  29. // ConvertErr 转换异常
  30. ConvertErr = 501
  31. // ArgsValidErr 参数验证错误
  32. ArgsValidErr = 503
  33. // DatabaseOperationErr 数据库操作出错
  34. DatabaseOperationErr = 504
  35. UnmarshalErr = 505
  36. // ParseFormErr 解析表单数据异常
  37. ParseFormErr = 506
  38. // EnterDeptErr 未进入公司
  39. EnterDeptErr = 600
  40. )
  41. var (
  42. ServiceId int
  43. )