Constants.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. package com.qs.mp.common.constant;
  2. import io.jsonwebtoken.Claims;
  3. /**
  4. * 通用常量信息
  5. *
  6. * @author ygp
  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 SMS_CAPTCHA_CODE_KEY = "sms_captcha_codes:";
  58. /**
  59. * 登录用户 redis key
  60. */
  61. public static final String LOGIN_TOKEN_KEY = "login_tokens:";
  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 CHANNEL_ROLE = "channelRole";
  82. /**
  83. * 令牌前缀
  84. */
  85. public static final String TOKEN_PREFIX = "Bearer ";
  86. /**
  87. * 令牌前缀
  88. */
  89. public static final String LOGIN_USER_KEY = "login_user_key";
  90. /**
  91. * 用户ID
  92. */
  93. public static final String JWT_USERID = "userid";
  94. /**
  95. * 用户名称
  96. */
  97. public static final String JWT_USERNAME = Claims.SUBJECT;
  98. /**
  99. * 用户头像
  100. */
  101. public static final String JWT_AVATAR = "avatar";
  102. /**
  103. * 创建时间
  104. */
  105. public static final String JWT_CREATED = "created";
  106. /**
  107. * 用户权限
  108. */
  109. public static final String JWT_AUTHORITIES = "authorities";
  110. /**
  111. * 参数管理 cache key
  112. */
  113. public static final String SYS_CONFIG_KEY = "sys_config:";
  114. /**
  115. * 字典管理 cache key
  116. */
  117. public static final String SYS_DICT_KEY = "sys_dict:";
  118. /**
  119. * 资源映射路径 前缀
  120. */
  121. public static final String RESOURCE_PREFIX = "/profile";
  122. /**
  123. * RMI 远程方法调用
  124. */
  125. public static final String LOOKUP_RMI = "rmi://";
  126. /**
  127. * LDAP 远程方法调用
  128. */
  129. public static final String LOOKUP_LDAP = "ldap://";
  130. /**
  131. * 优惠券默认图片
  132. */
  133. public static final String COUPON_PIC = "coupon.png";
  134. /**
  135. * 盲豆默认图片
  136. */
  137. public static final String MANGDOU_PIC = "md.png";
  138. }