error.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. package common
  2. import (
  3. pb "mop-account-system/protobuf/golang"
  4. "github.com/gin-gonic/gin"
  5. )
  6. const (
  7. OK = "OK"
  8. FC_ORGAN_BIND_ERROR = "FC_ORGAN_BIND_ERROR"
  9. FC_ORGAN_REGISTER_ERROR = "FC_ORGAN_REGISTER_ERROR"
  10. FC_ORGAN_VERIFIY_CODE_ERROR = "FC_ORGAN_VERIFIY_CODE_ERROR"
  11. FC_ORGAN_PHONE_ERROR = "FC_ORGAN_PHONE_ERROR"
  12. FC_ORGAN_PHONE_GET_VERIFY_CODE_ERROR = "FC_ORGAN_PHONE_GET_VERIFY_CODE_ERROR"
  13. FC_ORGAN_PHONE_GET_VERIFY_CODE_TOO_MANY = "FC_ORGAN_PHONE_GET_VERIFY_CODE_TOO_MANY"
  14. FC_ORGAN_PHONE_DUPLICATE = "FC_ORGAN_PHONE_DUPLICATE"
  15. FC_ORGAN_IDENTITY_DUPLICATE = "FC_ORGAN_IDENTITY_DUPLICATE"
  16. FC_ORGAN_ACCOUNT_DUPLICATE = "FC_ORGAN_ACCOUNT_DUPLICATE"
  17. FC_ORGAN_TRACE_ID_ERROR = "FC_ORGAN_TRACE_ID_ERROR"
  18. FC_ORGAN_GET_BY_TRACE_ID_ERROR = "FC_ORGAN_GET_BY_TRACE_ID_ERROR"
  19. FC_ORGAN_BUSINESS_APPLY_ERROR = "FC_ORGAN_BUSINESS_APPLY_ERROR"
  20. FC_ORGAN_ACCOUNT_OR_PWD_EMPTY = "FC_ORGAN_ACCOUNT_OR_PWD_EMPTY"
  21. FC_ORGAN_ACCOUNT_NOT_EXIST = "FC_ORGAN_ACCOUNT_NOT_EXIST"
  22. FC_ORGAN_ACCOUNT_OR_PWD_ERROR = "FC_ORGAN_ACCOUNT_OR_PWD_ERROR"
  23. FC_ORGAN_ACCOUNT_PASSWORD_ERROR = "FC_ORGAN_ACCOUNT_PASSWORD_ERROR"
  24. FC_ORGAN_ACCOUNT_EMPTY = "FC_ORGAN_ACCOUNT_EMPTY"
  25. FC_ORGAN_FORBID = "FC_ORGAN_FORBID"
  26. FC_ORGAN_BUSINESS_NOT_EXIST = "FC_ORGAN_BUSINESS_NOT_EXIST"
  27. FC_ORGAN_PARAM_ERROR = "FC_ORGAN_PARAM_ERROR"
  28. FC_ORGAN_MODIFY_PHONE_ERROR = "FC_ORGAN_MODIFY_PHONE_ERROR"
  29. FC_ORGAN_MODIFY_BUSINESS_ADMIN_ERROR = "FC_ORGAN_MODIFY_BUSINESS_ADMIN_ERROR"
  30. FC_ORGAN_GEN_VERIFY_CODE_TYPE_ERROR = "FC_ORGAN_GEN_VERIFY_CODE_TYPE_ERROR"
  31. FC_ORGAN_POWER_CHECK_ERROR = "FC_ORGAN_POWER_CHECK_ERROR"
  32. FC_ORGAN_POWER_CHECK_REVIEWING_ERROR = "FC_ORGAN_POWER_CHECK_REVIEWING_ERROR"
  33. FC_ORGAN_POWER_CHECK_UNCERTIFIED_ERROR = "FC_ORGAN_POWER_CHECK_UNCERTIFIED_ERROR"
  34. FC_ORGAN_POWER_CHECK_EXPIRED_ERROR = "FC_ORGAN_POWER_CHECK_EXPIRED_ERROR"
  35. FC_ORGAN_POWER_CHECK_FROZEN_ERROR = "FC_ORGAN_POWER_CHECK_FROZEN_ERROR"
  36. FC_ORGAN_PLATFORM_ACCOUNT_MODIFY_ERROR = "FC_ORGAN_PLATFORM_ACCOUNT_MODIFY_ERROR"
  37. FC_ORGAN_PLATFORM_ACCOUNT_DEL_ERROR = "FC_ORGAN_PLATFORM_ACCOUNT_DEL_ERROR"
  38. FC_ORGAN_ACCOUNT_OR_PHONE_DUPLICATE = "FC_ORGAN_ACCOUNT_OR_PHONE_DUPLICATE"
  39. FC_ORGAN_SOCIAL_CREDIT_CODE_DUPLICATE = "FC_ORGAN_SOCIAL_CREDIT_CODE_DUPLICATE"
  40. FC_ORGAN_MEMBER_ROLE_ERROR = "FC_ORGAN_MEMBER_ROLE_ERROR"
  41. FC_ORGAN_PHONE_NOT_REGISTER = "FC_ORGAN_PHONE_NOT_REGISTER"
  42. FC_ORGAN_PHONE_NOT_EQUAL = "FC_ORGAN_PHONE_NOT_EQUAL"
  43. FC_ORGAN_EMAIL_GET_VERIFY_CODE_ERROR = "FC_ORGAN_EMAIL_GET_VERIFY_CODE_ERROR"
  44. FC_ORGAN_EMAIL_DUPLICATE = "FC_ORGAN_EMAIL_DUPLICATE"
  45. FC_ORGAN_REGISTER_TOO_MANY = "FC_ORGAN_REGISTER_TOO_MANY"
  46. FC_ORGAN_SERVER_ERROR = "FC_ORGAN_SERVER_ERROR"
  47. FC_ORGAN_EMAIL_NOT_EQUAL = "FC_ORGAN_EMAIL_NOT_EQUAL"
  48. FC_ORGAN_PERSON_APPLY_ERROR = "FC_ORGAN_PERSON_APPLY_ERROR"
  49. FC_ORGAN_EMAIL_VERIFY_CODE_TOO_MANY = "FC_ORGAN_EMAIL_VERIFY_CODE_TOO_MANY"
  50. FC_ORGAN_OPERATE_TOO_MANY = "FC_ORGAN_OPERATE_TOO_MANY"
  51. FC_ORGAN_VERIFY_CODE_ERROR = "FC_ORGAN_VERIFY_CODE_ERROR"
  52. FC_ORGAN_VERIFY_CODE_NOT_EXIST = "FC_ORGAN_VERIFY_CODE_NOT_EXIST"
  53. FC_ORGAN_NOT_PERSON = "FC_ORGAN_NOT_PERSON"
  54. FC_ORGAN_PERSON_ADD_MEMBER_MAX = "FC_ORGAN_PERSON_ADD_MEMBER_MAX"
  55. FC_ORGAN_BUSINESS_ADD_MEMBER_MAX = "FC_ORGAN_BUSINESS_ADD_MEMBER_MAX"
  56. FC_ORGAN_FINSTORE_PERSON_ADD_APP_MAX = "FC_ORGAN_FINSTORE_PERSON_ADD_APP_MAX"
  57. FC_ORGAN_FINSTORE_ADD_APP_MAX = "FC_ORGAN_FINSTORE_ADD_APP_MAX"
  58. FC_ORGAN_FINSTORE_PERSON_ADD_COO_APP_MAX = "FC_ORGAN_FINSTORE_PERSON_ADD_COO_APP_MAX"
  59. FC_ORGAN_FINSTORE_ADD_COO_APP_MAX = "FC_ORGAN_FINSTORE_ADD_COO_APP_MAX"
  60. FC_OPERA_BIND_ERROR = "FC_OPERA_BIND_ERROR"
  61. FC_OPERA_ACCOUNT_ERROR = "FC_OPERA_ACCOUNT_ERROR"
  62. FC_OPERA_PASSWORD_ERROR = "FC_OPERA_PASSWORD_ERROR"
  63. FC_OPERA_SERVER_ERROR = "FC_OPERA_SERVER_ERROR"
  64. FC_OPERA_PAGE_ERROR = "FC_OPERA_PAGE_ERROR"
  65. FC_OPERA_NUM_ERROR = "FC_OPERA_NUM_ERROR"
  66. FC_OPERA_ACCOUNT_EXITED = "FC_OPERA_ACCOUNT_EXITED"
  67. FC_OPERA_PHONE_EXITED = "FC_OPERA_PHONE_EXITED"
  68. FC_OPERA_EMAIL_EXITED = "FC_OPERA_EMAIL_EXITED"
  69. FC_OPERA_IDCARD_EXITED = "FC_OPERA_IDCARD_EXITED"
  70. FC_OPERS_ACCOUNT_NOT = "FC_OPERS_ACCOUNT_NOT"
  71. FC_OPERA_JWT_ERROR = "FC_OPERA_JWT_ERROR"
  72. FC_OPERA_STATUS_ERROR = "FC_OPERA_STATUS_ERROR"
  73. FC_OPERA_NO_REASON = "FC_OPERA_NO_REASON"
  74. FC_OPERA_PARAM_COMPLETE = "FC_OPERA_PARAM_COMPLETE"
  75. FC_OPERA_NO_AUTH = "FC_OPERA_NO_AUTH"
  76. FC_OPERA_ACCOUNT_HAS_ICE = "FC_OPERA_ACCOUNT_HAS_ICE"
  77. FC_OPERA_OLD_PWD_ERROR = "FC_OPERA_OLD_PWD_ERROR"
  78. FC_OPERA_INVAILD_ACCOUNT = "FC_OPERA_INVAILD_ACCOUNT"
  79. FC_OPERA_VERIFY_CODE_ERROR = "FC_OPERA_VERIFY_CODE_ERROR"
  80. FC_OPERA_PHONE_NO_EXITE = "FC_OPERA_PHONE_NO_EXITE"
  81. FC_OPERA_PARAM_ERROR = "FC_OPERA_PARAM_ERROR"
  82. FC_OPERA_GEN_VERIFY_CODE_TYPE_ERROR = "FC_OPERA_GEN_VERIFY_CODE_ERROR"
  83. FC_OPERA_GEN_VERIFY_CODE_TOO_MANY = "FC_OPERA_GEN_VERIFY_CODE_TOO_MANY"
  84. FC_OPERA_GET_VERIFY_CODE_SMS_ERROR = "FC_OPERA_GET_VERIFY_CODE_SMS_ERROR"
  85. FC_OPERA_RETRY_GEN_VERIFY_CODE = "FC_OPERA_RETRY_GEN_VERIFY_CODE"
  86. FC_OPERA_FORBID_ERROR = "FC_OPERA_FORBID_ERROR"
  87. FC_OPERA_UP_ORGAN_APPINUM_TOO_SMALL = "FC_OPERA_UP_ORGAN_APPINUM_TOO_SMALL"
  88. FC_OPERA_APPID_EXCEED_LIMIT = "FC_OPERA_APPID_EXCEED_LIMIT"
  89. FC_OPERA_VERIFY_CODE_PHONE_ERROR = "FC_OPERA_VERIFY_CODE_PHONE_ERROR"
  90. FC_ORGAN_ACCOUNT_LOGIN_ERROR = "FC_ORGAN_ACCOUNT_LOGIN_ERROR"
  91. FC_ORGAN_RETRY_REVIEW_ERROR = "FC_ORGAN_RETRY_REVIEW_ERROR"
  92. FC_ORGAN_DELETE_WORKER_LACK_ERROR = "FC_ORGAN_DELETE_WORKER_LACK_ERROR"
  93. FC_ORGAN_PHONE_ACCOUNT_NO_MATCH = "FC_ORGAN_PHONE_ACCOUNT_NO_MATCH"
  94. FC_ORGAN_PWD_RETRY_OVER_LIMIT = "FC_ORGAN_PWD_RETRY_OVER_LIMIT"
  95. FC_OPERA_PWD_ERROR_POINT = "FC_OPERA_PWD_ERROR_POINT"
  96. FC_OPERA_DEAL_REASON_EMPTY = "FC_OPERA_DEAL_REASON_EMPTY"
  97. FC_OPERA_NEED_HAS_CERT = "FC_OPERA_NEED_HAS_CERT"
  98. FC_OPERA_NEED_HAS_FREE = "FC_OPERA_NEED_HAS_CERT"
  99. FC_OPERA_GEN_VERIFYCODE_RETRY = "FC_OPERA_GEN_VERIFYCODE_RETRY"
  100. FC_OPERA_GET_LICE_ERROR = "FC_OPERA_GET_LICE_ERROR"
  101. FC_OPERA_APPID_COUNT_OVER = "FC_OPERA_APPID_COUNT_OVER"
  102. FC_OPERA_ORGAN_COUNT_OVER = "FC_OPERA_ORGAN_COUNT_OVER"
  103. FC_OPERA_LIMIT_NUM_FEW = "FC_OPERA_LIMIT_NUM_FEW"
  104. FC_OPERA_LIMIT_TYPE_ERROR = "FC_OPERA_LIMIT_TYPE_ERROR"
  105. FC_OPERA_LIMIT_APPID_OVER_ERROR = "FC_OPERA_LIMIT_APPID_OVER_ERROR"
  106. FC_OPERA_LIMIT_BIND_OVER_ERROR = "FC_OPERA_LIMIT_BIND_OVER_ERROR"
  107. FC_OPERA_LIMIT_MEMBER_OVER_ERROR = "FC_OPERA_LIMIT_MEMBER_OVER_ERROR"
  108. //角色相关错误代码
  109. FC_OPER_ROLE_REPEAT_ERR = "FC_OPER_ROLE_REPEAT_ERR"
  110. FC_OPER_ROLE_NOT_FUND_ERR = "FC_OPER_ROLE_NOT_FUND_ERR"
  111. FC_ROLE_DELETE_ERR = "FC_ROLE_DELETE_ERR"
  112. FC_ROLE_DELETE_ACCOUNT_ERR = "FC_ROLE_DELETE_ACCOUNT_ERR"
  113. FC_ROLE_DEFAULT_DELETE_ERR = "FC_ROLE_DEFAULT_DELETE_ERR"
  114. FC_DEL_ACCOUNT_ERR = "FC_DEL_ACCOUNT_ERR"
  115. FC_DEL_ACCOUNT_CONFLICT_ERR = "FC_DEL_ACCOUNT_CONFLICT_ERR"
  116. FC_DEL_ACCOUNT_TODOS_NOZERO_ERR = "FC_DEL_ACCOUNT_TODOS_NOZERO_ERR"
  117. )
  118. var errorText = map[string]string{
  119. "OK": "",
  120. "FC_ORGAN_BIND_ERROR": "http body请求参数解析失败",
  121. "FC_ORGAN_REGISTER_ERROR": "管理员账号注册失败",
  122. "FC_ORGAN_VERIFIY_CODE_ERROR": "验证码错误",
  123. "FC_ORGAN_PHONE_ERROR": "手机号错误",
  124. "FC_ORGAN_PHONE_GET_VERIFY_CODE_ERROR": "获取验证码失败",
  125. "FC_ORGAN_PHONE_GET_VERIFY_CODE_TOO_MANY": "请稍后再重新获取验证码",
  126. "FC_ORGAN_PHONE_DUPLICATE": "该手机号已注册,请重新输入",
  127. "FC_ORGAN_IDENTITY_DUPLICATE": "该身份证已注册,请重新输入",
  128. "FC_ORGAN_ACCOUNT_DUPLICATE": "用户名已存在,请重新输入",
  129. "FC_ORGAN_TRACE_ID_ERROR": "traceId错误",
  130. "FC_ORGAN_GET_BY_TRACE_ID_ERROR": "查询账号信息失败",
  131. "FC_ORGAN_BUSINESS_APPLY_ERROR": "企业信息提交申请失败",
  132. "FC_ORGAN_ACCOUNT_OR_PWD_EMPTY": "账号或者密码为空",
  133. "FC_ORGAN_ACCOUNT_NOT_EXIST": "不存在该账号信息",
  134. "FC_ORGAN_ACCOUNT_OR_PWD_ERROR": "帐号或密码错误",
  135. "FC_ORGAN_ACCOUNT_PASSWORD_ERROR": "密码错误",
  136. "FC_ORGAN_ACCOUNT_EMPTY": "账号为空",
  137. "FC_ORGAN_FORBID": "无权限操作",
  138. "FC_ORGAN_BUSINESS_NOT_EXIST": "企业信息为空",
  139. "FC_ORGAN_PARAM_ERROR": "请求参数错误",
  140. "FC_ORGAN_MODIFY_PHONE_ERROR": "修改手机号失败",
  141. "FC_ORGAN_MODIFY_BUSINESS_ADMIN_ERROR": "修改管理员信息失败",
  142. "FC_ORGAN_GEN_VERIFY_CODE_TYPE_ERROR": "获取验证码类型错误",
  143. "FC_ORGAN_POWER_CHECK_ERROR": "当前企业尚未通过认证,无法使用该功能",
  144. "FC_ORGAN_POWER_CHECK_REVIEWING_ERROR": "当前企业状态为审核中状态,无法使用该功能",
  145. "FC_ORGAN_POWER_CHECK_UNCERTIFIED_ERROR": "当前企业状态为未认证状态,无法使用该功能",
  146. "FC_ORGAN_POWER_CHECK_EXPIRED_ERROR": "当前企业状态为已过期状态,无法使用该功能",
  147. "FC_ORGAN_POWER_CHECK_FROZEN_ERROR": "当前企业状态为已冻结状态,无法使用该功能",
  148. "FC_ORGAN_PLATFORM_ACCOUNT_MODIFY_ERROR": "编辑平台成员失败",
  149. "FC_ORGAN_PLATFORM_ACCOUNT_DEL_ERROR": "删除失败,请重新获取列表后操作",
  150. "FC_ORGAN_ACCOUNT_OR_PHONE_DUPLICATE": "账号或者手机号已经注册,请重新修改",
  151. "FC_ORGAN_SOCIAL_CREDIT_CODE_DUPLICATE": "社会信用代码已经注册,请重新修改",
  152. "FC_ORGAN_MEMBER_ROLE_ERROR": "账号类型错误",
  153. "FC_ORGAN_ACCOUNT_LOGIN_ERROR": "账号登录失败,请稍后再试",
  154. "FC_ORGAN_PHONE_NOT_REGISTER": "该手机号未注册",
  155. "FC_ORGAN_PHONE_NOT_EQUAL": "登录手机号错误",
  156. "FC_ORGAN_EMAIL_GET_VERIFY_CODE_ERROR": "获取邮箱验证码失败",
  157. "FC_ORGAN_EMAIL_DUPLICATE": "该邮箱已注册,请重新输入",
  158. "FC_ORGAN_REGISTER_TOO_MANY": "注册太频繁,请稍后再重新注册",
  159. "FC_ORGAN_SERVER_ERROR": "服务异常,请稍后重试",
  160. "FC_ORGAN_EMAIL_NOT_EQUAL": "登录邮箱错误",
  161. "FC_ORGAN_PERSON_APPLY_ERROR": "个人信息申请失败",
  162. "FC_ORGAN_EMAIL_VERIFY_CODE_TOO_MANY": "获取验证码太频繁,请稍后重新获取验证码",
  163. "FC_ORGAN_OPERATE_TOO_MANY": "请求过于频繁,请稍后再重试",
  164. "FC_ORGAN_VERIFY_CODE_ERROR": "验证码错误,请重新输入",
  165. "FC_ORGAN_VERIFY_CODE_NOT_EXIST": "验证码已过期,请重新获取",
  166. "FC_ORGAN_NOT_PERSON": "非个人账号,不能升级为企业账号",
  167. "FC_ORGAN_PERSON_ADD_MEMBER_MAX": "成员数量已达上限,如需新增成员,请联系平台运营方",
  168. "FC_ORGAN_BUSINESS_ADD_MEMBER_MAX": "成员数量已达上限,如需新增成员,请联系平台运营方",
  169. "FC_ORGAN_FINSTORE_PERSON_ADD_APP_MAX": "可创建的小程序个数已达上限,如需创建新的小程序,请联系平台运营方",
  170. "FC_ORGAN_FINSTORE_ADD_APP_MAX": "可创建的小程序个数已达上限,如需创建新的小程序,请联系平台运营方",
  171. "FC_ORGAN_FINSTORE_PERSON_ADD_COO_APP_MAX": "可合作应用个数已达上限,如需新增合作应用,请联系平台运营方",
  172. "FC_ORGAN_FINSTORE_ADD_COO_APP_MAX": "可合作应用个数已达上限,如需新增合作应用,请联系平台运营方",
  173. "FC_OPERA_BIND_ERROR": "http body请求参数解析失败",
  174. "FC_OPERA_ACCOUNT_ERROR": "账号错误",
  175. "FC_OPERA_PASSWORD_ERROR": "密码错误",
  176. "FC_OPERA_SERVER_ERROR": "服务端错误,请重试",
  177. "FC_OPERA_PAGE_ERROR": "参数page错误",
  178. "FC_OPERA_NUM_ERROR": "参数num需大于0小于等于100",
  179. "FC_OPERA_ACCOUNT_EXITED": "该用户名已存在,请重新输入",
  180. "FC_OPERA_PHONE_EXITED": "该手机号已注册,请重新输入",
  181. "FC_OPERA_EMAIL_EXITED": "该邮箱已注册,请重新输入",
  182. "FC_OPERA_IDCARD_EXITED": "该身份证已注册,请重新输入",
  183. "FC_OPERS_ACCOUNT_NOT": "该账户不存在",
  184. "FC_OPERA_JWT_ERROR": "jwt错误",
  185. "FC_OPERA_STATUS_ERROR": "设置状态非法",
  186. "FC_OPERA_NO_REASON": "驳回原因不能为空",
  187. "FC_OPERA_PARAM_COMPLETE": "必填项不可为空",
  188. "FC_OPERA_NO_AUTH": "无权限进行此操作",
  189. "FC_OPERA_ACCOUNT_HAS_ICE": "账号已经被冻结",
  190. "FC_OPERA_OLD_PWD_ERROR": "旧密码不正确",
  191. "FC_OPERA_INVAILD_ACCOUNT": "非法账户",
  192. "FC_OPERA_VERIFY_CODE_ERROR": "验证码错误",
  193. "FC_OPERA_PHONE_NO_EXITE": "该手机号不存在",
  194. "FC_OPERA_GEN_VERIFY_CODE_ERROR": "获取验证码类型错误",
  195. "FC_OPERA_PARAM_ERROR": "参数错误",
  196. "FC_OPERA_GEN_VERIFY_CODE_TOO_MANY": "请稍后再重新获取验证码",
  197. "FC_OPERA_GET_VERIFY_CODE_SMS_ERROR": "获取验证码失败",
  198. "FC_OPERA_RETRY_GEN_VERIFY_CODE": "重复申请验证码",
  199. "FC_OPERA_FORBID_ERROR": "无权限",
  200. "FC_OPERA_UP_ORGAN_APPINUM_TOO_SMALL": "更新数量小于已使用数量",
  201. "FC_OPERA_APPID_EXCEED_LIMIT": "appid数量超出上限",
  202. "FC_OPERA_VERIFY_CODE_PHONE_ERROR": "获取验证码手机号不是该账户手机号",
  203. "FC_ORGAN_RETRY_REVIEW_ERROR": "该条信息已经被审核",
  204. "FC_ORGAN_DELETE_WORKER_LACK_ERROR": "删除失败,请重新获取列表后操作",
  205. "FC_ORGAN_PHONE_ACCOUNT_NO_MATCH": "获取验证码手机号与账号拥有手机号不匹配",
  206. "FC_ORGAN_PWD_RETRY_OVER_LIMIT": "密码尝试次数太多,请24小时后再尝试。",
  207. "FC_OPERA_DEAL_REASON_EMPTY": "拒绝原因不能为空",
  208. "FC_OPERA_NEED_HAS_CERT": "企业未通过认证,不可冻结",
  209. "FC_OPERA_NEED_HAS_FREE": "企业不是冻结状态,不可解冻",
  210. "FC_OPERA_GEN_VERIFYCODE_RETRY": "请稍后再获取验证码",
  211. "FC_OPERA_GET_LICE_ERROR": "获取license失败",
  212. "FC_OPERA_APPID_COUNT_OVER": "appid数量超过签发证书允许数量",
  213. "FC_OPERA_ORGAN_COUNT_OVER": "审核通过企业数量超过签发证书允许数量",
  214. "FC_OPERA_LIMIT_NUM_FEW": "修改数量小于已使用数量",
  215. "FC_OPERA_LIMIT_TYPE_ERROR": "类型错误",
  216. "FC_OPERA_LIMIT_APPID_OVER_ERROR": "小程序数量已达上限,如需新增小程序,请联系平台运营方",
  217. "FC_OPERA_LIMIT_BIND_OVER_ERROR": "应用数量已达上限,如需新增应用,请联系平台运营方",
  218. "FC_OPERA_LIMIT_MEMBER_OVER_ERROR": "成员数量已达上限,如需新增成员,请联系平台运营方",
  219. //角色管理相关错误信息
  220. "FC_OPER_ROLE_REPEAT_ERR": "角色名称已存在",
  221. "FC_OPER_ROLE_NOT_FUND_ERR": "未查询到角色",
  222. "FC_ROLE_DELETE_ERR": "删除失败,当前角色下还有成员。",
  223. "FC_ROLE_DELETE_ACCOUNT_ERR": "成员的角色不能为空,每个成员至少要有一个角色",
  224. "FC_ROLE_DEFAULT_DELETE_ERR": "管理员为系统默认角色,不可删除。",
  225. "FC_DEL_ACCOUNT_ERR": "无法删除自己的账号!",
  226. "FC_DEL_ACCOUNT_TODOS_NOZERO_ERR": "删除的成员中还有尚未处理的待办,请处理后再删除。",
  227. }
  228. func MakeRsp(c *gin.Context, httpStatus int, errCode string, data interface{}) {
  229. c.JSON(httpStatus, gin.H{
  230. "error": errorText[errCode],
  231. "errcode": errCode,
  232. "data": data,
  233. })
  234. }
  235. func MakeRspNoLoc(c *gin.Context, httpStatus int, errCode, errMsg string, data interface{}) {
  236. c.JSON(httpStatus, gin.H{
  237. "error": errMsg,
  238. "errcode": errCode,
  239. "data": data,
  240. })
  241. }
  242. func GetErrMsg(errCode string) string {
  243. return errorText[errCode]
  244. }
  245. func MakeGrpcCommonResult(httpStatus int, errCode string, result **pb.CommonResult) {
  246. *result = &pb.CommonResult{}
  247. (*result).Error = errorText[errCode]
  248. (*result).Errcode = errCode
  249. (*result).Httpcode = int32(httpStatus)
  250. }