constant.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. RedisMSFXMedicineInfo = "msfx_info:"
  12. )
  13. const (
  14. // MsgOk 成功
  15. MsgOk = 200
  16. // Found 资源发生改变
  17. Found = 302
  18. // BadRequest 请求错误
  19. BadRequest = 400
  20. // Unauthorized 未认证
  21. Unauthorized = 401
  22. // NoAccessErr 无权访问
  23. NoAccessErr = 402
  24. // PageNotFoundErr 页面未找到
  25. PageNotFoundErr = 404
  26. // NotAcceptable 不被允许的操作
  27. NotAcceptable = 406
  28. // MsgErr 异常
  29. MsgErr = 500
  30. // ConvertErr 转换异常
  31. ConvertErr = 501
  32. // ArgsValidErr 参数验证错误
  33. ArgsValidErr = 503
  34. // DatabaseOperationErr 数据库操作出错
  35. DatabaseOperationErr = 504
  36. UnmarshalErr = 505
  37. // ParseFormErr 解析表单数据异常
  38. ParseFormErr = 506
  39. // EnterDeptErr 未进入公司
  40. EnterDeptErr = 600
  41. )
  42. var (
  43. ServiceId int
  44. )