猫妈狗爸伴宠师小程序后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

263 lines
6.5 KiB

3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
  1. package com.ruoyi.common.constant;
  2. import io.jsonwebtoken.Claims;
  3. /**
  4. * 通用常量信息
  5. *
  6. * @author ruoyi
  7. */
  8. public class Constants
  9. {
  10. /**
  11. * UTF-8 字符集
  12. */
  13. public static final String UTF8 = "UTF-8";
  14. /**
  15. * GBK 字符集
  16. */
  17. public static final String GBK = "GBK";
  18. /**
  19. * http请求
  20. */
  21. public static final String HTTP = "http://";
  22. /**
  23. * https请求
  24. */
  25. public static final String HTTPS = "https://";
  26. /**
  27. * 通用成功标识
  28. */
  29. public static final String SUCCESS = "0";
  30. /**
  31. * 通用失败标识
  32. */
  33. public static final String FAIL = "1";
  34. /**
  35. * 登录成功
  36. */
  37. public static final String LOGIN_SUCCESS = "Success";
  38. /**
  39. * 注销
  40. */
  41. public static final String LOGOUT = "Logout";
  42. /**
  43. * 注册
  44. */
  45. public static final String REGISTER = "Register";
  46. /**
  47. * 登录失败
  48. */
  49. public static final String LOGIN_FAIL = "Error";
  50. /**
  51. * 验证码 redis key
  52. */
  53. public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
  54. /**
  55. * 登录用户 redis key
  56. */
  57. public static final String LOGIN_TOKEN_KEY = "login_tokens:";
  58. public static final String LOGIN_MEMBER_TOKEN_KEY = "login_member_tokens:";
  59. public static final String LOGIN_APPLET_TOKEN_KEY = "login_applet_tokens:"; //伴宠师-小程序登录
  60. public static final String MEMBER_INFO = "member_info";
  61. public static final String STAFF_INFO = "staff_info";
  62. /**
  63. * 防重提交 redis key
  64. */
  65. public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
  66. /**
  67. * 限流 redis key
  68. */
  69. public static final String RATE_LIMIT_KEY = "rate_limit:";
  70. /**
  71. * 验证码有效期分钟
  72. */
  73. public static final Integer CAPTCHA_EXPIRATION = 2;
  74. /**
  75. * 令牌
  76. */
  77. public static final String TOKEN = "token";
  78. /**
  79. * 令牌前缀
  80. */
  81. public static final String TOKEN_PREFIX = "Bearer ";
  82. /**
  83. * 令牌前缀
  84. */
  85. public static final String LOGIN_USER_KEY = "login_user_key";
  86. public static final String LOGIN_MEMBER_KEY = "login_member_key";
  87. public static final String LOGIN_APPLET_KEY = "login_applet_key";
  88. /**
  89. * 用户ID
  90. */
  91. public static final String JWT_USERID = "userid";
  92. /**
  93. * 用户名称
  94. */
  95. public static final String JWT_USERNAME = Claims.SUBJECT;
  96. /**
  97. * 用户头像
  98. */
  99. public static final String JWT_AVATAR = "avatar";
  100. /**
  101. * 创建时间
  102. */
  103. public static final String JWT_CREATED = "created";
  104. /**
  105. * 用户权限
  106. */
  107. public static final String JWT_AUTHORITIES = "authorities";
  108. /**
  109. * 参数管理 cache key
  110. */
  111. public static final String SYS_CONFIG_KEY = "sys_config:";
  112. /**
  113. * 字典管理 cache key
  114. */
  115. public static final String SYS_DICT_KEY = "sys_dict:";
  116. /**
  117. * 资源映射路径 前缀
  118. */
  119. public static final String RESOURCE_PREFIX = "/profile";
  120. /**
  121. * RMI 远程方法调用
  122. */
  123. public static final String LOOKUP_RMI = "rmi://";
  124. /**
  125. * LDAP 远程方法调用
  126. */
  127. public static final String LOOKUP_LDAP = "ldap://";
  128. public static final String SPAN_ID = "spanId";
  129. /**
  130. * 会员账号状态
  131. */
  132. public static class MEMBER_ACCOUNT_STATUS {
  133. public static final Integer FORBIDDEN = 0;
  134. public static final Integer NORMAL = 1;
  135. }
  136. /**
  137. * 登录提示信息
  138. */
  139. public static class LOGIN_INFO {
  140. public static final String WRONG = "账号或密码错误";
  141. public static final String FORBIDDEN = "您的账号被禁用,请联系管理员";
  142. public static final String SUCCESS = "登录成功";
  143. public static final String TO_REGISTER = "请先注册";
  144. }
  145. /**
  146. * 验证码相关提示信息
  147. */
  148. public static class VERIFY_CODE_INFO {
  149. public static final String EXPIRED = "验证码已过期";
  150. public static final String WRONG = "验证码错误";
  151. }
  152. /**
  153. * 上架状态0->下架1->上架
  154. */
  155. public static class PublishStatus {
  156. public static final Integer GROUNDING = 1;
  157. public static final Integer UNDERCARRIAGE = 0;
  158. }
  159. /**
  160. * 0->未支付1->支付宝2->微信
  161. */
  162. public static class PayType {
  163. public static final Integer NO_PAY = 0;
  164. public static final Integer ALIPAY = 1;
  165. public static final Integer WECHAT = 2;
  166. //系统扣款
  167. public static final Integer SYSTEM = 3;
  168. //手动扣款
  169. public static final Integer MANUAL = 4;
  170. }
  171. /**
  172. * 订单来源 购物车cart
  173. */
  174. public static class OrderFrom {
  175. public static final String CART = "cart";
  176. }
  177. /**
  178. * 订单状态 0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单
  179. */
  180. public static class OrderStatus {
  181. public static final Integer NOTPAID = 0;
  182. public static final Integer SEND = 1;
  183. public static final Integer GET = 2;
  184. public static final Integer CONFIRM = 3;
  185. public static final Integer CLOSED = 4;
  186. public static final Integer UNVAILD = 5;
  187. }
  188. /**
  189. * H5订单查询状态
  190. * -1->全部 0->待付款1->待发货2->待收货3->已完成4->已关闭5->无效订单 -2->售后单
  191. */
  192. public static class H5OrderStatus{
  193. public static final Integer ALL = -1;
  194. public static final Integer UN_PAY = 0;
  195. public static final Integer NOT_DELIVERED = 1;
  196. public static final Integer DELIVERED = 2;
  197. public static final Integer COMPLETED = 3;
  198. public static final Integer CLOSED = 4;
  199. public static final Integer INVALID = 5;
  200. public static final Integer REFUND = -2;
  201. }
  202. /**
  203. * 交易类型1为支付 2为提现 3为退款
  204. */
  205. public static class PaymentOpType {
  206. public static final Integer PAY = 1;
  207. public static final Integer WITHDRAWAL = 2;
  208. public static final Integer REFUND = 3;
  209. }
  210. /**
  211. * 状态0未完成交易 1完成关键交易
  212. */
  213. public static class PaymentStatus {
  214. public static final Integer INCOMPLETE = 0;
  215. public static final Integer COMPLETE = 1;
  216. }
  217. public static class OptType {
  218. public static final Integer AGREE = 1;
  219. public static final Integer REFUSE = 2;
  220. public static final Integer GIVING = 3;
  221. }
  222. }