Sfoglia il codice sorgente

feat : game-module模块里面项目修改包名, 代码提交

bilingfeng 2 anni fa
parent
commit
877e07d552
100 ha cambiato i file con 5047 aggiunte e 4998 eliminazioni
  1. 0 64
      game-module/game-common/src/main/java/com/zanxiang/common/base/BasePage.java
  2. 0 219
      game-module/game-common/src/main/java/com/zanxiang/common/constant/Constants.java
  3. 0 79
      game-module/game-common/src/main/java/com/zanxiang/common/domain/ResultMap.java
  4. 0 111
      game-module/game-common/src/main/java/com/zanxiang/common/domain/ResultVO.java
  5. 0 39
      game-module/game-common/src/main/java/com/zanxiang/common/enums/AppletStoreEnum.java
  6. 0 35
      game-module/game-common/src/main/java/com/zanxiang/common/enums/BanStatusEnum.java
  7. 0 39
      game-module/game-common/src/main/java/com/zanxiang/common/enums/CallBackEnum.java
  8. 0 38
      game-module/game-common/src/main/java/com/zanxiang/common/enums/CpStatusEnum.java
  9. 0 33
      game-module/game-common/src/main/java/com/zanxiang/common/enums/DeleteEnum.java
  10. 0 55
      game-module/game-common/src/main/java/com/zanxiang/common/enums/DeviceTypeEnum.java
  11. 0 65
      game-module/game-common/src/main/java/com/zanxiang/common/enums/ExpireTimeEnum.java
  12. 0 46
      game-module/game-common/src/main/java/com/zanxiang/common/enums/FileTypeEnum.java
  13. 0 44
      game-module/game-common/src/main/java/com/zanxiang/common/enums/GameCategoryEnum.java
  14. 0 44
      game-module/game-common/src/main/java/com/zanxiang/common/enums/GameStatusEnum.java
  15. 0 50
      game-module/game-common/src/main/java/com/zanxiang/common/enums/GameStrategyTypeEnum.java
  16. 0 294
      game-module/game-common/src/main/java/com/zanxiang/common/enums/HttpStatusEnum.java
  17. 0 33
      game-module/game-common/src/main/java/com/zanxiang/common/enums/MaxPayLock.java
  18. 0 44
      game-module/game-common/src/main/java/com/zanxiang/common/enums/OrderStateEnum.java
  19. 0 77
      game-module/game-common/src/main/java/com/zanxiang/common/enums/OsEnum.java
  20. 0 51
      game-module/game-common/src/main/java/com/zanxiang/common/enums/Pay/AlipayPayConfigEnum.java
  21. 0 46
      game-module/game-common/src/main/java/com/zanxiang/common/enums/Pay/WxPayConfigEnum.java
  22. 0 49
      game-module/game-common/src/main/java/com/zanxiang/common/enums/PayApplicationTypeEnum.java
  23. 0 85
      game-module/game-common/src/main/java/com/zanxiang/common/enums/PayDeviceEnum.java
  24. 0 66
      game-module/game-common/src/main/java/com/zanxiang/common/enums/PayWayEnum.java
  25. 0 57
      game-module/game-common/src/main/java/com/zanxiang/common/enums/PromoAccountTypeEnum.java
  26. 0 62
      game-module/game-common/src/main/java/com/zanxiang/common/enums/PromoMediaTypeEnum.java
  27. 0 57
      game-module/game-common/src/main/java/com/zanxiang/common/enums/PromoProviderEnum.java
  28. 0 61
      game-module/game-common/src/main/java/com/zanxiang/common/enums/SmsTypeEnum.java
  29. 0 33
      game-module/game-common/src/main/java/com/zanxiang/common/enums/StatusEnum.java
  30. 0 84
      game-module/game-common/src/main/java/com/zanxiang/common/enums/VipLevelEnum.java
  31. 0 59
      game-module/game-common/src/main/java/com/zanxiang/common/exception/BaseException.java
  32. 0 42
      game-module/game-common/src/main/java/com/zanxiang/common/exception/CustomException.java
  33. 0 19
      game-module/game-common/src/main/java/com/zanxiang/common/exception/ParamNullException.java
  34. 0 13
      game-module/game-common/src/main/java/com/zanxiang/common/exception/PreAuthorizeException.java
  35. 0 22
      game-module/game-common/src/main/java/com/zanxiang/common/exception/UtilException.java
  36. 0 101
      game-module/game-common/src/main/java/com/zanxiang/common/handler/GlobalExceptionHandler.java
  37. 0 91
      game-module/game-common/src/main/java/com/zanxiang/common/text/CharsetKit.java
  38. 0 870
      game-module/game-common/src/main/java/com/zanxiang/common/text/Convert.java
  39. 0 77
      game-module/game-common/src/main/java/com/zanxiang/common/text/StrFormatter.java
  40. 0 441
      game-module/game-common/src/main/java/com/zanxiang/common/text/UUID.java
  41. 0 115
      game-module/game-common/src/main/java/com/zanxiang/common/utils/BaseHttpSSLSocketFactory.java
  42. 0 56
      game-module/game-common/src/main/java/com/zanxiang/common/utils/DateUtils.java
  43. 0 44
      game-module/game-common/src/main/java/com/zanxiang/common/utils/MD5Util.java
  44. 0 102
      game-module/game-common/src/main/java/com/zanxiang/common/utils/SpringUtils.java
  45. 0 366
      game-module/game-common/src/main/java/com/zanxiang/common/utils/StringUtils.java
  46. 0 149
      game-module/game-common/src/main/java/com/zanxiang/common/utils/URIUtil.java
  47. 0 144
      game-module/game-common/src/main/java/com/zanxiang/common/utils/bean/BeanUtils.java
  48. 0 139
      game-module/game-common/src/main/java/com/zanxiang/common/utils/http/AjaxResult.java
  49. 0 88
      game-module/game-common/src/main/java/com/zanxiang/common/utils/http/HttpStatus.java
  50. 64 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/base/BasePage.java
  51. 219 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/constant/Constants.java
  52. 79 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/domain/ResultMap.java
  53. 111 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/domain/ResultVO.java
  54. 39 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/AppletStoreEnum.java
  55. 35 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/BanStatusEnum.java
  56. 39 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/CallBackEnum.java
  57. 38 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/CpStatusEnum.java
  58. 33 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/DeleteEnum.java
  59. 55 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/DeviceTypeEnum.java
  60. 65 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/ExpireTimeEnum.java
  61. 46 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/FileTypeEnum.java
  62. 44 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/GameCategoryEnum.java
  63. 44 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/GameStatusEnum.java
  64. 50 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/GameStrategyTypeEnum.java
  65. 294 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/HttpStatusEnum.java
  66. 33 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/MaxPayLock.java
  67. 44 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/OrderStateEnum.java
  68. 77 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/OsEnum.java
  69. 51 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/Pay/AlipayPayConfigEnum.java
  70. 46 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/Pay/WxPayConfigEnum.java
  71. 49 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PayApplicationTypeEnum.java
  72. 85 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PayDeviceEnum.java
  73. 66 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PayWayEnum.java
  74. 57 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PromoAccountTypeEnum.java
  75. 62 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PromoMediaTypeEnum.java
  76. 57 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PromoProviderEnum.java
  77. 61 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/SmsTypeEnum.java
  78. 33 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/StatusEnum.java
  79. 84 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/enums/VipLevelEnum.java
  80. 59 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/exception/BaseException.java
  81. 42 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/exception/CustomException.java
  82. 19 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/exception/ParamNullException.java
  83. 13 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/exception/PreAuthorizeException.java
  84. 22 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/exception/UtilException.java
  85. 101 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/handler/GlobalExceptionHandler.java
  86. 91 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/text/CharsetKit.java
  87. 870 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/text/Convert.java
  88. 77 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/text/StrFormatter.java
  89. 441 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/text/UUID.java
  90. 115 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/BaseHttpSSLSocketFactory.java
  91. 56 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/DateUtils.java
  92. 44 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/MD5Util.java
  93. 102 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/SpringUtils.java
  94. 366 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/StringUtils.java
  95. 149 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/URIUtil.java
  96. 144 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/bean/BeanUtils.java
  97. 139 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/http/AjaxResult.java
  98. 88 0
      game-module/game-common/src/main/java/com/zanxiang/game/common/utils/http/HttpStatus.java
  99. 36 0
      game-module/game-manage/src/main/java/com/zanxiang/game/manage/ManageApplication.java
  100. 13 0
      game-module/game-manage/src/main/java/com/zanxiang/game/manage/config/MybatisPlusConfig.java

+ 0 - 64
game-module/game-common/src/main/java/com/zanxiang/common/base/BasePage.java

@@ -1,64 +0,0 @@
-package com.zanxiang.common.base;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
-import java.time.LocalDate;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-22
- * @description : 分页通用参数
- */
-@Data
-public class BasePage<T> {
-
-    /**
-     * 当前记录起始索引
-     */
-    @NotNull(message = "当前页数不可为空")
-    @Min(value = 1, message = "起始页最小为 1")
-    @ApiModelProperty(value = "当前记录起始索引")
-    private Integer pageNum;
-
-    /**
-     * 每页显示记录数
-     */
-    @NotNull(message = "单页数量不可为空")
-    @Min(value = 1, message = "页面大小(2~200)之间")
-    @Max(value = 200, message = "页面大小(2~200)之间")
-    @ApiModelProperty(value = "每页显示记录数")
-    private Integer pageSize;
-
-    /**
-     * 开始时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    @ApiModelProperty(value = "开始时间")
-    private LocalDate beginDate;
-
-    /**
-     * 结束时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    @ApiModelProperty(value = "结束时间")
-    private LocalDate endDate;
-
-    /**
-     * 构造方法
-     *
-     * @return : 返回分页对象
-     */
-    public IPage<T> toPage() {
-        return new Page<>(pageNum, pageSize);
-    }
-}

+ 0 - 219
game-module/game-common/src/main/java/com/zanxiang/common/constant/Constants.java

@@ -1,219 +0,0 @@
-package com.zanxiang.common.constant;
-
-import java.math.BigDecimal;
-
-/**
- * 通用常量信息
- *
- * @author ruoyi
- */
-public class Constants {
-    /**
-     * UTF-8 字符集
-     */
-    public static final String UTF8 = "UTF-8";
-
-    /**
-     * GBK 字符集
-     */
-    public static final String GBK = "GBK";
-
-    /**
-     * http请求
-     */
-    public static final String HTTP = "http://";
-
-    /**
-     * https请求
-     */
-    public static final String HTTPS = "https://";
-
-    /**
-     * 登录成功
-     */
-    public static final String LOGIN_SUCCESS = "Success";
-
-    /**
-     * 注销
-     */
-    public static final String LOGOUT = "Logout";
-
-    /**
-     * 注册
-     */
-    public static final String REGISTER = "Register";
-
-    /**
-     * 登录失败
-     */
-    public static final String LOGIN_FAIL = "Error";
-
-    /**
-     * 当前记录起始索引
-     */
-    public static final String PAGE_NUM = "pageNum";
-
-    /**
-     * 每页显示记录数
-     */
-    public static final String PAGE_SIZE = "pageSize";
-
-    /**
-     * 排序列
-     */
-    public static final String ORDER_BY_COLUMN = "orderByColumn";
-
-    /**
-     * 排序的方向 "desc" 或者 "asc".
-     */
-    public static final String IS_ASC = "isAsc";
-
-    /**
-     * 验证码 redis key
-     */
-    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
-
-    /**
-     * 验证码有效期(分钟)
-     */
-    public static final long CAPTCHA_EXPIRATION = 5;
-
-    /**
-     * 最大令牌有效期(秒)
-     */
-    public final static long TOKEN_EXPIRE = 24 * 60 * 60;
-
-    /**
-     * 参数管理 cache key
-     */
-    public static final String SYS_CONFIG_KEY = "sys_config:";
-
-    /**
-     * 微信信息存储的前缀(所有 WxJava存储的信息都已这个开头)
-     */
-    public static final String WX_PREFIX = "wx:";
-
-    /**
-     * 微信预授权码前缀(存储用户 id)
-     */
-    public static final String WX_PRE_AUTH_PREFIX = "wx-auth:";
-
-    /**
-     * 微信延时消息列表的前缀:yyyy-MM-dd_HH:mm
-     */
-    public static final String WX_SEND_MSG = "wx-send-msg:";
-
-    /**
-     * 读取微信延时消息列表的锁
-     */
-    public static final String WX_SEND_MSG_LOCK = "wx-send-msg_lock:";
-
-    /**
-     * 刷新 access_token时的锁
-     */
-    public static final String AUTH_ACCESS_TOKEN_LOCK = "auth_access_token_lock:";
-
-    /**
-     * 字典管理 cache key
-     */
-    public static final String SYS_DICT_KEY = "sys_dict:";
-
-    /**
-     * 资源映射路径 前缀
-     */
-    public static final String RESOURCE_PREFIX = "/profile";
-
-    public static final String SINGLE_USER = "single_user_";
-
-    public static final String ROCKET_MQ_ORDER_MSG_KEY_KEFU = "sharding_key_kefu:";
-
-    /**
-     * 异步同步粉丝 Redis锁
-     */
-    public static final String ROCK_ASYNC_MP_FANS = "ROCK_ASYNC_MP_FANS_";
-
-    public static final BigDecimal NUM_100 = new BigDecimal(100);
-
-    public static final boolean ENABLE_NO = false;
-    public static final boolean ENABLE_YES = true;
-
-    /**
-     * 异步消费时间的锁
-     */
-    public static final String ASYNC_SAVE_LOG_LAST_TIME = "ASYNC_SAVE_LOG_LAST_TIME";
-
-    /**
-     * 临时缓存 mpFansLog日志
-     */
-    public static final String MP_FANS_LOG_BUFFER = "MP_FANS_LOG_BUFFER";
-    /**
-     * 临时缓存的 mp_kefu_msg_exection_log日志
-     */
-    public static final String KEFU_MSG_EXECUTION_DETAIL_BUFFER = "KEFU_MSG_EXECUTION_DETAIL_BUFFER";
-
-    /**
-     * 客服消息执行日志的统计信息
-     */
-    public static final String KEFU_MSG_EXECUTION_LOG_STAT = "KEFU_MSG_EXECUTION_LOG_STAT";
-
-    public static final String KEFU_STRATEGY_MQ_STAT = "KEFU_STRATEGY_MQ_STAT:";
-
-    public static final String TEMPLATE_STRATEGY_MQ_STAT = "TEMPLATE_STRATEGY_MQ_STAT:";
-
-    public static final String GROUP_STRATEGY_MQ_STAT = "GROUP_STRATEGY_MQ_STAT:";
-
-    /**
-     * 模板消息执行统计
-     */
-    public static final String TEMPLATE_SEND_DETAIL_STAT = "TEMPLATE_SEND_DETAIL_STAT:";
-
-    /**
-     * 模板消息回调执行统计
-     */
-    public static final String TEMPLATE_SEND_CALL_BACK_SUCCESS_STAT = "TEMPLATE_SEND_CALL_BACK_SUCCESS_STAT:";
-
-    /**
-     * 模板消息回调执行统计
-     */
-    public static final String TEMPLATE_SEND_CALL_BACK_FAILED_STAT = "TEMPLATE_SEND_CALL_BACK_FAILED_STAT:";
-
-    /**
-     * 模板消息发送日志,冒号后面加公众号 appid
-     */
-    public static final String TEMPLATE_SEND_LOG = "TEMPLATE_SEND_LOG:";
-
-    public static final String REDIS_CACHE_PREFIX = "SpringCache:";
-
-    /**
-     * 网关账号信息缓存
-     */
-    public static final String REDIS_GATEWAY_ACCOUNT_INFO = "Gateway:AccountInfo";
-
-    /**
-     * 网关服务信息
-     */
-    public static final String REDIS_GATEWAY_SERVER_INFO = "Gateway:ServerInfo:";
-
-    /**
-     * 网关白名单列表
-     */
-    public static final String REDIS_GATEWAY_WHITE_URL = "Gateway:WhiteUrl:";
-
-    /**
-     * 已登录用户列表
-     */
-    public static final String REDIS_LOGIN_USER_LIST = "Gateway:LoginUserList:";
-
-
-    /**
-     * 成功
-     */
-    public static final String SUCCESS = "success";
-
-    /**
-     * 失败
-     */
-    public static final String FAIL = "fail";
-
-
-}

+ 0 - 79
game-module/game-common/src/main/java/com/zanxiang/common/domain/ResultMap.java

@@ -1,79 +0,0 @@
-package com.zanxiang.common.domain;
-
-import com.zanxiang.common.enums.HttpStatusEnum;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 返回对象
- *
- * @author xufeng
- * @date 2022/6/9 10:41
- */
-public class ResultMap extends HashMap<String, Object> {
-
-    private static final long serialVersionUID = 1L;
-
-    public ResultMap() {
-        put("code", 0);
-    }
-
-    public static ResultMap error() {
-        return error(500, "未知异常,请联系管理员");
-    }
-
-    public static ResultMap error(String msg) {
-        return error(500, msg);
-    }
-
-    public static ResultMap error(int code, String msg) {
-        ResultMap r = new ResultMap();
-        r.put("code", code);
-        r.put("msg", msg);
-        return r;
-    }
-
-    public static ResultMap ok() {
-        ResultMap r = new ResultMap();
-        r.put("code", HttpStatusEnum.SUCCESS.getCode());
-        r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
-        return r;
-    }
-
-    public static ResultMap ok(Object data) {
-        ResultMap r = new ResultMap();
-        r.put("code", HttpStatusEnum.SUCCESS.getCode());
-        r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
-        r.put("data", data);
-        return r;
-    }
-
-    public static ResultMap ok(Long deviceType, Object data, String orderId) {
-        ResultMap r = new ResultMap();
-        r.put("code", HttpStatusEnum.SUCCESS.getCode());
-        r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
-        HashMap<String, Object> dataMap = new HashMap<>(2);
-        dataMap.put("data", data);
-        dataMap.put("deviceType", deviceType);
-        dataMap.put("orderId", orderId);
-        r.put("data", dataMap);
-        return r;
-    }
-
-    public static ResultMap ok(Map<String, Object> map) {
-        ResultMap r = new ResultMap();
-        r.put("code", HttpStatusEnum.SUCCESS.getCode());
-        r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
-        HashMap<String, Object> dataMap = new HashMap<>(2);
-        dataMap.putAll(map);
-        r.put("data", dataMap);
-        return r;
-    }
-
-    @Override
-    public ResultMap put(String key, Object value) {
-        super.put(key, value);
-        return this;
-    }
-}

+ 0 - 111
game-module/game-common/src/main/java/com/zanxiang/common/domain/ResultVO.java

@@ -1,111 +0,0 @@
-package com.zanxiang.common.domain;
-
-import com.zanxiang.common.enums.HttpStatusEnum;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-07
- * @description : http响应消息
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class ResultVO<T> implements Serializable {
-
-    /**
-     * 序列化
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 错误码
-     */
-    private Integer code;
-
-    /**
-     * 错误信息
-     */
-    private String msg;
-
-    /**
-     * 返回内容
-     */
-    private T data;
-
-    /**
-     * 错误消息返回构造
-     *
-     * @param httpStatusEnum : http响应消息枚举
-     */
-    public ResultVO(HttpStatusEnum httpStatusEnum) {
-        this.code = httpStatusEnum.getCode();
-        this.msg = httpStatusEnum.getMsg();
-    }
-
-    /**
-     * 默认返回成功构造
-     *
-     * @param data : 返回的内容
-     */
-    public ResultVO(T data) {
-        this.code = HttpStatusEnum.SUCCESS.getCode();
-        this.msg = HttpStatusEnum.SUCCESS.getMsg();
-        this.data = data;
-    }
-
-    /**
-     * 消息返回构造
-     *
-     * @param httpStatusEnum : http响应消息枚举
-     * @param data           : 返回的内容
-     */
-    public ResultVO(HttpStatusEnum httpStatusEnum, T data) {
-        this.code = httpStatusEnum.getCode();
-        this.msg = httpStatusEnum.getMsg();
-        this.data = data;
-    }
-
-    /**
-     * 自定义消息异常
-     *
-     * @param code : 错误码
-     * @param msg  : 错误消息
-     */
-    public ResultVO(int code, String msg) {
-        this.code = code;
-        this.msg = msg;
-    }
-
-    /**
-     * 判断是否成功
-     */
-    public boolean isSuccess() {
-        return Objects.equals(HttpStatusEnum.SUCCESS.getCode(), this.code);
-    }
-
-    public static <T> ResultVO<T> fail(String msg) {
-        return new ResultVO<>(HttpStatusEnum.ERROR.getCode(), msg);
-    }
-
-    public static <T> ResultVO<T> ok(int code, String msg, T data) {
-        return new ResultVO<>(code, msg, data);
-    }
-
-    public static <T> ResultVO<T> ok(int code, String msg) {
-        return new ResultVO<>(code, msg);
-    }
-
-    public static <T> ResultVO<T> ok() {
-        return new ResultVO<>(HttpStatusEnum.SUCCESS.getCode(), HttpStatusEnum.SUCCESS.getMsg());
-    }
-
-    public static <T> ResultVO<T> ok(T data) {
-        return new ResultVO<>(HttpStatusEnum.SUCCESS.getCode(), HttpStatusEnum.SUCCESS.getMsg(), data);
-    }
-}

+ 0 - 39
game-module/game-common/src/main/java/com/zanxiang/common/enums/AppletStoreEnum.java

@@ -1,39 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2023-01-15
- * @description : 商城小程序枚举类型
- */
-@Getter
-@AllArgsConstructor
-public enum AppletStoreEnum {
-
-    /**
-     * 商城百货
-     */
-    STORE_GOODS(1, "商城百货"),
-
-    /**
-     * 商城美妆
-     */
-    STORE_BEAUTY(2, "商城美妆"),
-
-    /**
-     * 商城内容
-     */
-    STORE_CONTENT(3, "商城内容");
-
-    /**
-     * 账号类型
-     */
-    private Integer type;
-
-    /**
-     * 账号类型名称
-     */
-    private String name;
-}

+ 0 - 35
game-module/game-common/src/main/java/com/zanxiang/common/enums/BanStatusEnum.java

@@ -1,35 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-28
- * @description : ip封禁管理状态
- */
-@Getter
-@AllArgsConstructor
-public enum BanStatusEnum {
-
-    /**
-     * 正常
-     */
-    NORMAL_STATUS(0, "正常"),
-
-    /**
-     * 冻结/封禁 状态
-     */
-    BAN_STATUS(1, " 冻结/封禁 状态");
-
-    /**
-     * 状态
-     */
-    private Integer status;
-
-    /**
-     * 描述
-     */
-    private String describe;
-
-}

+ 0 - 39
game-module/game-common/src/main/java/com/zanxiang/common/enums/CallBackEnum.java

@@ -1,39 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2022-11-11
- * @description : 上报枚举
- */
-@Getter
-@AllArgsConstructor
-public enum CallBackEnum {
-
-    /**
-     * 未上报
-     */
-    UN_CALL_BACK(0, "未上报"),
-
-    /**
-     * 上报成功
-     */
-    SUCCESS_CALL_BACK(1, "上报成功"),
-
-    /**
-     * 上报失败
-     */
-    FAIL_CALL_BACK(2, "上报失败");
-
-    /**
-     * 数据类型
-     */
-    private Integer callBackStatus;
-
-    /**
-     * 描述
-     */
-    private String name;
-}

+ 0 - 38
game-module/game-common/src/main/java/com/zanxiang/common/enums/CpStatusEnum.java

@@ -1,38 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author xufeng
- * @date 2022/6/27 14:31
- */
-@Getter
-@AllArgsConstructor
-public enum CpStatusEnum {
-
-    /**
-     * 同步失败
-     */
-    FAIL(-1, "失败"),
-
-    /**
-     * 待同步
-     */
-    READY(1, "待同步"),
-
-    /**
-     * 同步成功
-     */
-    SUCCESS(2, "同步成功");
-
-    /**
-     * 类型
-     */
-    private Integer status;
-
-    /**
-     * 描述
-     */
-    private String desc;
-}

+ 0 - 33
game-module/game-common/src/main/java/com/zanxiang/common/enums/DeleteEnum.java

@@ -1,33 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author xufeng
- * @date 2022/6/13 11:39
- */
-@Getter
-@AllArgsConstructor
-public enum DeleteEnum {
-
-    /**
-     * 正常
-     */
-    NO(0, "正常"),
-
-    /**
-     * 已删除
-     */
-    YES(1, "已删除");
-
-    /**
-     *
-     */
-    private int code;
-
-    /**
-     * 状态
-     */
-    private String name;
-}

+ 0 - 55
game-module/game-common/src/main/java/com/zanxiang/common/enums/DeviceTypeEnum.java

@@ -1,55 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-07
- * @description : 客户端类型
- */
-@Getter
-@AllArgsConstructor
-public enum DeviceTypeEnum {
-
-    /**
-     * 安卓app
-     */
-    DEVICE_TYPE_ANDROID(1, "android"),
-
-    /**
-     * 苹果app
-     */
-    DEVICE_TYPE_IOS(2, "ios"),
-
-    /**
-     * h5网页
-     */
-    DEVICE_TYPE_H5(3, "h5"),
-
-    /**
-     * 小程序
-     */
-    DEVICE_TYPE_MINI_APP(4, "miniApp");
-
-    /**
-     * 设备类型
-     */
-    private Integer deviceType;
-
-    /**
-     * 描述
-     */
-    private String describe;
-
-    public static DeviceTypeEnum getByDeviceType(Integer deviceType) {
-        for (DeviceTypeEnum deviceTypeEnum : DeviceTypeEnum.values()) {
-            if (Objects.equals(deviceTypeEnum.getDeviceType(), deviceType)) {
-                return deviceTypeEnum;
-            }
-        }
-        return null;
-    }
-}

+ 0 - 65
game-module/game-common/src/main/java/com/zanxiang/common/enums/ExpireTimeEnum.java

@@ -1,65 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2021-11-16
- * @description : 时间常量
- */
-@Getter
-@AllArgsConstructor
-public enum ExpireTimeEnum {
-
-    /**
-     * 无固定期限
-     */
-    NONE(0, "无固定期限"),
-
-    /**
-     * 1分钟
-     */
-    ONE_MIN(60, "1分钟"),
-
-    /**
-     * 5分钟
-     */
-    FIVE_MIN(5 * 60, "5分钟"),
-
-    /**
-     * 1小时
-     */
-    ONE_HOUR(60 * 60, "1小时"),
-
-    /**
-     * 1天
-     */
-    ONE_DAY(24 * 60 * 60, "1天"),
-
-    /**
-     * 一周
-     */
-    ONE_WEEK(24 * 60 * 60 * 7, "一周"),
-
-    /**
-     * 1个月
-     */
-    ONE_MON(30 * 24 * 60 * 60, "1个月"),
-
-    /**
-     * 1年
-     */
-    ONE_YEAR(365 * 24 * 60 * 60, "1年");
-
-    /**
-     * 时间
-     */
-    private final long time;
-
-    /**
-     * 描述
-     */
-    private final String desc;
-
-}  

+ 0 - 46
game-module/game-common/src/main/java/com/zanxiang/common/enums/FileTypeEnum.java

@@ -1,46 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2021-08-11
- * @description : oss文件上传类型
- */
-@Getter
-public enum FileTypeEnum {
-
-    /**
-     * 视频类型
-     */
-    FILE_TYPE_VIDEO("video", "video/"),
-
-    /**
-     * 图片类型
-     */
-    FILE_TYPE_IMAGE("image", "image/");
-
-    /**
-     * 文件类型
-     */
-    private String fileType;
-
-    /**
-     * 文件存储文件名
-     */
-    private String filePath;
-
-    FileTypeEnum(String fileType, String filePath) {
-        this.fileType = fileType;
-        this.filePath = filePath;
-    }
-
-    public static FileTypeEnum getByFileType(String fileType) {
-        for (FileTypeEnum fileTypeEnum : FileTypeEnum.values()) {
-            if (fileTypeEnum.getFileType().equals(fileType)) {
-                return fileTypeEnum;
-            }
-        }
-        return null;
-    }
-}

+ 0 - 44
game-module/game-common/src/main/java/com/zanxiang/common/enums/GameCategoryEnum.java

@@ -1,44 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2022-07-13
- * @description : 游戏应用类型
- */
-@Getter
-@AllArgsConstructor
-public enum GameCategoryEnum {
-
-    /**
-     * 微信小游戏
-     */
-    CATEGORY_WX_APPLET("wx_applet", "微信小游戏"),
-
-    /**
-     * 抖音小游戏
-     */
-    CATEGORY_DY_APPLET("byte_applet", "抖音小游戏"),
-
-    /**
-     * h5游戏
-     */
-    CATEGORY_H5("h5", "h5游戏"),
-
-    /**
-     * app游戏
-     */
-    CATEGORY_APP("app", "app游戏");
-
-    /**
-     * 游戏分类key
-     */
-    private String key;
-
-    /**
-     * 描述
-     */
-    private String name;
-}

+ 0 - 44
game-module/game-common/src/main/java/com/zanxiang/common/enums/GameStatusEnum.java

@@ -1,44 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2022-11-15
- * @description : 游戏状态
- */
-@Getter
-@AllArgsConstructor
-public enum GameStatusEnum {
-
-    /**
-     * 未接入
-     */
-    UN_JOIN_UP(1, "未接入"),
-
-    /**
-     * 接入中
-     */
-    NOW_JOIN_UP(2, "接入中"),
-
-    /**
-     * 上线
-     */
-    ON_LINE(3, "上线"),
-
-    /**
-     * 下线
-     */
-    OFF_LINE(4, "下线");
-
-    /**
-     * 状态
-     */
-    private Integer status;
-
-    /**
-     * 描述
-     */
-    private String name;
-}

+ 0 - 50
game-module/game-common/src/main/java/com/zanxiang/common/enums/GameStrategyTypeEnum.java

@@ -1,50 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2023-02-16
- * @description : 游戏支付策略类型
- */
-@Getter
-@AllArgsConstructor
-public enum GameStrategyTypeEnum {
-
-    /**
-     * 切换规则
-     */
-    CUT_RULE(1, "切换规则"),
-
-    /**
-     * 显示规则
-     */
-    SHOW_RULE(2, "显示规则"),
-
-    /**
-     * 订单起量切换规则
-     */
-    QUANTITY_CUT_RULE(3, "订单起量切换规则");
-
-    /**
-     * 游戏支付策略类型
-     */
-    private Integer type;
-
-    /**
-     * 游戏支付策略类型名称
-     */
-    private String name;
-
-    public static String getNameByType(Integer type) {
-        for (GameStrategyTypeEnum gameStrategyTypeEnum : GameStrategyTypeEnum.values()) {
-            if (Objects.equals(type, gameStrategyTypeEnum.getType())) {
-                return gameStrategyTypeEnum.getName();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 294
game-module/game-common/src/main/java/com/zanxiang/common/enums/HttpStatusEnum.java

@@ -1,294 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-07
- * @description : 用户状态
- */
-@Getter
-@AllArgsConstructor
-public enum HttpStatusEnum {
-
-    /**
-     * 成功
-     */
-    SUCCESS(200, "success"),
-
-    /**
-     * 失败
-     */
-    FAIL(400, "failed"),
-
-    /**
-     * 服务器异常
-     */
-    ERROR(500, "服务器异常"),
-
-    /**
-     * 未知错误
-     */
-    UNKNOWN_ERROR(-9999, "未知错误"),
-
-    /**
-     * 请先登录
-     */
-    USER_NO_LOGIN(40400, "请登录"),
-
-    /**
-     * 用户名为空
-     */
-    USERNAME_EMPTY(41101, "用户名为空"),
-
-    /**
-     * 用户名含敏感字
-     */
-    USERNAME_SENSITIVE(41102, "用户名含敏感字"),
-
-    /**
-     * 用户名已存在
-     */
-    USERNAME_EXISTS(41103, "用户名已存在"),
-
-    /**
-     * 用户名不存在
-     */
-    USERNAME_NOT_EXISTS(41114, "用户名不存在"),
-
-    /**
-     * 用户名或密码错误
-     */
-    USERNAME_OR_PASSWORD_ERR(41104, "用户名或密码错误"),
-
-    /**
-     * 用户名太短
-     */
-    USERNAME_TOO_SHORT(41105, "用户名太短"),
-
-    /**
-     * 用户名太长
-     */
-    USERNAME_TOO_LONG(41106, "用户名太长"),
-
-    /**
-     * 用户名必须为数字字母组合
-     */
-    USERNAME_BAD_CHAR(41107, "用户名必须为数字字母组合"),
-
-    /**
-     * 账号停用
-     */
-    ACCOUNT_HALT(41108, "账号停用"),
-
-    /**
-     * ip封禁
-     */
-    IP_HALT(41109, "ip封禁"),
-
-    /**
-     * 账户未绑定手机
-     */
-    ACCOUNT_NOT_BIND_PHONE(41110, "账户未绑定手机"),
-
-    /**
-     * 手机号请使用手机注册
-     */
-    USERNAME_LIKE_MOBILE(41113, "手机号请使用手机注册"),
-
-    /**
-     * 密码为空
-     */
-    PASSWORD_EMPTY(41201, "密码为空"),
-
-    /**
-     * 密码必须为数字字母组合
-     */
-    PASSWORD_BAD_CHAR(41202, "密码必须为数字字母组合"),
-
-    /**
-     * 密码太长
-     */
-    PASSWORD_TOO_LONG(41203, "密码太长"),
-
-    /**
-     * 密码太短
-     */
-    PASSWORD_TOO_SHORT(41204, "密码太短"),
-
-    /**
-     * 密码错误
-     */
-    PASSWORD_ERROR(41205, "密码错误"),
-
-    /**
-     * 旧密码错误
-     */
-    OLD_PASSWORD_ERROR(41206, "旧密码错误"),
-
-    /**
-     * 旧密码不可为空
-     */
-    OLD_PASSWORD_EMPTY(41207, "旧密码不可为空"),
-
-    /**
-     * 手机号为空
-     */
-    PHONE_EMPTY(41301, "手机号为空"),
-
-    /**
-     * 手机号格式错误
-     */
-    PHONE_ERROR(41302, "手机号格式错误"),
-
-    /**
-     * 未绑定手机号
-     */
-    PHONE_NOT_BIND(41304, "未绑定手机号"),
-
-    /**
-     * 账号已绑定该手机号
-     */
-    PHONE_IS_BIND(41305, "账号已绑定该手机号"),
-
-    /**
-     * 验证码发送过于频繁
-     */
-    PHONE_SEND_MORE(41306, "验证码发送过于频繁"),
-
-    /**
-     * 验证码发送失败
-     */
-    PHONE_SEND_ERROR(41307, "验证码发送失败"),
-
-    /**
-     * 验证码已发送请稍后再试
-     */
-    PHONE_HAS_SEND(41308, "验证码已发送请稍后再试"),
-
-    /**
-     * 手机号已注册
-     */
-    PHONE_IS_REG(41309, "手机号已注册"),
-
-    /**
-     * 手机号未注册
-     */
-    PHONE_NOT_REG(41310, "手机号未注册"),
-
-    /**
-     * 请先校验原有手机号
-     */
-    PHONE_NOT_CHECK(41311, "请先校验原有手机号"),
-
-    /**
-     * 手机号绑定账号过多
-     */
-    PHONE_BIND_TOO_MUCH(41312, "手机号绑定账号过多"),
-
-    /**
-     * 手机号错误
-     */
-    PHONE_NUM_ERROR(41313, "手机号错误"),
-
-    /**
-     * 验证码错误
-     */
-    CODE_ERROR(41601, "验证码错误"),
-
-    /**
-     * 验证码类型错误
-     */
-    CODE_TYPE_ERROR(41602, "验证码类型错误"),
-
-    /**
-     * 验证码类型错误
-     */
-    CODE_NOT_SEND(41603, "验证码类型错误"),
-
-    /**
-     * 验证码已过期
-     */
-    CODE_IS_EXPIRED(41604, "验证码已过期"),
-
-    /**
-     * 配置错误
-     */
-    CONFIG_ERROR(41699, "配置错误"),
-
-    /**
-     * 参数非法
-     */
-    INVALID_PARAMS(1000, "参数非法"),
-
-    /**
-     * 订单游戏id为空
-     */
-    ORDER_GAME_ID_IS_NULL(41501, "订单游戏id为空"),
-
-    /**
-     * 订单不存在
-     */
-    ORDER_NO_FIND(41502, "订单不存在"),
-
-    /**
-     * 玩家充值未达标
-     */
-    ORDER_AMOUNT_IS_NULL(41503, "订单金额为空"),
-
-    /**
-     * 生成access_token失败
-     */
-    ACCESS_TOKEN_CREATE_ERROR(41504, "生成access_token失败"),
-
-    /**
-     * 米大师连接失败
-     */
-    MDS_CONNECT_ERROR(41505, "米大师连接失败"),
-
-    /**
-     * 获取配置异常
-     */
-    GET_CONFIG_ERROR(41507, "获取配置异常"),
-
-    /**
-     * 游戏用户未创建成功
-     */
-    GAME_USER_UN_CREATE(41511, "更新游戏角色时,检测为先创建游戏用户"),
-
-    /**
-     * 实名认证名字不合法
-     */
-    CARD_NAME_ERROR(41512, "名字输入错误"),
-
-    /**
-     * 实名认证身份证号不合法
-     */
-    CARD_ID_ERROR(41513, "身份证号输入错误"),
-
-    /**
-     * 已实名认证, 不可重复操作
-     */
-    REPEAT_OPERATE(41514, "已实名认证, 不可重复操作"),
-
-    /**
-     * 实名认证失败
-     */
-    AUTHENTICATION_FAIL(41515, "实名认证失败"),
-
-    /**
-     * 参数为空
-     */
-    PARAM_IS_NULL(41500, "参数为空:");
-
-    /**
-     * 回传类型
-     */
-    private final Integer code;
-
-    /**
-     * 回传名称
-     */
-    private final String msg;
-}

+ 0 - 33
game-module/game-common/src/main/java/com/zanxiang/common/enums/MaxPayLock.java

@@ -1,33 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author xufeng
- * @date 2022/6/13 13:39
- */
-@Getter
-@AllArgsConstructor
-public enum MaxPayLock {
-
-    /**
-     * 已锁定
-     */
-    LOCK(1, "已锁定"),
-
-    /**
-     * 未锁定
-     */
-    UNLOCK(0, "未锁定");
-
-    /**
-     * 状态
-     */
-    private Integer code;
-
-    /**
-     * 描述
-     */
-    private String name;
-}

+ 0 - 44
game-module/game-common/src/main/java/com/zanxiang/common/enums/OrderStateEnum.java

@@ -1,44 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-07
- * @description : 用户状态
- */
-@Getter
-@AllArgsConstructor
-public enum OrderStateEnum {
-
-    /**
-     * 预下单
-     */
-    READY_PAY(0, "预下单"),
-
-    /**
-     * 待支付
-     */
-    WAIT_PAY(1, "待支付"),
-
-    /**
-     * 支付成功
-     */
-    SUCCESS_PAY(2, "支付成功"),
-
-    /**
-     * 订单关闭
-     */
-    CANCEL_PAY(-1, "订单关闭");
-
-    /**
-     * 状态
-     */
-    private final Integer code;
-
-    /**
-     * 描述
-     */
-    private final String msg;
-}

+ 0 - 77
game-module/game-common/src/main/java/com/zanxiang/common/enums/OsEnum.java

@@ -1,77 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-30
- * @description : 操作系统类型
- */
-@Getter
-@AllArgsConstructor
-public enum OsEnum {
-
-    /**
-     * 安卓
-     */
-    SYSTEM_ANDROID(1, "android", "安卓手机操作系统"),
-
-    /**
-     * 苹果
-     */
-    SYSTEM_IOS(2, "ios", "苹果手机操作系统"),
-
-    /**
-     * window操作系统
-     */
-    SYSTEM_WINDOW(3, "windows", "window操作系统"),
-
-    /**
-     * Mac操作系统
-     */
-    SYSTEM_MAC(4, "mac", "Mac操作系统"),
-
-    /**
-     * linux操作系统
-     */
-    SYSTEM_LINUX(5, "linux", "linux操作系统"),
-
-    /**
-     * 其它操作系统
-     */
-    SYSTEM_OTHER(0, "other", "other操作系统");
-
-    /**
-     * 数据类型
-     */
-    private Integer osType;
-
-    /**
-     * 平台id
-     */
-    private String os;
-
-    /**
-     * 平台名称
-     */
-    private String osName;
-
-
-    /**
-     * 得到名字
-     *
-     * @param name 名字
-     * @return {@link Integer}
-     */
-    public static Integer getByName(String name) {
-        for (OsEnum osEnum : OsEnum.values()) {
-            if (Objects.equals(name, osEnum.getOsName())) {
-                return osEnum.getOsType();
-            }
-        }
-        return OsEnum.SYSTEM_OTHER.osType;
-    }
-}

+ 0 - 51
game-module/game-common/src/main/java/com/zanxiang/common/enums/Pay/AlipayPayConfigEnum.java

@@ -1,51 +0,0 @@
-package com.zanxiang.common.enums.Pay;
-
-import lombok.Getter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author xufeng
- * @date 2022/6/9 15:29
- */
-@Getter
-public enum AlipayPayConfigEnum {
-    APPID("appId", "商户支付appId", false),
-    ALIPAYPUBLICKEY("alipayPublicKey", "支付宝公钥key", false),
-    MERCHANTPRIVATEKEY("merchantPrivateKey", "商户私钥key", false),
-    SIGNTYPE("signType", "加密方式", false),
-    MERCHANTCERTPATH("merchantCertPath", "商户证书", true),
-    ALIPAYCERTPATH("alipayCertPath", "支付宝证书", true),
-    ALIPAYROOTCERTPATH("alipayRootCertPath", "支付宝根证书", true);
-
-    private final String code;
-    private final String msg;
-    private Boolean isFile; //是否为文件
-
-    AlipayPayConfigEnum(String code, String msg, Boolean isFile) {
-        this.code = code;
-        this.msg = msg;
-        this.isFile = isFile;
-    }
-
-    public static List<String> getCodeList() {
-        List<String> arr = new ArrayList<>(20);
-        AlipayPayConfigEnum[] data = AlipayPayConfigEnum.values();
-        if (data.length == 0) {
-            return arr;
-        }
-        for (int i = 0; i < data.length; i++) {
-            arr.add(data[i].getCode());
-        }
-        return arr;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public String getMsg() {
-        return msg;
-    }
-}

+ 0 - 46
game-module/game-common/src/main/java/com/zanxiang/common/enums/Pay/WxPayConfigEnum.java

@@ -1,46 +0,0 @@
-package com.zanxiang.common.enums.Pay;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author xufeng
- * @date 2022/6/9 15:29
- */
-public enum WxPayConfigEnum {
-    APPID("appId", "商户支付appId"),
-    APPSECRET("appSecret", "公众帐号secert"),
-    MCHID("mchId", "商户号"),
-    APIKEY("apiKey", "商户支付密钥"),
-    SIGNTYPE("signType", "加密方式"),
-    CERTPATH("certPath", "密钥地址"),
-    NOTIFYURL("notifyUrl", "回调地址(默认为空即可)");
-
-    private final String code;
-    private final String msg;
-
-    WxPayConfigEnum(String code, String msg) {
-        this.code = code;
-        this.msg = msg;
-    }
-
-    public static List<String> getCodeList() {
-        List<String> arr = new ArrayList<>(20);
-        WxPayConfigEnum[] data = WxPayConfigEnum.values();
-        if (data.length == 0) {
-            return arr;
-        }
-        for (int i = 0; i < data.length; i++) {
-            arr.add(data[i].getCode());
-        }
-        return arr;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public String getMsg() {
-        return msg;
-    }
-}

+ 0 - 49
game-module/game-common/src/main/java/com/zanxiang/common/enums/PayApplicationTypeEnum.java

@@ -1,49 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2022-11-25
- * @description : 应用类型枚举
- */
-@Getter
-@AllArgsConstructor
-public enum PayApplicationTypeEnum {
-
-    /**
-     * 微信小程序
-     */
-    WX_MINI_APP(1, "微信小程序"),
-
-    /**
-     * 微信公众号
-     */
-    WX_MP(2, "微信公众号"),
-
-    /**
-     * 支付宝应用
-     */
-    ALI_PAY_APP(3, "支付宝应用");
-
-    /**
-     * 应用类型
-     */
-    private Integer type;
-
-    /**
-     * 描述
-     */
-    private String describe;
-
-    public static String getDescByType(Integer type) {
-        PayApplicationTypeEnum[] values = PayApplicationTypeEnum.values();
-        for (PayApplicationTypeEnum value : values) {
-            if (value.getType().equals(type)) {
-                return value.getDescribe();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 85
game-module/game-common/src/main/java/com/zanxiang/common/enums/PayDeviceEnum.java

@@ -1,85 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * 支付设备类型
- *
- * @author xufeng
- * @date 2022/6/16 18:07
- */
-@Getter
-@AllArgsConstructor
-public enum PayDeviceEnum {
-
-    /**
-     * Pc端支付
-     */
-    PC_PAY(1L, "PC", "PC二维码支付"),
-
-    /**
-     * h5支付
-     */
-    H5_PAY(2L, "H5", "H5支付"),
-
-    /**
-     * App支付
-     */
-    APP_PAY(3L, "APP", "APP支付"),
-
-    /**
-     * 小程序支付
-     */
-    APPLET_PAY(4L, "APPLET", "盒子支付"),
-
-    /**
-     * 米大师支付
-     */
-    MI_PAY(5L, "MI_PAY", "米大师支付"),
-
-    /**
-     * 客服支付
-     */
-    CUSTOM_PAY(6L, "CUSTOM_PAY", "客服支付");
-
-    /**
-     * 支付方式id
-     */
-    private Long payDeviceId;
-
-    /**
-     * 支付方式key
-     */
-    private String payDeviceKey;
-
-    /**
-     * 支付方式名称
-     */
-    private String payDeviceName;
-
-    public static String getDescByNum(Integer code) {
-        PayDeviceEnum[] values = PayDeviceEnum.values();
-        for (int i = 0; i < values.length; i++) {
-            if (values[i].getPayDeviceId().equals(code)) {
-                return values[i].getPayDeviceName();
-            }
-        }
-        return "";
-    }
-
-    public static String getDesc(String obj) {
-        List<String> Desc = new ArrayList<>(10);
-        String str = obj.substring(1, obj.length() - 1);
-        String[] strArr = str.split(",");
-        for (int i = 0; i < strArr.length; i++) {
-            String name = PayDeviceEnum.getDescByNum(Integer.valueOf(strArr[i]));
-            Desc.add(name);
-        }
-        return Desc.stream().collect(Collectors.joining(","));
-    }
-}

+ 0 - 66
game-module/game-common/src/main/java/com/zanxiang/common/enums/PayWayEnum.java

@@ -1,66 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Objects;
-
-/**
- * 支付渠道枚举
- *
- * @author xufeng
- * @date 2022/6/9 10:41
- */
-@Getter
-@AllArgsConstructor
-public enum PayWayEnum {
-
-    /**
-     * 支付宝
-     */
-    ALI_PAY(1, "ALI_PAY", "支付宝"),
-
-    /**
-     * 微信
-     */
-    WX_PAY(2, "WX_PAY", "微信"),
-
-    /**
-     * 米大师
-     */
-    MI_PAY(3, "MI_PAY", "米大师");
-
-    /**
-     * 支付渠道id
-     */
-    private Integer payWayId;
-
-    /**
-     * 支付渠道key
-     */
-    private String payWayKey;
-
-    /**
-     * 支付渠道名称
-     */
-    private String payWayName;
-
-    /**
-     * 根据书城key获取名称
-     *
-     * @param payType : 支付类型
-     * @return : 支付类型枚举
-     */
-    public static String getByPayType(Long payType) {
-        if (payType == null) {
-            return null;
-        }
-        for (PayWayEnum payWayEnum : PayWayEnum.values()) {
-            if (Objects.equals(payType.intValue(), payWayEnum.getPayWayId())) {
-                return payWayEnum.getPayWayName();
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 57
game-module/game-common/src/main/java/com/zanxiang/common/enums/PromoAccountTypeEnum.java

@@ -1,57 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2022-11-21
- * @description : 推广账号类型
- */
-@Getter
-@AllArgsConstructor
-public enum PromoAccountTypeEnum {
-
-    /**
-     * 微信公众号
-     */
-    ACCOUNT_WX_MP(1, "微信公众号"),
-
-    /**
-     * 今日头条账号
-     */
-    ACCOUNT_BYTE(2, "今日头条账号"),
-
-    /**
-     * ADQ(QQ)账号
-     */
-    ACCOUNT_ADQ_QQ(3, "ADQ(QQ)账号");
-
-    /**
-     * 账号类型
-     */
-    private Integer type;
-
-    /**
-     * 账号类型名称
-     */
-    private String name;
-
-    /**
-     * 被类型名称
-     *
-     * @param type 类型
-     * @return {@link String}
-     */
-    public static String getNameByType(Integer type) {
-        PromoAccountTypeEnum[] values = PromoAccountTypeEnum.values();
-        for (PromoAccountTypeEnum promoAccountTypeEnum : values) {
-            if (Objects.equals(promoAccountTypeEnum.getType(), type)) {
-                return promoAccountTypeEnum.getName();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 62
game-module/game-common/src/main/java/com/zanxiang/common/enums/PromoMediaTypeEnum.java

@@ -1,62 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2022-11-17
- * @description : 推广媒体类型
- */
-@Getter
-@AllArgsConstructor
-public enum PromoMediaTypeEnum {
-
-    /**
-     * 社交类
-     */
-    MEDIA_SOCIAL_CONTACT(1, "社交类"),
-
-    /**
-     * 短视频
-     */
-    MEDIA_SHORT_VIDEO(2, "短视频"),
-
-    /**
-     * 资讯
-     */
-    MEDIA_NEWS_INFO(3, "资讯"),
-
-    /**
-     * 视频
-     */
-    MEDIA_VIDEO(4, "视频");
-
-    /**
-     * 媒体类型
-     */
-    private Integer type;
-
-    /**
-     * 媒体名称
-     */
-    private String name;
-
-    /**
-     * 被类型名称
-     *
-     * @param type 类型
-     * @return {@link String}
-     */
-    public static String getNameByType(Integer type) {
-        PromoMediaTypeEnum[] values = PromoMediaTypeEnum.values();
-        for (PromoMediaTypeEnum promoMediaTypeEnum : values) {
-            if (Objects.equals(promoMediaTypeEnum.getType(), type)) {
-                return promoMediaTypeEnum.getName();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 57
game-module/game-common/src/main/java/com/zanxiang/common/enums/PromoProviderEnum.java

@@ -1,57 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2022-10-26
- * @description : 推广服务商
- */
-@Getter
-@AllArgsConstructor
-public enum PromoProviderEnum {
-
-    /**
-     * 巨网
-     */
-    JU_GU(1, "巨网"),
-
-    /**
-     * 广联
-     */
-    GUANG_LIAN(2, "广联"),
-
-    /**
-     * 太古
-     */
-    TAI_GU(3, "太古");
-
-    /**
-     * 推广服务商id
-     */
-    private Integer providerId;
-
-    /**
-     * 推广媒体
-     */
-    private String providerName;
-
-    /**
-     * 被类型名称
-     *
-     * @param type 类型
-     * @return {@link String}
-     */
-    public static String getNameByType(Integer type) {
-        PromoProviderEnum[] values = PromoProviderEnum.values();
-        for (PromoProviderEnum promoProviderEnum : values) {
-            if (Objects.equals(promoProviderEnum.getProviderId(), type)) {
-                return promoProviderEnum.getProviderName();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 61
game-module/game-common/src/main/java/com/zanxiang/common/enums/SmsTypeEnum.java

@@ -1,61 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-07
- * @description : 手机验证码类型枚举
- */
-@Getter
-@AllArgsConstructor
-public enum SmsTypeEnum {
-
-    /**
-     * 注册登录
-     */
-    SMS_REG(1, "注册登录"),
-
-    /**
-     * 修改密码
-     */
-    SMS_MODIFY(2, "修改密码"),
-
-    /**
-     * 绑定手机
-     */
-    SMS_BIND(3, "绑定手机"),
-
-    /**
-     * 找回密码
-     */
-    SMS_FIND_PWD(4, "找回密码");
-
-    /**
-     * 类型
-     */
-    private Integer type;
-
-    /**
-     * 描述
-     */
-    private String describe;
-
-    /**
-     * 根据type获取枚举
-     *
-     * @return : 返回枚举对象
-     */
-    public static SmsTypeEnum getByType(Integer type) {
-        if (type == null) {
-            return null;
-        }
-        return Arrays.stream(SmsTypeEnum.values())
-                .filter(e -> Objects.equals(e.getType(), type))
-                .findFirst().orElse(null);
-    }
-}

+ 0 - 33
game-module/game-common/src/main/java/com/zanxiang/common/enums/StatusEnum.java

@@ -1,33 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author xufeng
- * @date 2022/6/13 11:39
- */
-@Getter
-@AllArgsConstructor
-public enum StatusEnum {
-
-    /**
-     * 正常
-     */
-    YES(0, "正常"),
-
-    /**
-     * 禁止
-     */
-    NO(1, "禁止");
-
-    /**
-     * 状态
-     */
-    private int code;
-
-    /**
-     * 描述
-     */
-    private String name;
-}

+ 0 - 84
game-module/game-common/src/main/java/com/zanxiang/common/enums/VipLevelEnum.java

@@ -1,84 +0,0 @@
-package com.zanxiang.common.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-30
- * @description : vip等级枚举
- */
-@Getter
-@AllArgsConstructor
-public enum VipLevelEnum {
-
-    /**
-     * vip_0
-     */
-    VIP_LEVEL_ZERO(0, "0"),
-
-    /**
-     * vip_1
-     */
-    VIP_LEVEL_ONE(1, "1"),
-
-    /**
-     * vip_2
-     */
-    VIP_LEVEL_TWO(2, "2"),
-
-    /**
-     * vip_3
-     */
-    VIP_LEVEL_THREE(3, "3"),
-
-    /**
-     * vip_4
-     */
-    VIP_LEVEL_FOUR(4, "4"),
-
-    /**
-     * vip_5
-     */
-    VIP_LEVEL_FIVE(5, "5"),
-
-    /**
-     * vip_6
-     */
-    VIP_LEVEL_SIX(6, "6"),
-
-    /**
-     * vip_7
-     */
-    VIP_LEVEL_SEVEN(7, "7"),
-
-    /**
-     * vip_8
-     */
-    VIP_LEVEL_EIGHT(8, "8"),
-
-    /**
-     * vip_9
-     */
-    VIP_LEVEL_NINE(9, "9"),
-
-    /**
-     * vip_10
-     */
-    VIP_LEVEL_TEN(10, "10"),
-
-    /**
-     * vip_10以上
-     */
-    VIP_LEVEL_GT_TEN(1010, "10以上");
-
-    /**
-     * vip等级
-     */
-    private Integer vipLevel;
-
-    /**
-     * vip等级名称
-     */
-    private String vipLevelName;
-}

+ 0 - 59
game-module/game-common/src/main/java/com/zanxiang/common/exception/BaseException.java

@@ -1,59 +0,0 @@
-package com.zanxiang.common.exception;
-
-/**
- * 基础异常
- */
-public class BaseException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 所属模块
-     */
-    private String module;
-
-    /**
-     * 错误码
-     */
-    private String code;
-
-    /**
-     * 错误码对应的参数
-     */
-    private Object[] args;
-
-    public BaseException(String module, String code, Object[] args, String message) {
-        super(message);
-        this.module = module;
-        this.code = code;
-        this.args = args;
-    }
-
-    public BaseException(String module, String code, Object[] args) {
-        this(module, code, args, null);
-    }
-
-    public BaseException(String module, String message) {
-        this(module, null, null, message);
-    }
-
-    public BaseException(String code, Object[] args) {
-        this(null, code, args, null);
-    }
-
-    public BaseException(String message) {
-        this(null, null, null, message);
-    }
-
-    public String getModule() {
-        return module;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public Object[] getArgs() {
-        return args;
-    }
-}
-

+ 0 - 42
game-module/game-common/src/main/java/com/zanxiang/common/exception/CustomException.java

@@ -1,42 +0,0 @@
-package com.zanxiang.common.exception;
-
-import com.zanxiang.common.enums.HttpStatusEnum;
-
-/**
- * 自定义异常
- */
-public class CustomException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
-
-    private Integer code;
-
-    private String message;
-
-    public CustomException(String message) {
-        this.message = message;
-    }
-
-    public CustomException(String message, Integer code) {
-        this.message = message;
-        this.code = code;
-    }
-
-    public CustomException(HttpStatusEnum httpStatusEnum) {
-        this.message = httpStatusEnum.getMsg();
-        this.code = httpStatusEnum.getCode();
-    }
-
-    public CustomException(String message, Throwable e) {
-        super(message, e);
-        this.message = message;
-    }
-
-    @Override
-    public String getMessage() {
-        return message;
-    }
-
-    public Integer getCode() {
-        return code;
-    }
-}

+ 0 - 19
game-module/game-common/src/main/java/com/zanxiang/common/exception/ParamNullException.java

@@ -1,19 +0,0 @@
-package com.zanxiang.common.exception;
-
-/**
- * 参数为空异常
- *
- * @author xufeng
- * @date 2022/6/22 17:31
- */
-public class ParamNullException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
-
-    private Integer code;
-
-    private String message;
-
-    public ParamNullException(String message) {
-        this.message = message;
-    }
-}

+ 0 - 13
game-module/game-common/src/main/java/com/zanxiang/common/exception/PreAuthorizeException.java

@@ -1,13 +0,0 @@
-package com.zanxiang.common.exception;
-
-/**
- * 权限异常
- *
- * @author ruoyi
- */
-public class PreAuthorizeException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
-
-    public PreAuthorizeException() {
-    }
-}

+ 0 - 22
game-module/game-common/src/main/java/com/zanxiang/common/exception/UtilException.java

@@ -1,22 +0,0 @@
-package com.zanxiang.common.exception;
-
-/**
- * 工具类异常
- *
- * @author ruoyi
- */
-public class UtilException extends RuntimeException {
-    private static final long serialVersionUID = 8247610319171014183L;
-
-    public UtilException(Throwable e) {
-        super(e.getMessage(), e);
-    }
-
-    public UtilException(String message) {
-        super(message);
-    }
-
-    public UtilException(String message, Throwable throwable) {
-        super(message, throwable);
-    }
-}

+ 0 - 101
game-module/game-common/src/main/java/com/zanxiang/common/handler/GlobalExceptionHandler.java

@@ -1,101 +0,0 @@
-package com.zanxiang.common.handler;
-
-import com.zanxiang.common.domain.ResultVO;
-import com.zanxiang.common.enums.HttpStatusEnum;
-import com.zanxiang.common.exception.BaseException;
-import com.zanxiang.common.exception.CustomException;
-import com.zanxiang.common.exception.ParamNullException;
-import com.zanxiang.common.exception.PreAuthorizeException;
-import com.zanxiang.common.utils.StringUtils;
-import com.zanxiang.common.utils.http.AjaxResult;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.validation.BindException;
-import org.springframework.web.bind.MethodArgumentNotValidException;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.RestControllerAdvice;
-import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
-
-/**
- * 全局异常处理器
- */
-@RestControllerAdvice
-public class GlobalExceptionHandler {
-    private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
-
-    /**
-     * 基础异常
-     */
-    @ExceptionHandler(BaseException.class)
-    public ResultVO<?> baseException(BaseException e) {
-        return ResultVO.fail(e.getMessage());
-    }
-
-    /**
-     * 业务异常
-     */
-    @ExceptionHandler(CustomException.class)
-    public ResultVO<?> businessException(CustomException e) {
-        if (StringUtils.isNull(e.getCode())) {
-            return ResultVO.fail(e.getMessage());
-        }
-        return new ResultVO<>(e.getCode(), e.getMessage());
-    }
-
-    /**
-     * 参数异常
-     */
-    @ExceptionHandler(ParamNullException.class)
-    public ResultVO<?> paramNullException(CustomException e) {
-        if (StringUtils.isNull(e.getCode())) {
-            return new ResultVO<>(HttpStatusEnum.PARAM_IS_NULL.getCode(), HttpStatusEnum.PARAM_IS_NULL.getMsg() + e.getMessage());
-        }
-        return new ResultVO<>(e.getCode(), e.getMessage());
-    }
-
-    @ExceptionHandler(Exception.class)
-    public ResultVO<?> handleException(Exception e) {
-        log.error(e.getMessage(), e);
-        return ResultVO.fail("操作异常");
-    }
-
-    /**
-     * 自定义验证异常
-     */
-    @ExceptionHandler(BindException.class)
-    public ResultVO<?> validatedBindException(BindException e) {
-        log.error(e.getMessage(), e);
-        String message = e.getAllErrors().get(0).getDefaultMessage();
-        return ResultVO.fail(message);
-    }
-
-    /**
-     * 参数类型不匹配导致转换异常
-     *
-     * @param e
-     * @return
-     */
-    @ExceptionHandler(MethodArgumentTypeMismatchException.class)
-    public ResultVO<?> mismatchErrorHandler(MethodArgumentTypeMismatchException e) {
-        log.error("方法:{},字段:{},参数:{},错误信息:{}", e.getParameter().getMethod(), e.getName(), e.getValue(), e.getMessage());
-        return ResultVO.fail("参数异常,请勿非法操作");
-    }
-
-    /**
-     * 自定义验证异常
-     */
-    @ExceptionHandler(MethodArgumentNotValidException.class)
-    public Object validExceptionHandler(MethodArgumentNotValidException e) {
-        log.error(e.getMessage(), e);
-        String message = e.getBindingResult().getFieldError().getDefaultMessage();
-        return AjaxResult.error(message);
-    }
-
-    /**
-     * 权限异常
-     */
-    @ExceptionHandler(PreAuthorizeException.class)
-    public ResultVO<?> preAuthorizeException(PreAuthorizeException e) {
-        return ResultVO.fail("没有权限,请联系管理员授权");
-    }
-}

+ 0 - 91
game-module/game-common/src/main/java/com/zanxiang/common/text/CharsetKit.java

@@ -1,91 +0,0 @@
-package com.zanxiang.common.text;
-
-import org.springframework.util.StringUtils;
-
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-
-/**
- * 字符集工具类
- *
- * @author ruoyi
- */
-public class CharsetKit {
-    /**
-     * ISO-8859-1
-     */
-    public static final String ISO_8859_1 = "ISO-8859-1";
-    /**
-     * UTF-8
-     */
-    public static final String UTF_8 = "UTF-8";
-    /**
-     * GBK
-     */
-    public static final String GBK = "GBK";
-
-    /**
-     * ISO-8859-1
-     */
-    public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
-    /**
-     * UTF-8
-     */
-    public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
-    /**
-     * GBK
-     */
-    public static final Charset CHARSET_GBK = Charset.forName(GBK);
-
-    /**
-     * 转换为Charset对象
-     *
-     * @param charset 字符集,为空则返回默认字符集
-     * @return Charset
-     */
-    public static Charset charset(String charset) {
-        return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
-    }
-
-    /**
-     * 转换字符串的字符集编码
-     *
-     * @param source      字符串
-     * @param srcCharset  源字符集,默认ISO-8859-1
-     * @param destCharset 目标字符集,默认UTF-8
-     * @return 转换后的字符集
-     */
-    public static String convert(String source, String srcCharset, String destCharset) {
-        return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
-    }
-
-    /**
-     * 转换字符串的字符集编码
-     *
-     * @param source      字符串
-     * @param srcCharset  源字符集,默认ISO-8859-1
-     * @param destCharset 目标字符集,默认UTF-8
-     * @return 转换后的字符集
-     */
-    public static String convert(String source, Charset srcCharset, Charset destCharset) {
-        if (null == srcCharset) {
-            srcCharset = StandardCharsets.ISO_8859_1;
-        }
-
-        if (null == destCharset) {
-            srcCharset = StandardCharsets.UTF_8;
-        }
-
-        if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) {
-            return source;
-        }
-        return new String(source.getBytes(srcCharset), destCharset);
-    }
-
-    /**
-     * @return 系统字符集编码
-     */
-    public static String systemCharset() {
-        return Charset.defaultCharset().name();
-    }
-}

+ 0 - 870
game-module/game-common/src/main/java/com/zanxiang/common/text/Convert.java

@@ -1,870 +0,0 @@
-package com.zanxiang.common.text;
-
-
-import com.zanxiang.common.utils.StringUtils;
-import com.zanxiang.module.util.JsonUtil;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.text.NumberFormat;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * 类型转换器
- *
- * @author ruoyi
- */
-public class Convert {
-    /**
-     * 转换为字符串<br>
-     * 如果给定的值为null,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static String toStr(Object value, String defaultValue) {
-        if (null == value) {
-            return defaultValue;
-        }
-        if (value instanceof String) {
-            return (String) value;
-        }
-        return value.toString();
-    }
-
-    /**
-     * 转换为字符串<br>
-     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static String toStr(Object value) {
-        return toStr(value, null);
-    }
-
-    /**
-     * 转换为字符<br>
-     * 如果给定的值为null,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Character toChar(Object value, Character defaultValue) {
-        if (null == value) {
-            return defaultValue;
-        }
-        if (value instanceof Character) {
-            return (Character) value;
-        }
-
-        final String valueStr = toStr(value, null);
-        return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0);
-    }
-
-    /**
-     * 转换为字符<br>
-     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Character toChar(Object value) {
-        return toChar(value, null);
-    }
-
-    /**
-     * 转换为byte<br>
-     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Byte toByte(Object value, Byte defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof Byte) {
-            return (Byte) value;
-        }
-        if (value instanceof Number) {
-            return ((Number) value).byteValue();
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            return Byte.parseByte(valueStr);
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为byte<br>
-     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Byte toByte(Object value) {
-        return toByte(value, null);
-    }
-
-    /**
-     * 转换为Short<br>
-     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Short toShort(Object value, Short defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof Short) {
-            return (Short) value;
-        }
-        if (value instanceof Number) {
-            return ((Number) value).shortValue();
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            return Short.parseShort(valueStr.trim());
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为Short<br>
-     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Short toShort(Object value) {
-        return toShort(value, null);
-    }
-
-    /**
-     * 转换为Number<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Number toNumber(Object value, Number defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof Number) {
-            return (Number) value;
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            return NumberFormat.getInstance().parse(valueStr);
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为Number<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Number toNumber(Object value) {
-        return toNumber(value, null);
-    }
-
-    /**
-     * 转换为int<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Integer toInt(Object value, Integer defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof Integer) {
-            return (Integer) value;
-        }
-        if (value instanceof Number) {
-            return ((Number) value).intValue();
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            return Integer.parseInt(valueStr.trim());
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为int<br>
-     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Integer toInt(Object value) {
-        return toInt(value, null);
-    }
-
-    /**
-     * 转换为Integer数组<br>
-     *
-     * @param str 被转换的值
-     * @return 结果
-     */
-    public static Integer[] toIntArray(String str) {
-        return toIntArray(",", str);
-    }
-
-    /**
-     * 转换为Long数组<br>
-     *
-     * @param str 被转换的值
-     * @return 结果
-     */
-    public static Long[] toLongArray(String str) {
-        return toLongArray(",", str);
-    }
-
-    /**
-     * 转换为Integer数组<br>
-     *
-     * @param split 分隔符
-     * @param split 被转换的值
-     * @return 结果
-     */
-    public static Integer[] toIntArray(String split, String str) {
-        if (StringUtils.isEmpty(str)) {
-            return new Integer[]{};
-        }
-        String[] arr = str.split(split);
-        final Integer[] ints = new Integer[arr.length];
-        for (int i = 0; i < arr.length; i++) {
-            final Integer v = toInt(arr[i], 0);
-            ints[i] = v;
-        }
-        return ints;
-    }
-
-    /**
-     * 转换为Long数组<br>
-     *
-     * @param split 分隔符
-     * @param str   被转换的值
-     * @return 结果
-     */
-    public static Long[] toLongArray(String split, String str) {
-        if (StringUtils.isEmpty(str)) {
-            return new Long[]{};
-        }
-        String[] arr = str.split(split);
-        final Long[] longs = new Long[arr.length];
-        for (int i = 0; i < arr.length; i++) {
-            final Long v = toLong(arr[i], null);
-            longs[i] = v;
-        }
-        return longs;
-    }
-
-    /**
-     * 转换为String数组<br>
-     *
-     * @param str 被转换的值
-     * @return 结果
-     */
-    public static String[] toStrArray(String str) {
-        return toStrArray(",", str);
-    }
-
-    /**
-     * 转换为String数组<br>
-     *
-     * @param split 分隔符
-     * @param split 被转换的值
-     * @return 结果
-     */
-    public static String[] toStrArray(String split, String str) {
-        return str.split(split);
-    }
-
-    /**
-     * 转换为long<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Long toLong(Object value, Long defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof Long) {
-            return (Long) value;
-        }
-        if (value instanceof Number) {
-            return ((Number) value).longValue();
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            // 支持科学计数法
-            return new BigDecimal(valueStr.trim()).longValue();
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为long<br>
-     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Long toLong(Object value) {
-        return toLong(value, null);
-    }
-
-    /**
-     * 转换为double<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Double toDouble(Object value, Double defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof Double) {
-            return (Double) value;
-        }
-        if (value instanceof Number) {
-            return ((Number) value).doubleValue();
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            // 支持科学计数法
-            return new BigDecimal(valueStr.trim()).doubleValue();
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为double<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Double toDouble(Object value) {
-        return toDouble(value, null);
-    }
-
-    /**
-     * 转换为Float<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Float toFloat(Object value, Float defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof Float) {
-            return (Float) value;
-        }
-        if (value instanceof Number) {
-            return ((Number) value).floatValue();
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            return Float.parseFloat(valueStr.trim());
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为Float<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Float toFloat(Object value) {
-        return toFloat(value, null);
-    }
-
-    /**
-     * 转换为boolean<br>
-     * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static Boolean toBool(Object value, Boolean defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof Boolean) {
-            return (Boolean) value;
-        }
-        String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        valueStr = valueStr.trim().toLowerCase();
-        switch (valueStr) {
-            case "true":
-                return true;
-            case "false":
-                return false;
-            case "yes":
-                return true;
-            case "ok":
-                return true;
-            case "no":
-                return false;
-            case "1":
-                return true;
-            case "0":
-                return false;
-            default:
-                return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为boolean<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static Boolean toBool(Object value) {
-        return toBool(value, null);
-    }
-
-    /**
-     * 转换为Enum对象<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     *
-     * @param clazz        Enum的Class
-     * @param value        值
-     * @param defaultValue 默认值
-     * @return Enum
-     */
-    public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value, E defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (clazz.isAssignableFrom(value.getClass())) {
-            @SuppressWarnings("unchecked")
-            E myE = (E) value;
-            return myE;
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            return Enum.valueOf(clazz, valueStr);
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为Enum对象<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
-     *
-     * @param clazz Enum的Class
-     * @param value 值
-     * @return Enum
-     */
-    public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value) {
-        return toEnum(clazz, value, null);
-    }
-
-    /**
-     * 转换为BigInteger<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static BigInteger toBigInteger(Object value, BigInteger defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof BigInteger) {
-            return (BigInteger) value;
-        }
-        if (value instanceof Long) {
-            return BigInteger.valueOf((Long) value);
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            return new BigInteger(valueStr);
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为BigInteger<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static BigInteger toBigInteger(Object value) {
-        return toBigInteger(value, null);
-    }
-
-    /**
-     * 转换为BigDecimal<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value        被转换的值
-     * @param defaultValue 转换错误时的默认值
-     * @return 结果
-     */
-    public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) {
-        if (value == null) {
-            return defaultValue;
-        }
-        if (value instanceof BigDecimal) {
-            return (BigDecimal) value;
-        }
-        if (value instanceof Long) {
-            return new BigDecimal((Long) value);
-        }
-        if (value instanceof Double) {
-            return new BigDecimal((Double) value);
-        }
-        if (value instanceof Integer) {
-            return new BigDecimal((Integer) value);
-        }
-        final String valueStr = toStr(value, null);
-        if (StringUtils.isEmpty(valueStr)) {
-            return defaultValue;
-        }
-        try {
-            return new BigDecimal(valueStr);
-        } catch (Exception e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * 转换为BigDecimal<br>
-     * 如果给定的值为空,或者转换失败,返回默认值<br>
-     * 转换失败不会报错
-     *
-     * @param value 被转换的值
-     * @return 结果
-     */
-    public static BigDecimal toBigDecimal(Object value) {
-        return toBigDecimal(value, null);
-    }
-
-    /**
-     * 将对象转为字符串<br>
-     * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
-     *
-     * @param obj 对象
-     * @return 字符串
-     */
-    public static String utf8Str(Object obj) {
-        return str(obj, CharsetKit.CHARSET_UTF_8);
-    }
-
-    /**
-     * 将对象转为字符串<br>
-     * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
-     *
-     * @param obj         对象
-     * @param charsetName 字符集
-     * @return 字符串
-     */
-    public static String str(Object obj, String charsetName) {
-        return str(obj, Charset.forName(charsetName));
-    }
-
-    /**
-     * 将对象转为字符串<br>
-     * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
-     *
-     * @param obj     对象
-     * @param charset 字符集
-     * @return 字符串
-     */
-    public static String str(Object obj, Charset charset) {
-        if (null == obj) {
-            return null;
-        }
-
-        if (obj instanceof String) {
-            return (String) obj;
-        } else if (obj instanceof byte[] || obj instanceof Byte[]) {
-            return str((Byte[]) obj, charset);
-        } else if (obj instanceof ByteBuffer) {
-            return str((ByteBuffer) obj, charset);
-        }
-        return obj.toString();
-    }
-
-    /**
-     * 将byte数组转为字符串
-     *
-     * @param bytes   byte数组
-     * @param charset 字符集
-     * @return 字符串
-     */
-    public static String str(byte[] bytes, String charset) {
-        return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset));
-    }
-
-    /**
-     * 解码字节码
-     *
-     * @param data    字符串
-     * @param charset 字符集,如果此字段为空,则解码的结果取决于平台
-     * @return 解码后的字符串
-     */
-    public static String str(byte[] data, Charset charset) {
-        if (data == null) {
-            return null;
-        }
-
-        if (null == charset) {
-            return new String(data);
-        }
-        return new String(data, charset);
-    }
-
-    /**
-     * 将编码的byteBuffer数据转换为字符串
-     *
-     * @param data    数据
-     * @param charset 字符集,如果为空使用当前系统字符集
-     * @return 字符串
-     */
-    public static String str(ByteBuffer data, String charset) {
-        if (data == null) {
-            return null;
-        }
-
-        return str(data, Charset.forName(charset));
-    }
-
-    /**
-     * 将编码的byteBuffer数据转换为字符串
-     *
-     * @param data    数据
-     * @param charset 字符集,如果为空使用当前系统字符集
-     * @return 字符串
-     */
-    public static String str(ByteBuffer data, Charset charset) {
-        if (null == charset) {
-            charset = Charset.defaultCharset();
-        }
-        return charset.decode(data).toString();
-    }
-
-    /**
-     * 半角转全角
-     *
-     * @param input String.
-     * @return 全角字符串.
-     */
-    public static String toSBC(String input) {
-        return toSBC(input, null);
-    }
-
-    /**
-     * 半角转全角
-     *
-     * @param input         String
-     * @param notConvertSet 不替换的字符集合
-     * @return 全角字符串.
-     */
-    public static String toSBC(String input, Set<Character> notConvertSet) {
-        char c[] = input.toCharArray();
-        for (int i = 0; i < c.length; i++) {
-            if (null != notConvertSet && notConvertSet.contains(c[i])) {
-                // 跳过不替换的字符
-                continue;
-            }
-
-            if (c[i] == ' ') {
-                c[i] = '\u3000';
-            } else if (c[i] < '\177') {
-                c[i] = (char) (c[i] + 65248);
-
-            }
-        }
-        return new String(c);
-    }
-
-    /**
-     * 全角转半角
-     *
-     * @param input String.
-     * @return 半角字符串
-     */
-    public static String toDBC(String input) {
-        return toDBC(input, null);
-    }
-
-    /**
-     * 替换全角为半角
-     *
-     * @param text          文本
-     * @param notConvertSet 不替换的字符集合
-     * @return 替换后的字符
-     */
-    public static String toDBC(String text, Set<Character> notConvertSet) {
-        char c[] = text.toCharArray();
-        for (int i = 0; i < c.length; i++) {
-            if (null != notConvertSet && notConvertSet.contains(c[i])) {
-                // 跳过不替换的字符
-                continue;
-            }
-
-            if (c[i] == '\u3000') {
-                c[i] = ' ';
-            } else if (c[i] > '\uFF00' && c[i] < '\uFF5F') {
-                c[i] = (char) (c[i] - 65248);
-            }
-        }
-        String returnString = new String(c);
-
-        return returnString;
-    }
-
-    /**
-     * 数字金额大写转换 先写个完整的然后将如零拾替换成零
-     *
-     * @param n 数字
-     * @return 中文大写数字
-     */
-    public static String digitUppercase(double n) {
-        String[] fraction = {"角", "分"};
-        String[] digit = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
-        String[][] unit = {{"元", "万", "亿"}, {"", "拾", "佰", "仟"}};
-
-        String head = n < 0 ? "负" : "";
-        n = Math.abs(n);
-
-        String s = "";
-        for (int i = 0; i < fraction.length; i++) {
-            s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", "");
-        }
-        if (s.length() < 1) {
-            s = "整";
-        }
-        int integerPart = (int) Math.floor(n);
-
-        for (int i = 0; i < unit[0].length && integerPart > 0; i++) {
-            String p = "";
-            for (int j = 0; j < unit[1].length && n > 0; j++) {
-                p = digit[integerPart % 10] + unit[1][j] + p;
-                integerPart = integerPart / 10;
-            }
-            s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s;
-        }
-        return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整");
-    }
-
-    /**
-     * unicode编码转换中文
-     *
-     * @param object: 需要转码的字符串
-     * @return : 转码之后的结果
-     */
-    public static String unicodeToString(Object object) {
-        String str = JsonUtil.toString(object);
-        Pattern pattern = Pattern.compile("(\\\\u(\\p{XDigit}{4}))");
-        Matcher matcher = pattern.matcher(str);
-        char ch;
-        while (matcher.find()) {
-            ch = (char) Integer.parseInt(matcher.group(2), 16);
-            str = str.replace(matcher.group(1), ch + "");
-        }
-        return str;
-    }
-}

+ 0 - 77
game-module/game-common/src/main/java/com/zanxiang/common/text/StrFormatter.java

@@ -1,77 +0,0 @@
-package com.zanxiang.common.text;
-
-
-import com.zanxiang.common.utils.StringUtils;
-
-/**
- * 字符串格式化
- *
- * @author ruoyi
- */
-public class StrFormatter {
-    public static final String EMPTY_JSON = "{}";
-    public static final char C_BACKSLASH = '\\';
-    public static final char C_DELIM_START = '{';
-    public static final char C_DELIM_END = '}';
-
-    /**
-     * 格式化字符串<br>
-     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
-     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
-     * 例:<br>
-     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
-     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
-     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
-     *
-     * @param strPattern 字符串模板
-     * @param argArray   参数列表
-     * @return 结果
-     */
-    public static String format(final String strPattern, final Object... argArray) {
-        if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) {
-            return strPattern;
-        }
-        final int strPatternLength = strPattern.length();
-
-        // 初始化定义好的长度以获得更好的性能
-        StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
-
-        int handledPosition = 0;
-        int delimIndex;// 占位符所在位置
-        for (int argIndex = 0; argIndex < argArray.length; argIndex++) {
-            delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
-            if (delimIndex == -1) {
-                if (handledPosition == 0) {
-                    return strPattern;
-                } else { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
-                    sbuf.append(strPattern, handledPosition, strPatternLength);
-                    return sbuf.toString();
-                }
-            } else {
-                if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) {
-                    if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) {
-                        // 转义符之前还有一个转义符,占位符依旧有效
-                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
-                        sbuf.append(Convert.utf8Str(argArray[argIndex]));
-                        handledPosition = delimIndex + 2;
-                    } else {
-                        // 占位符被转义
-                        argIndex--;
-                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
-                        sbuf.append(C_DELIM_START);
-                        handledPosition = delimIndex + 1;
-                    }
-                } else {
-                    // 正常占位符
-                    sbuf.append(strPattern, handledPosition, delimIndex);
-                    sbuf.append(Convert.utf8Str(argArray[argIndex]));
-                    handledPosition = delimIndex + 2;
-                }
-            }
-        }
-        // 加入最后一个占位符后所有的字符
-        sbuf.append(strPattern, handledPosition, strPattern.length());
-
-        return sbuf.toString();
-    }
-}

+ 0 - 441
game-module/game-common/src/main/java/com/zanxiang/common/text/UUID.java

@@ -1,441 +0,0 @@
-package com.zanxiang.common.text;
-
-
-import com.zanxiang.common.exception.UtilException;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.util.Random;
-import java.util.concurrent.ThreadLocalRandom;
-
-/**
- * 提供通用唯一识别码(universally unique identifier)(UUID)实现
- *
- * @author ruoyi
- */
-public final class UUID implements java.io.Serializable, Comparable<UUID> {
-    private static final long serialVersionUID = -1185015143654744140L;
-
-    /**
-     * SecureRandom 的单例
-     */
-    private static class Holder {
-        static final SecureRandom numberGenerator = getSecureRandom();
-    }
-
-    /**
-     * 此UUID的最高64有效位
-     */
-    private final long mostSigBits;
-
-    /**
-     * 此UUID的最低64有效位
-     */
-    private final long leastSigBits;
-
-    /**
-     * 私有构造
-     *
-     * @param data 数据
-     */
-    private UUID(byte[] data) {
-        long msb = 0;
-        long lsb = 0;
-        assert data.length == 16 : "data must be 16 bytes in length";
-        for (int i = 0; i < 8; i++) {
-            msb = (msb << 8) | (data[i] & 0xff);
-        }
-        for (int i = 8; i < 16; i++) {
-            lsb = (lsb << 8) | (data[i] & 0xff);
-        }
-        this.mostSigBits = msb;
-        this.leastSigBits = lsb;
-    }
-
-    /**
-     * 使用指定的数据构造新的 UUID。
-     *
-     * @param mostSigBits  用于 {@code UUID} 的最高有效 64 位
-     * @param leastSigBits 用于 {@code UUID} 的最低有效 64 位
-     */
-    public UUID(long mostSigBits, long leastSigBits) {
-        this.mostSigBits = mostSigBits;
-        this.leastSigBits = leastSigBits;
-    }
-
-    /**
-     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。
-     *
-     * @return 随机生成的 {@code UUID}
-     */
-    public static UUID fastUUID() {
-        return randomUUID(false);
-    }
-
-    /**
-     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
-     *
-     * @return 随机生成的 {@code UUID}
-     */
-    public static UUID randomUUID() {
-        return randomUUID(true);
-    }
-
-    /**
-     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
-     *
-     * @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能
-     * @return 随机生成的 {@code UUID}
-     */
-    public static UUID randomUUID(boolean isSecure) {
-        final Random ng = isSecure ? Holder.numberGenerator : getRandom();
-
-        byte[] randomBytes = new byte[16];
-        ng.nextBytes(randomBytes);
-        randomBytes[6] &= 0x0f; /* clear version */
-        randomBytes[6] |= 0x40; /* set to version 4 */
-        randomBytes[8] &= 0x3f; /* clear variant */
-        randomBytes[8] |= 0x80; /* set to IETF variant */
-        return new UUID(randomBytes);
-    }
-
-    /**
-     * 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。
-     *
-     * @param name 用于构造 UUID 的字节数组。
-     * @return 根据指定数组生成的 {@code UUID}
-     */
-    public static UUID nameUUIDFromBytes(byte[] name) {
-        MessageDigest md;
-        try {
-            md = MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException nsae) {
-            throw new InternalError("MD5 not supported");
-        }
-        byte[] md5Bytes = md.digest(name);
-        md5Bytes[6] &= 0x0f; /* clear version */
-        md5Bytes[6] |= 0x30; /* set to version 3 */
-        md5Bytes[8] &= 0x3f; /* clear variant */
-        md5Bytes[8] |= 0x80; /* set to IETF variant */
-        return new UUID(md5Bytes);
-    }
-
-    /**
-     * 根据 {@link #toString()} 方法中描述的字符串标准表示形式创建{@code UUID}。
-     *
-     * @param name 指定 {@code UUID} 字符串
-     * @return 具有指定值的 {@code UUID}
-     * @throws IllegalArgumentException 如果 name 与 {@link #toString} 中描述的字符串表示形式不符抛出此异常
-     */
-    public static UUID fromString(String name) {
-        String[] components = name.split("-");
-        if (components.length != 5) {
-            throw new IllegalArgumentException("Invalid UUID string: " + name);
-        }
-        for (int i = 0; i < 5; i++) {
-            components[i] = "0x" + components[i];
-        }
-
-        long mostSigBits = Long.decode(components[0]).longValue();
-        mostSigBits <<= 16;
-        mostSigBits |= Long.decode(components[1]).longValue();
-        mostSigBits <<= 16;
-        mostSigBits |= Long.decode(components[2]).longValue();
-
-        long leastSigBits = Long.decode(components[3]).longValue();
-        leastSigBits <<= 48;
-        leastSigBits |= Long.decode(components[4]).longValue();
-
-        return new UUID(mostSigBits, leastSigBits);
-    }
-
-    /**
-     * 返回此 UUID 的 128 位值中的最低有效 64 位。
-     *
-     * @return 此 UUID 的 128 位值中的最低有效 64 位。
-     */
-    public long getLeastSignificantBits() {
-        return leastSigBits;
-    }
-
-    /**
-     * 返回此 UUID 的 128 位值中的最高有效 64 位。
-     *
-     * @return 此 UUID 的 128 位值中最高有效 64 位。
-     */
-    public long getMostSignificantBits() {
-        return mostSigBits;
-    }
-
-    /**
-     * 与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。
-     * <p>
-     * 版本号具有以下含意:
-     * <ul>
-     * <li>1 基于时间的 UUID
-     * <li>2 DCE 安全 UUID
-     * <li>3 基于名称的 UUID
-     * <li>4 随机生成的 UUID
-     * </ul>
-     *
-     * @return 此 {@code UUID} 的版本号
-     */
-    public int version() {
-        // Version is bits masked by 0x000000000000F000 in MS long
-        return (int) ((mostSigBits >> 12) & 0x0f);
-    }
-
-    /**
-     * 与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。
-     * <p>
-     * 变体号具有以下含意:
-     * <ul>
-     * <li>0 为 NCS 向后兼容保留
-     * <li>2 <a href="http://www.ietf.org/rfc/rfc4122.txt">IETF&nbsp;RFC&nbsp;4122</a>(Leach-Salz), 用于此类
-     * <li>6 保留,微软向后兼容
-     * <li>7 保留供以后定义使用
-     * </ul>
-     *
-     * @return 此 {@code UUID} 相关联的变体号
-     */
-    public int variant() {
-        // This field is composed of a varying number of bits.
-        // 0 - - Reserved for NCS backward compatibility
-        // 1 0 - The IETF aka Leach-Salz variant (used by this class)
-        // 1 1 0 Reserved, Microsoft backward compatibility
-        // 1 1 1 Reserved for future definition.
-        return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63));
-    }
-
-    /**
-     * 与此 UUID 相关联的时间戳值。
-     *
-     * <p>
-     * 60 位的时间戳值根据此 {@code UUID} 的 time_low、time_mid 和 time_hi 字段构造。<br>
-     * 所得到的时间戳以 100 毫微秒为单位,从 UTC(通用协调时间) 1582 年 10 月 15 日零时开始。
-     *
-     * <p>
-     * 时间戳值仅在在基于时间的 UUID(其 version 类型为 1)中才有意义。<br>
-     * 如果此 {@code UUID} 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。
-     *
-     * @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。
-     */
-    public long timestamp() throws UnsupportedOperationException {
-        checkTimeBase();
-        return (mostSigBits & 0x0FFFL) << 48//
-                | ((mostSigBits >> 16) & 0x0FFFFL) << 32//
-                | mostSigBits >>> 32;
-    }
-
-    /**
-     * 与此 UUID 相关联的时钟序列值。
-     *
-     * <p>
-     * 14 位的时钟序列值根据此 UUID 的 clock_seq 字段构造。clock_seq 字段用于保证在基于时间的 UUID 中的时间唯一性。
-     * <p>
-     * {@code clockSequence} 值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。 如果此 UUID 不是基于时间的 UUID,则此方法抛出
-     * UnsupportedOperationException。
-     *
-     * @return 此 {@code UUID} 的时钟序列
-     * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1
-     */
-    public int clockSequence() throws UnsupportedOperationException {
-        checkTimeBase();
-        return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48);
-    }
-
-    /**
-     * 与此 UUID 相关的节点值。
-     *
-     * <p>
-     * 48 位的节点值根据此 UUID 的 node 字段构造。此字段旨在用于保存机器的 IEEE 802 地址,该地址用于生成此 UUID 以保证空间唯一性。
-     * <p>
-     * 节点值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。<br>
-     * 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。
-     *
-     * @return 此 {@code UUID} 的节点值
-     * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1
-     */
-    public long node() throws UnsupportedOperationException {
-        checkTimeBase();
-        return leastSigBits & 0x0000FFFFFFFFFFFFL;
-    }
-
-    /**
-     * 返回此{@code UUID} 的字符串表现形式。
-     *
-     * <p>
-     * UUID 的字符串表示形式由此 BNF 描述:
-     *
-     * <pre>
-     * {@code
-     * UUID                   = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
-     * time_low               = 4*<hexOctet>
-     * time_mid               = 2*<hexOctet>
-     * time_high_and_version  = 2*<hexOctet>
-     * variant_and_sequence   = 2*<hexOctet>
-     * node                   = 6*<hexOctet>
-     * hexOctet               = <hexDigit><hexDigit>
-     * hexDigit               = [0-9a-fA-F]
-     * }
-     * </pre>
-     *
-     * </blockquote>
-     *
-     * @return 此{@code UUID} 的字符串表现形式
-     * @see #toString(boolean)
-     */
-    @Override
-    public String toString() {
-        return toString(false);
-    }
-
-    /**
-     * 返回此{@code UUID} 的字符串表现形式。
-     *
-     * <p>
-     * UUID 的字符串表示形式由此 BNF 描述:
-     *
-     * <pre>
-     * {@code
-     * UUID                   = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
-     * time_low               = 4*<hexOctet>
-     * time_mid               = 2*<hexOctet>
-     * time_high_and_version  = 2*<hexOctet>
-     * variant_and_sequence   = 2*<hexOctet>
-     * node                   = 6*<hexOctet>
-     * hexOctet               = <hexDigit><hexDigit>
-     * hexDigit               = [0-9a-fA-F]
-     * }
-     * </pre>
-     *
-     * </blockquote>
-     *
-     * @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串
-     * @return 此{@code UUID} 的字符串表现形式
-     */
-    public String toString(boolean isSimple) {
-        final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
-        // time_low
-        builder.append(digits(mostSigBits >> 32, 8));
-        if (false == isSimple) {
-            builder.append('-');
-        }
-        // time_mid
-        builder.append(digits(mostSigBits >> 16, 4));
-        if (false == isSimple) {
-            builder.append('-');
-        }
-        // time_high_and_version
-        builder.append(digits(mostSigBits, 4));
-        if (false == isSimple) {
-            builder.append('-');
-        }
-        // variant_and_sequence
-        builder.append(digits(leastSigBits >> 48, 4));
-        if (false == isSimple) {
-            builder.append('-');
-        }
-        // node
-        builder.append(digits(leastSigBits, 12));
-
-        return builder.toString();
-    }
-
-    /**
-     * 返回此 UUID 的哈希码。
-     *
-     * @return UUID 的哈希码值。
-     */
-    @Override
-    public int hashCode() {
-        long hilo = mostSigBits ^ leastSigBits;
-        return ((int) (hilo >> 32)) ^ (int) hilo;
-    }
-
-    /**
-     * 将此对象与指定对象比较。
-     * <p>
-     * 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的 varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。
-     *
-     * @param obj 要与之比较的对象
-     * @return 如果对象相同,则返回 {@code true};否则返回 {@code false}
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if ((null == obj) || (obj.getClass() != UUID.class)) {
-            return false;
-        }
-        UUID id = (UUID) obj;
-        return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits);
-    }
-
-    // Comparison Operations
-
-    /**
-     * 将此 UUID 与指定的 UUID 比较。
-     *
-     * <p>
-     * 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。
-     *
-     * @param val 与此 UUID 比较的 UUID
-     * @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。
-     */
-    @Override
-    public int compareTo(UUID val) {
-        // The ordering is intentionally set up so that the UUIDs
-        // can simply be numerically compared as two numbers
-        return (this.mostSigBits < val.mostSigBits ? -1 : //
-                (this.mostSigBits > val.mostSigBits ? 1 : //
-                        (this.leastSigBits < val.leastSigBits ? -1 : //
-                                (this.leastSigBits > val.leastSigBits ? 1 : //
-                                        0))));
-    }
-
-    // Private method start
-
-    /**
-     * 返回指定数字对应的hex值
-     *
-     * @param val    值
-     * @param digits 位
-     * @return 值
-     */
-    private static String digits(long val, int digits) {
-        long hi = 1L << (digits * 4);
-        return Long.toHexString(hi | (val & (hi - 1))).substring(1);
-    }
-
-    /**
-     * 检查是否为time-based版本UUID
-     */
-    private void checkTimeBase() {
-        if (version() != 1) {
-            throw new UnsupportedOperationException("Not a time-based UUID");
-        }
-    }
-
-    /**
-     * 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG)
-     *
-     * @return {@link SecureRandom}
-     */
-    public static SecureRandom getSecureRandom() {
-        try {
-            return SecureRandom.getInstance("SHA1PRNG");
-        } catch (NoSuchAlgorithmException e) {
-            throw new UtilException(e);
-        }
-    }
-
-    /**
-     * 获取随机数生成器对象<br>
-     * ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。
-     *
-     * @return {@link ThreadLocalRandom}
-     */
-    public static ThreadLocalRandom getRandom() {
-        return ThreadLocalRandom.current();
-    }
-}

+ 0 - 115
game-module/game-common/src/main/java/com/zanxiang/common/utils/BaseHttpSSLSocketFactory.java

@@ -1,115 +0,0 @@
-/**
- * Licensed Property to China UnionPay Co., Ltd.
- * <p>
- * (C) Copyright of China UnionPay Co., Ltd. 2010
- * All Rights Reserved.
- * <p>
- * <p>
- * Modification History:
- * =============================================================================
- * Author         Date          Description
- * ------------ ---------- ---------------------------------------------------
- * xshu       2014-05-28     SSLSocket 链接工具类(用于https)
- * =============================================================================
- */
-package com.zanxiang.common.utils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.net.ssl.*;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.security.cert.X509Certificate;
-
-public class BaseHttpSSLSocketFactory extends SSLSocketFactory {
-    private static final Logger logger = LoggerFactory.getLogger(BaseHttpSSLSocketFactory.class);
-
-    private SSLContext getSSLContext() {
-        return createEasySSLContext();
-    }
-
-    @Override
-    public Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2,
-                               int arg3) throws IOException {
-        return getSSLContext().getSocketFactory().createSocket(arg0, arg1,
-                arg2, arg3);
-    }
-
-    @Override
-    public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3)
-            throws IOException, UnknownHostException {
-        return getSSLContext().getSocketFactory().createSocket(arg0, arg1,
-                arg2, arg3);
-    }
-
-    @Override
-    public Socket createSocket(InetAddress arg0, int arg1) throws IOException {
-        return getSSLContext().getSocketFactory().createSocket(arg0, arg1);
-    }
-
-    @Override
-    public Socket createSocket(String arg0, int arg1) throws IOException,
-            UnknownHostException {
-        return getSSLContext().getSocketFactory().createSocket(arg0, arg1);
-    }
-
-    @Override
-    public String[] getSupportedCipherSuites() {
-        return null;
-    }
-
-    @Override
-    public String[] getDefaultCipherSuites() {
-        return null;
-    }
-
-    @Override
-    public Socket createSocket(Socket arg0, String arg1, int arg2, boolean arg3)
-            throws IOException {
-        return getSSLContext().getSocketFactory().createSocket(arg0, arg1,
-                arg2, arg3);
-    }
-
-    private SSLContext createEasySSLContext() {
-        try {
-            SSLContext context = SSLContext.getInstance("SSL");
-            context.init(null,
-                    new TrustManager[]{MyX509TrustManager.manger}, null);
-            return context;
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            return null;
-        }
-    }
-
-    public static class MyX509TrustManager implements X509TrustManager {
-
-        static MyX509TrustManager manger = new MyX509TrustManager();
-
-        public MyX509TrustManager() {
-        }
-
-        public X509Certificate[] getAcceptedIssuers() {
-            return null;
-        }
-
-        public void checkClientTrusted(X509Certificate[] chain, String authType) {
-        }
-
-        public void checkServerTrusted(X509Certificate[] chain, String authType) {
-        }
-    }
-
-    /**
-     * 解决由于服务器证书问题导致HTTPS无法访问的情况 PS:HTTPS hostname wrong: should be <localhost>
-     */
-    public static class TrustAnyHostnameVerifier implements HostnameVerifier {
-        public boolean verify(String hostname, SSLSession session) {
-            // 直接返回true
-            return true;
-        }
-    }
-}

+ 0 - 56
game-module/game-common/src/main/java/com/zanxiang/common/utils/DateUtils.java

@@ -1,56 +0,0 @@
-package com.zanxiang.common.utils;
-
-import com.zanxiang.module.util.DateUtil;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.temporal.TemporalAdjusters;
-
-/**
- * 时间工具类
- *
- * @author ruoyi
- */
-public class DateUtils extends DateUtil {
-
-    /**
-     * 验证当前时间是否为当天
-     *
-     * @param time
-     * @return
-     */
-    public static boolean isToday(LocalDateTime time) {
-        LocalDateTime startTime = LocalDateTime.now().with(LocalTime.MIN);
-        LocalDateTime endTime = LocalDateTime.now().with(LocalTime.MAX);
-        //如果大于今天的开始日期,小于今天的结束日期
-        return time.isAfter(startTime) && time.isBefore(endTime);
-    }
-
-    /**
-     * 验证当前时间是否为当月
-     *
-     * @param time
-     * @return
-     */
-    public static boolean isThisMonth(LocalDateTime time) {
-        LocalDate localDate = time.toLocalDate();
-        LocalDate now = LocalDate.now();
-        return localDate.isAfter(now.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth())) &&
-                localDate.isBefore(now.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth()));
-    }
-
-    /**
-     * 验证当前时间是否为本周
-     *
-     * @param time
-     * @return
-     */
-    public static boolean isThisWeek(LocalDateTime time) {
-        LocalDateTime now = LocalDateTime.now();
-        int dayOfWeek = now.getDayOfWeek().getValue();
-        LocalDateTime weekStart = now.minusDays(dayOfWeek - 1).with(LocalTime.MIN);
-        LocalDateTime weekEnd = now.plusDays(7 - dayOfWeek).with(LocalTime.MAX);
-        return time.isAfter(weekStart) && time.isBefore(weekEnd);
-    }
-}

+ 0 - 44
game-module/game-common/src/main/java/com/zanxiang/common/utils/MD5Util.java

@@ -1,44 +0,0 @@
-package com.zanxiang.common.utils;
-
-import java.security.MessageDigest;
-
-/**
- * MD5加密
- */
-public class MD5Util {
-
-    private static String byteArrayToHexString(byte[] b) {
-        StringBuffer resultSb = new StringBuffer();
-        for (int i = 0; i < b.length; i++) {
-            resultSb.append(byteToHexString(b[i]));
-        }
-        return resultSb.toString();
-    }
-
-    private static String byteToHexString(byte b) {
-        int n = b;
-        if (n < 0) {
-            n += 256;
-        }
-        int d1 = n / 16;
-        int d2 = n % 16;
-        return hexDigits[d1] + hexDigits[d2];
-    }
-
-    public static String MD5Encode(String origin, String charsetName) {
-        String resultString = null;
-        try {
-            resultString = origin;
-            MessageDigest md = MessageDigest.getInstance("MD5");
-            if (StringUtils.isBlank(charsetName)) {
-                resultString = byteArrayToHexString(md.digest(resultString.getBytes()));
-            } else {
-                resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetName)));
-            }
-        } catch (Exception exception) {
-        }
-        return resultString;
-    }
-
-    private static final String[] hexDigits = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
-}

+ 0 - 102
game-module/game-common/src/main/java/com/zanxiang/common/utils/SpringUtils.java

@@ -1,102 +0,0 @@
-package com.zanxiang.common.utils;
-
-import org.springframework.aop.framework.AopContext;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.stereotype.Component;
-
-/**
- * spring工具类 方便在非spring管理环境中获取bean
- *
- * @author ruoyi
- */
-@Component
-public final class SpringUtils implements BeanFactoryPostProcessor {
-    /**
-     * Spring应用上下文环境
-     */
-    private static ConfigurableListableBeanFactory beanFactory;
-
-    @Override
-    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
-        SpringUtils.beanFactory = beanFactory;
-    }
-
-    /**
-     * 获取对象
-     *
-     * @param name
-     * @return Object 一个以所给名字注册的bean的实例
-     * @throws BeansException
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T getBean(String name) throws BeansException {
-        return (T) beanFactory.getBean(name);
-    }
-
-    /**
-     * 获取类型为requiredType的对象
-     *
-     * @param clz
-     * @return
-     * @throws BeansException
-     */
-    public static <T> T getBean(Class<T> clz) throws BeansException {
-        T result = (T) beanFactory.getBean(clz);
-        return result;
-    }
-
-    /**
-     * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
-     *
-     * @param name
-     * @return boolean
-     */
-    public static boolean containsBean(String name) {
-        return beanFactory.containsBean(name);
-    }
-
-    /**
-     * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException)
-     *
-     * @param name
-     * @return boolean
-     * @throws NoSuchBeanDefinitionException
-     */
-    public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
-        return beanFactory.isSingleton(name);
-    }
-
-    /**
-     * @param name
-     * @return Class 注册对象的类型
-     * @throws NoSuchBeanDefinitionException
-     */
-    public static Class<?> getType(String name) throws NoSuchBeanDefinitionException {
-        return beanFactory.getType(name);
-    }
-
-    /**
-     * 如果给定的bean名字在bean定义中有别名,则返回这些别名
-     *
-     * @param name
-     * @return
-     * @throws NoSuchBeanDefinitionException
-     */
-    public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
-        return beanFactory.getAliases(name);
-    }
-
-    /**
-     * 获取aop代理对象
-     *
-     * @param invoker
-     * @return
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T getAopProxy(T invoker) {
-        return (T) AopContext.currentProxy();
-    }
-}

+ 0 - 366
game-module/game-common/src/main/java/com/zanxiang/common/utils/StringUtils.java

@@ -1,366 +0,0 @@
-package com.zanxiang.common.utils;
-
-import com.zanxiang.common.text.StrFormatter;
-import org.apache.commons.lang3.ArrayUtils;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * 字符串工具类
- *
- * @author ruoyi
- */
-public class StringUtils extends org.apache.commons.lang3.StringUtils {
-
-    /**
-     * 空字符串
-     */
-    private static final String NULLSTR = "";
-
-    /**
-     * 下划线
-     */
-    private static final char SEPARATOR = '_';
-
-    /**
-     * 获取参数不为空值
-     *
-     * @param value defaultValue 要判断的value
-     * @return value 返回值
-     */
-    public static <T> T nvl(T value, T defaultValue) {
-        return value != null ? value : defaultValue;
-    }
-
-    /**
-     * * 判断一个Collection是否为空, 包含List,Set,Queue
-     *
-     * @param coll 要判断的Collection
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Collection<?> coll) {
-        return isNull(coll) || coll.isEmpty();
-    }
-
-    /**
-     * * 判断一个Collection是否非空,包含List,Set,Queue
-     *
-     * @param coll 要判断的Collection
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Collection<?> coll) {
-        return !isEmpty(coll);
-    }
-
-    /**
-     * * 判断一个对象数组是否为空
-     *
-     * @param objects 要判断的对象数组
-     *                * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Object[] objects) {
-        return isNull(objects) || (objects.length == 0);
-    }
-
-    /**
-     * * 判断一个对象数组是否非空
-     *
-     * @param objects 要判断的对象数组
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Object[] objects) {
-        return !isEmpty(objects);
-    }
-
-    /**
-     * * 判断一个Map是否为空
-     *
-     * @param map 要判断的Map
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Map<?, ?> map) {
-        return isNull(map) || map.isEmpty();
-    }
-
-    /**
-     * * 判断一个Map是否为空
-     *
-     * @param map 要判断的Map
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Map<?, ?> map) {
-        return !isEmpty(map);
-    }
-
-    /**
-     * * 判断一个字符串是否为空串
-     *
-     * @param str String
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(String str) {
-        return isNull(str) || NULLSTR.equals(str.trim());
-    }
-
-    /**
-     * * 判断一个字符串是否为非空串
-     *
-     * @param str String
-     * @return true:非空串 false:空串
-     */
-    public static boolean isNotEmpty(String str) {
-        return !isEmpty(str);
-    }
-
-    /**
-     * * 判断一个对象是否为空
-     *
-     * @param object Object
-     * @return true:为空 false:非空
-     */
-    public static boolean isNull(Object object) {
-        return object == null;
-    }
-
-    /**
-     * * 判断一个对象是否非空
-     *
-     * @param object Object
-     * @return true:非空 false:空
-     */
-    public static boolean isNotNull(Object object) {
-        return !isNull(object);
-    }
-
-    /**
-     * * 判断一个对象是否是数组类型(Java基本型别的数组)
-     *
-     * @param object 对象
-     * @return true:是数组 false:不是数组
-     */
-    public static boolean isArray(Object object) {
-        return isNotNull(object) && object.getClass().isArray();
-    }
-
-    /**
-     * 去空格
-     */
-    public static String trim(String str) {
-        return (str == null ? "" : str.trim());
-    }
-
-    /**
-     * 截取字符串
-     *
-     * @param str   字符串
-     * @param start 开始
-     * @return 结果
-     */
-    public static String substring(final String str, int start) {
-        if (str == null) {
-            return NULLSTR;
-        }
-
-        if (start < 0) {
-            start = str.length() + start;
-        }
-
-        if (start < 0) {
-            start = 0;
-        }
-        if (start > str.length()) {
-            return NULLSTR;
-        }
-
-        return str.substring(start);
-    }
-
-    /**
-     * 截取字符串
-     *
-     * @param str   字符串
-     * @param start 开始
-     * @param end   结束
-     * @return 结果
-     */
-    public static String substring(final String str, int start, int end) {
-        if (str == null) {
-            return NULLSTR;
-        }
-
-        if (end < 0) {
-            end = str.length() + end;
-        }
-        if (start < 0) {
-            start = str.length() + start;
-        }
-
-        if (end > str.length()) {
-            end = str.length();
-        }
-
-        if (start > end) {
-            return NULLSTR;
-        }
-
-        if (start < 0) {
-            start = 0;
-        }
-        if (end < 0) {
-            end = 0;
-        }
-
-        return str.substring(start, end);
-    }
-
-    /**
-     * 格式化文本, {} 表示占位符<br>
-     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
-     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
-     * 例:<br>
-     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
-     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
-     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
-     *
-     * @param template 文本模板,被替换的部分用 {} 表示
-     * @param params   参数值
-     * @return 格式化后的文本
-     */
-    public static String format(String template, Object... params) {
-        if (isEmpty(params) || isEmpty(template)) {
-            return template;
-        }
-        return StrFormatter.format(template, params);
-    }
-
-    /**
-     * 下划线转驼峰命名
-     */
-    public static String toUnderScoreCase(String str) {
-        if (str == null) {
-            return null;
-        }
-        StringBuilder sb = new StringBuilder();
-        // 前置字符是否大写
-        boolean preCharIsUpperCase = true;
-        // 当前字符是否大写
-        boolean curreCharIsUpperCase = true;
-        // 下一字符是否大写
-        boolean nexteCharIsUpperCase = true;
-        for (int i = 0; i < str.length(); i++) {
-            char c = str.charAt(i);
-            if (i > 0) {
-                preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
-            } else {
-                preCharIsUpperCase = false;
-            }
-
-            curreCharIsUpperCase = Character.isUpperCase(c);
-
-            if (i < (str.length() - 1)) {
-                nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
-            }
-
-            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
-                sb.append(SEPARATOR);
-            } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
-                sb.append(SEPARATOR);
-            }
-            sb.append(Character.toLowerCase(c));
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * 是否包含字符串
-     *
-     * @param str  验证字符串
-     * @param strs 字符串组
-     * @return 包含返回true
-     */
-    public static boolean inStringIgnoreCase(String str, String... strs) {
-        if (str != null && strs != null) {
-            for (String s : strs) {
-                if (str.equalsIgnoreCase(trim(s))) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
-     *
-     * @param name 转换前的下划线大写方式命名的字符串
-     * @return 转换后的驼峰式命名的字符串
-     */
-    public static String convertToCamelCase(String name) {
-        StringBuilder result = new StringBuilder();
-        // 快速检查
-        if (name == null || name.isEmpty()) {
-            // 没必要转换
-            return "";
-        } else if (!name.contains("_")) {
-            // 不含下划线,仅将首字母大写
-            return name.substring(0, 1).toUpperCase() + name.substring(1);
-        }
-        // 用下划线将原始字符串分割
-        String[] camels = name.split("_");
-        for (String camel : camels) {
-            // 跳过原始字符串中开头、结尾的下换线或双重下划线
-            if (camel.isEmpty()) {
-                continue;
-            }
-            // 首字母大写
-            result.append(camel.substring(0, 1).toUpperCase());
-            result.append(camel.substring(1).toLowerCase());
-        }
-        return result.toString();
-    }
-
-    /**
-     * 驼峰式命名法 例如:user_name->userName
-     */
-    public static String toCamelCase(String s) {
-        if (s == null) {
-            return null;
-        }
-        s = s.toLowerCase();
-        StringBuilder sb = new StringBuilder(s.length());
-        boolean upperCase = false;
-        for (int i = 0; i < s.length(); i++) {
-            char c = s.charAt(i);
-
-            if (c == SEPARATOR) {
-                upperCase = true;
-            } else if (upperCase) {
-                sb.append(Character.toUpperCase(c));
-                upperCase = false;
-            } else {
-                sb.append(c);
-            }
-        }
-        return sb.toString();
-    }
-
-    /**
-     * 判断数组里的字符串是否存在空值
-     *
-     * @param css : 需要判断的参数
-     * @return : 返回判断结果
-     */
-    public static boolean isAnyEmpty(final String... css) {
-        if (ArrayUtils.isEmpty(css)) {
-            return false;
-        }
-        for (final String cs : css) {
-            if (isEmpty(cs)) {
-                return true;
-            }
-        }
-        return false;
-    }
-}

+ 0 - 149
game-module/game-common/src/main/java/com/zanxiang/common/utils/URIUtil.java

@@ -1,149 +0,0 @@
-package com.zanxiang.common.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.util.Assert;
-
-import java.io.UnsupportedEncodingException;
-import java.net.InetSocketAddress;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.util.Map;
-
-/**
- * @Author wcc
- * @Date 2020/12/28 11:36
- * @Version 1.0
- * @Description
- */
-@Slf4j
-public class URIUtil {
-
-    /**
-     * 填充 url的请求参数,如果 params的值为空,不会写在 url上
-     *
-     * @param url
-     * @param params
-     * @return
-     */
-    public static String fillUrlParams(String url, Map<String, String> params, boolean ignoreBlank) {
-        if (params == null || params.isEmpty()) {
-            return url;
-        }
-        boolean first = !url.contains("?");
-        StringBuilder urlBuilder = new StringBuilder(url);
-        for (Map.Entry<String, String> param : params.entrySet()) {
-            if (ignoreBlank && StringUtils.isBlank(param.getValue())) {
-                continue;
-            }
-            if (first) {
-                urlBuilder.append("?");
-                first = false;
-            } else {
-                urlBuilder.append("&");
-            }
-            urlBuilder.append(param.getKey()).append("=").append(StringUtils.isBlank(param.getValue()) ? "" : param.getValue());
-        }
-        url = urlBuilder.toString();
-        return url;
-    }
-
-    /**
-     * 对应 js中的 encodeURIComponent
-     *
-     * @param uri
-     * @return
-     */
-    public static String encodeURIComponent(String uri) {
-        return encodeURIComponent(uri, "UTF-8");
-    }
-
-    /**
-     * 对应 js中的 encodeURIComponent
-     *
-     * @param uri
-     * @return
-     */
-    public static String encodeURIComponent(String uri, String enc) {
-        try {
-            return URLEncoder.encode(uri, enc)
-                    .replaceAll("\\+", "%20")
-                    .replaceAll("\\!", "%21")
-                    .replaceAll("\\'", "%27")
-                    .replaceAll("\\(", "%28")
-                    .replaceAll("\\)", "%29")
-                    .replaceAll("\\~", "%7E");
-        } catch (UnsupportedEncodingException e) {
-            log.error(e.getMessage(), e);
-            return null;
-        }
-    }
-
-    /**
-     * 对应 js的 decodeURIComponent
-     *
-     * @param uri
-     * @return
-     */
-    public static String decodeURIComponent(String uri) {
-        return decodeURIComponent(uri, "UTF-8");
-    }
-
-    /**
-     * 对应 js的 decodeURIComponent
-     *
-     * @param uri
-     * @return
-     */
-    public static String decodeURIComponent(String uri, String enc) {
-        try {
-            return URLDecoder.decode(uri.replaceAll("%20", "+")
-                    .replaceAll("%21", "!")
-                    .replaceAll("%27", "'")
-                    .replaceAll("%28", "(")
-                    .replaceAll("%29", ")")
-                    .replaceAll("%7E", "~"), enc);
-        } catch (UnsupportedEncodingException e) {
-            log.error(e.getMessage(), e);
-            return null;
-        }
-    }
-
-    public static InetSocketAddress parseURI(String uri, int defaultPort) {
-        Assert.notNull(uri, "uri must not be null");
-        String host;
-        String portString = null;
-
-        int colonPos = uri.indexOf(':');
-        if (colonPos >= 0 && uri.indexOf(':', colonPos + 1) == -1) {
-            // Exactly 1 colon. Split into host:port.
-            host = uri.substring(0, colonPos);
-            portString = uri.substring(colonPos + 1);
-        } else {
-            // 0 or 2+ colons. Bare hostname or IPv6 literal.
-            host = uri;
-        }
-
-        int port = defaultPort;
-        if (StringUtils.isNotBlank(portString)) {
-            // Try to parse the whole port string as a number.
-            Assert.isTrue(!portString.startsWith("+"), String.format("Cannot parse port number: %s", uri));
-            try {
-                port = Integer.parseInt(portString);
-            } catch (NumberFormatException e) {
-                throw new IllegalArgumentException(String.format("Cannot parse port number: %s", uri));
-            }
-
-            Assert.isTrue(isValidPort(port), String.format("Port number out of range: %s", uri));
-        }
-
-        return InetSocketAddress.createUnresolved(host, port);
-    }
-
-    /**
-     * @param port the port number
-     * @return {@literal true} for valid port numbers.
-     */
-    private static boolean isValidPort(int port) {
-        return port >= 0 && port <= 65535;
-    }
-}

+ 0 - 144
game-module/game-common/src/main/java/com/zanxiang/common/utils/bean/BeanUtils.java

@@ -1,144 +0,0 @@
-package com.zanxiang.common.utils.bean;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Bean 工具类
- *
- * @author ruoyi
- */
-public class BeanUtils extends org.springframework.beans.BeanUtils {
-    /**
-     * Bean方法名中属性名开始的下标
-     */
-    private static final int BEAN_METHOD_PROP_INDEX = 3;
-
-    /**
-     * 匹配getter方法的正则表达式
-     */
-    private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
-
-    /**
-     * 匹配setter方法的正则表达式
-     */
-    private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
-
-    /**
-     * 对象浅拷贝
-     *
-     * @param source
-     * @param target
-     * @param <T>
-     * @return
-     */
-    public static <T> T copy(Object source, Class<T> target) {
-        if (source == null) {
-            return null;
-        }
-        T obj = instantiateClass(target);
-        copyProperties(source, obj);
-        return obj;
-    }
-
-    /**
-     * 对象浅拷贝
-     *
-     * @param sourceList
-     * @param target
-     * @param <T>
-     * @return
-     */
-    public static <T> List<T> copyList(Collection sourceList, Class<T> target) {
-        if (sourceList == null || sourceList.isEmpty()) {
-            return Collections.emptyList();
-        }
-        List<T> objs = new ArrayList<>(sourceList.size());
-        for (Object source : sourceList) {
-            objs.add(copy(source, target));
-        }
-        return objs;
-    }
-
-    /**
-     * 获取对象的setter方法。
-     *
-     * @param obj 对象
-     * @return 对象的setter方法列表
-     */
-    public static List<Method> getSetterMethods(Object obj) {
-        // setter方法列表
-        List<Method> setterMethods = new ArrayList<Method>();
-
-        // 获取所有方法
-        Method[] methods = obj.getClass().getMethods();
-
-        // 查找setter方法
-
-        for (Method method : methods) {
-            Matcher m = SET_PATTERN.matcher(method.getName());
-            if (m.matches() && (method.getParameterTypes().length == 1)) {
-                setterMethods.add(method);
-            }
-        }
-        // 返回setter方法列表
-        return setterMethods;
-    }
-
-    /**
-     * 获取对象的getter方法。
-     *
-     * @param obj 对象
-     * @return 对象的getter方法列表
-     */
-
-    public static List<Method> getGetterMethods(Object obj) {
-        // getter方法列表
-        List<Method> getterMethods = new ArrayList<Method>();
-        // 获取所有方法
-        Method[] methods = obj.getClass().getMethods();
-        // 查找getter方法
-        for (Method method : methods) {
-            Matcher m = GET_PATTERN.matcher(method.getName());
-            if (m.matches() && (method.getParameterTypes().length == 0)) {
-                getterMethods.add(method);
-            }
-        }
-        // 返回getter方法列表
-        return getterMethods;
-    }
-
-    /**
-     * 检查Bean方法名中的属性名是否相等。<br>
-     * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。
-     *
-     * @param m1 方法名1
-     * @param m2 方法名2
-     * @return 属性名一样返回true,否则返回false
-     */
-
-    public static boolean isMethodPropEquals(String m1, String m2) {
-        return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
-    }
-
-    /**
-     * 将对象转为map
-     *
-     * @param obj
-     * @return
-     */
-    public static Map<String, String> parseObj2Map(Object obj) throws IllegalAccessException {
-        Map<String, String> map = new HashMap();
-        Field[] declaredFields = obj.getClass().getDeclaredFields();
-        for (Field field : declaredFields) {
-            field.setAccessible(true);
-            if (Objects.nonNull(field.get(obj))) {
-                map.put(field.getName(), field.get(obj).toString());
-            }
-        }
-        return map;
-    }
-}

+ 0 - 139
game-module/game-common/src/main/java/com/zanxiang/common/utils/http/AjaxResult.java

@@ -1,139 +0,0 @@
-package com.zanxiang.common.utils.http;
-
-import com.zanxiang.common.utils.StringUtils;
-
-import java.util.HashMap;
-
-/**
- * 操作消息提醒
- */
-public class AjaxResult<T> extends HashMap<String, Object> {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 状态码
-     */
-    public static final String CODE_TAG = "code";
-
-    /**
-     * 返回内容
-     */
-    public static final String MSG_TAG = "msg";
-
-    /**
-     * 数据对象
-     */
-    public static final String DATA_TAG = "data";
-
-    /**
-     * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
-     */
-    public AjaxResult() {
-    }
-
-    /**
-     * 初始化一个新创建的 AjaxResult 对象
-     *
-     * @param code 状态码
-     * @param msg  返回内容
-     */
-    public AjaxResult(int code, String msg) {
-        super.put(CODE_TAG, code);
-        super.put(MSG_TAG, msg);
-    }
-
-    /**
-     * 初始化一个新创建的 AjaxResult 对象
-     *
-     * @param code 状态码
-     * @param msg  返回内容
-     * @param data 数据对象
-     */
-    public AjaxResult(int code, String msg, T data) {
-        super.put(CODE_TAG, code);
-        super.put(MSG_TAG, msg);
-        if (StringUtils.isNotNull(data)) {
-            super.put(DATA_TAG, data);
-        }
-    }
-
-    /**
-     * 返回成功消息
-     *
-     * @return 成功消息
-     */
-    public static <T> AjaxResult<T> success() {
-        return AjaxResult.success("操作成功");
-    }
-
-    /**
-     * 返回成功数据
-     *
-     * @return 成功消息
-     */
-    public static <T> AjaxResult<T> success(T data) {
-        return AjaxResult.success("操作成功", data);
-    }
-
-    /**
-     * 返回成功消息
-     *
-     * @param msg 返回内容
-     * @return 成功消息
-     */
-    public static <T> AjaxResult<T> success(String msg) {
-        return AjaxResult.success(msg, null);
-    }
-
-    /**
-     * 返回成功消息
-     *
-     * @param msg  返回内容
-     * @param data 数据对象
-     * @return 成功消息
-     */
-    public static <T> AjaxResult<T> success(String msg, T data) {
-        return new AjaxResult<>(HttpStatus.SUCCESS, msg, data);
-    }
-
-    /**
-     * 返回错误消息
-     *
-     * @return
-     */
-    public static <T> AjaxResult<T> error() {
-        return AjaxResult.error("操作失败");
-    }
-
-    /**
-     * 返回错误消息
-     *
-     * @param msg 返回内容
-     * @return 警告消息
-     */
-    public static <T> AjaxResult<T> error(String msg) {
-        return AjaxResult.error(msg, null);
-    }
-
-    /**
-     * 返回错误消息
-     *
-     * @param msg  返回内容
-     * @param data 数据对象
-     * @return 警告消息
-     */
-    public static <T> AjaxResult<T> error(String msg, T data) {
-        return new AjaxResult<>(HttpStatus.ERROR, msg, data);
-    }
-
-    /**
-     * 返回错误消息
-     *
-     * @param code 状态码
-     * @param msg  返回内容
-     * @return 警告消息
-     */
-    public static <T> AjaxResult<T> error(int code, String msg) {
-        return new AjaxResult<>(code, msg, null);
-    }
-}

+ 0 - 88
game-module/game-common/src/main/java/com/zanxiang/common/utils/http/HttpStatus.java

@@ -1,88 +0,0 @@
-package com.zanxiang.common.utils.http;
-
-/**
- * 返回状态码
- *
- * @author ruoyi
- */
-public class HttpStatus {
-    /**
-     * 操作成功
-     */
-    public static final int SUCCESS = 200;
-
-    /**
-     * 对象创建成功
-     */
-    public static final int CREATED = 201;
-
-    /**
-     * 请求已经被接受
-     */
-    public static final int ACCEPTED = 202;
-
-    /**
-     * 操作已经执行成功,但是没有返回数据
-     */
-    public static final int NO_CONTENT = 204;
-
-    /**
-     * 资源已被移除
-     */
-    public static final int MOVED_PERM = 301;
-
-    /**
-     * 重定向
-     */
-    public static final int SEE_OTHER = 303;
-
-    /**
-     * 资源没有被修改
-     */
-    public static final int NOT_MODIFIED = 304;
-
-    /**
-     * 参数列表错误(缺少,格式不匹配)
-     */
-    public static final int BAD_REQUEST = 400;
-
-    /**
-     * 未授权
-     */
-    public static final int UNAUTHORIZED = 401;
-
-    /**
-     * 访问受限,授权过期
-     */
-    public static final int FORBIDDEN = 403;
-
-    /**
-     * 资源,服务未找到
-     */
-    public static final int NOT_FOUND = 404;
-
-    /**
-     * 不允许的http方法
-     */
-    public static final int BAD_METHOD = 405;
-
-    /**
-     * 资源冲突,或者资源被锁
-     */
-    public static final int CONFLICT = 409;
-
-    /**
-     * 不支持的数据,媒体类型
-     */
-    public static final int UNSUPPORTED_TYPE = 415;
-
-    /**
-     * 系统内部错误
-     */
-    public static final int ERROR = 500;
-
-    /**
-     * 接口未实现
-     */
-    public static final int NOT_IMPLEMENTED = 501;
-}

+ 64 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/base/BasePage.java

@@ -0,0 +1,64 @@
+package com.zanxiang.game.common.base;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+import java.time.LocalDate;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-22
+ * @description : 分页通用参数
+ */
+@Data
+public class BasePage<T> {
+
+    /**
+     * 当前记录起始索引
+     */
+    @NotNull(message = "当前页数不可为空")
+    @Min(value = 1, message = "起始页最小为 1")
+    @ApiModelProperty(value = "当前记录起始索引")
+    private Integer pageNum;
+
+    /**
+     * 每页显示记录数
+     */
+    @NotNull(message = "单页数量不可为空")
+    @Min(value = 1, message = "页面大小(2~200)之间")
+    @Max(value = 200, message = "页面大小(2~200)之间")
+    @ApiModelProperty(value = "每页显示记录数")
+    private Integer pageSize;
+
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "开始时间")
+    private LocalDate beginDate;
+
+    /**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "结束时间")
+    private LocalDate endDate;
+
+    /**
+     * 构造方法
+     *
+     * @return : 返回分页对象
+     */
+    public IPage<T> toPage() {
+        return new Page<>(pageNum, pageSize);
+    }
+}

+ 219 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/constant/Constants.java

@@ -0,0 +1,219 @@
+package com.zanxiang.game.common.constant;
+
+import java.math.BigDecimal;
+
+/**
+ * 通用常量信息
+ *
+ * @author ruoyi
+ */
+public class Constants {
+    /**
+     * UTF-8 字符集
+     */
+    public static final String UTF8 = "UTF-8";
+
+    /**
+     * GBK 字符集
+     */
+    public static final String GBK = "GBK";
+
+    /**
+     * http请求
+     */
+    public static final String HTTP = "http://";
+
+    /**
+     * https请求
+     */
+    public static final String HTTPS = "https://";
+
+    /**
+     * 登录成功
+     */
+    public static final String LOGIN_SUCCESS = "Success";
+
+    /**
+     * 注销
+     */
+    public static final String LOGOUT = "Logout";
+
+    /**
+     * 注册
+     */
+    public static final String REGISTER = "Register";
+
+    /**
+     * 登录失败
+     */
+    public static final String LOGIN_FAIL = "Error";
+
+    /**
+     * 当前记录起始索引
+     */
+    public static final String PAGE_NUM = "pageNum";
+
+    /**
+     * 每页显示记录数
+     */
+    public static final String PAGE_SIZE = "pageSize";
+
+    /**
+     * 排序列
+     */
+    public static final String ORDER_BY_COLUMN = "orderByColumn";
+
+    /**
+     * 排序的方向 "desc" 或者 "asc".
+     */
+    public static final String IS_ASC = "isAsc";
+
+    /**
+     * 验证码 redis key
+     */
+    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
+
+    /**
+     * 验证码有效期(分钟)
+     */
+    public static final long CAPTCHA_EXPIRATION = 5;
+
+    /**
+     * 最大令牌有效期(秒)
+     */
+    public final static long TOKEN_EXPIRE = 24 * 60 * 60;
+
+    /**
+     * 参数管理 cache key
+     */
+    public static final String SYS_CONFIG_KEY = "sys_config:";
+
+    /**
+     * 微信信息存储的前缀(所有 WxJava存储的信息都已这个开头)
+     */
+    public static final String WX_PREFIX = "wx:";
+
+    /**
+     * 微信预授权码前缀(存储用户 id)
+     */
+    public static final String WX_PRE_AUTH_PREFIX = "wx-auth:";
+
+    /**
+     * 微信延时消息列表的前缀:yyyy-MM-dd_HH:mm
+     */
+    public static final String WX_SEND_MSG = "wx-send-msg:";
+
+    /**
+     * 读取微信延时消息列表的锁
+     */
+    public static final String WX_SEND_MSG_LOCK = "wx-send-msg_lock:";
+
+    /**
+     * 刷新 access_token时的锁
+     */
+    public static final String AUTH_ACCESS_TOKEN_LOCK = "auth_access_token_lock:";
+
+    /**
+     * 字典管理 cache key
+     */
+    public static final String SYS_DICT_KEY = "sys_dict:";
+
+    /**
+     * 资源映射路径 前缀
+     */
+    public static final String RESOURCE_PREFIX = "/profile";
+
+    public static final String SINGLE_USER = "single_user_";
+
+    public static final String ROCKET_MQ_ORDER_MSG_KEY_KEFU = "sharding_key_kefu:";
+
+    /**
+     * 异步同步粉丝 Redis锁
+     */
+    public static final String ROCK_ASYNC_MP_FANS = "ROCK_ASYNC_MP_FANS_";
+
+    public static final BigDecimal NUM_100 = new BigDecimal(100);
+
+    public static final boolean ENABLE_NO = false;
+    public static final boolean ENABLE_YES = true;
+
+    /**
+     * 异步消费时间的锁
+     */
+    public static final String ASYNC_SAVE_LOG_LAST_TIME = "ASYNC_SAVE_LOG_LAST_TIME";
+
+    /**
+     * 临时缓存 mpFansLog日志
+     */
+    public static final String MP_FANS_LOG_BUFFER = "MP_FANS_LOG_BUFFER";
+    /**
+     * 临时缓存的 mp_kefu_msg_exection_log日志
+     */
+    public static final String KEFU_MSG_EXECUTION_DETAIL_BUFFER = "KEFU_MSG_EXECUTION_DETAIL_BUFFER";
+
+    /**
+     * 客服消息执行日志的统计信息
+     */
+    public static final String KEFU_MSG_EXECUTION_LOG_STAT = "KEFU_MSG_EXECUTION_LOG_STAT";
+
+    public static final String KEFU_STRATEGY_MQ_STAT = "KEFU_STRATEGY_MQ_STAT:";
+
+    public static final String TEMPLATE_STRATEGY_MQ_STAT = "TEMPLATE_STRATEGY_MQ_STAT:";
+
+    public static final String GROUP_STRATEGY_MQ_STAT = "GROUP_STRATEGY_MQ_STAT:";
+
+    /**
+     * 模板消息执行统计
+     */
+    public static final String TEMPLATE_SEND_DETAIL_STAT = "TEMPLATE_SEND_DETAIL_STAT:";
+
+    /**
+     * 模板消息回调执行统计
+     */
+    public static final String TEMPLATE_SEND_CALL_BACK_SUCCESS_STAT = "TEMPLATE_SEND_CALL_BACK_SUCCESS_STAT:";
+
+    /**
+     * 模板消息回调执行统计
+     */
+    public static final String TEMPLATE_SEND_CALL_BACK_FAILED_STAT = "TEMPLATE_SEND_CALL_BACK_FAILED_STAT:";
+
+    /**
+     * 模板消息发送日志,冒号后面加公众号 appid
+     */
+    public static final String TEMPLATE_SEND_LOG = "TEMPLATE_SEND_LOG:";
+
+    public static final String REDIS_CACHE_PREFIX = "SpringCache:";
+
+    /**
+     * 网关账号信息缓存
+     */
+    public static final String REDIS_GATEWAY_ACCOUNT_INFO = "Gateway:AccountInfo";
+
+    /**
+     * 网关服务信息
+     */
+    public static final String REDIS_GATEWAY_SERVER_INFO = "Gateway:ServerInfo:";
+
+    /**
+     * 网关白名单列表
+     */
+    public static final String REDIS_GATEWAY_WHITE_URL = "Gateway:WhiteUrl:";
+
+    /**
+     * 已登录用户列表
+     */
+    public static final String REDIS_LOGIN_USER_LIST = "Gateway:LoginUserList:";
+
+
+    /**
+     * 成功
+     */
+    public static final String SUCCESS = "success";
+
+    /**
+     * 失败
+     */
+    public static final String FAIL = "fail";
+
+
+}

+ 79 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/domain/ResultMap.java

@@ -0,0 +1,79 @@
+package com.zanxiang.game.common.domain;
+
+import com.zanxiang.game.common.enums.HttpStatusEnum;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 返回对象
+ *
+ * @author xufeng
+ * @date 2022/6/9 10:41
+ */
+public class ResultMap extends HashMap<String, Object> {
+
+    private static final long serialVersionUID = 1L;
+
+    public ResultMap() {
+        put("code", 0);
+    }
+
+    public static ResultMap error() {
+        return error(500, "未知异常,请联系管理员");
+    }
+
+    public static ResultMap error(String msg) {
+        return error(500, msg);
+    }
+
+    public static ResultMap error(int code, String msg) {
+        ResultMap r = new ResultMap();
+        r.put("code", code);
+        r.put("msg", msg);
+        return r;
+    }
+
+    public static ResultMap ok() {
+        ResultMap r = new ResultMap();
+        r.put("code", HttpStatusEnum.SUCCESS.getCode());
+        r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
+        return r;
+    }
+
+    public static ResultMap ok(Object data) {
+        ResultMap r = new ResultMap();
+        r.put("code", HttpStatusEnum.SUCCESS.getCode());
+        r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
+        r.put("data", data);
+        return r;
+    }
+
+    public static ResultMap ok(Long deviceType, Object data, String orderId) {
+        ResultMap r = new ResultMap();
+        r.put("code", HttpStatusEnum.SUCCESS.getCode());
+        r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
+        HashMap<String, Object> dataMap = new HashMap<>(2);
+        dataMap.put("data", data);
+        dataMap.put("deviceType", deviceType);
+        dataMap.put("orderId", orderId);
+        r.put("data", dataMap);
+        return r;
+    }
+
+    public static ResultMap ok(Map<String, Object> map) {
+        ResultMap r = new ResultMap();
+        r.put("code", HttpStatusEnum.SUCCESS.getCode());
+        r.put("msg", HttpStatusEnum.SUCCESS.getMsg());
+        HashMap<String, Object> dataMap = new HashMap<>(2);
+        dataMap.putAll(map);
+        r.put("data", dataMap);
+        return r;
+    }
+
+    @Override
+    public ResultMap put(String key, Object value) {
+        super.put(key, value);
+        return this;
+    }
+}

+ 111 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/domain/ResultVO.java

@@ -0,0 +1,111 @@
+package com.zanxiang.game.common.domain;
+
+import com.zanxiang.game.common.enums.HttpStatusEnum;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-07
+ * @description : http响应消息
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResultVO<T> implements Serializable {
+
+    /**
+     * 序列化
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 错误码
+     */
+    private Integer code;
+
+    /**
+     * 错误信息
+     */
+    private String msg;
+
+    /**
+     * 返回内容
+     */
+    private T data;
+
+    /**
+     * 错误消息返回构造
+     *
+     * @param httpStatusEnum : http响应消息枚举
+     */
+    public ResultVO(HttpStatusEnum httpStatusEnum) {
+        this.code = httpStatusEnum.getCode();
+        this.msg = httpStatusEnum.getMsg();
+    }
+
+    /**
+     * 默认返回成功构造
+     *
+     * @param data : 返回的内容
+     */
+    public ResultVO(T data) {
+        this.code = HttpStatusEnum.SUCCESS.getCode();
+        this.msg = HttpStatusEnum.SUCCESS.getMsg();
+        this.data = data;
+    }
+
+    /**
+     * 消息返回构造
+     *
+     * @param httpStatusEnum : http响应消息枚举
+     * @param data           : 返回的内容
+     */
+    public ResultVO(HttpStatusEnum httpStatusEnum, T data) {
+        this.code = httpStatusEnum.getCode();
+        this.msg = httpStatusEnum.getMsg();
+        this.data = data;
+    }
+
+    /**
+     * 自定义消息异常
+     *
+     * @param code : 错误码
+     * @param msg  : 错误消息
+     */
+    public ResultVO(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    /**
+     * 判断是否成功
+     */
+    public boolean isSuccess() {
+        return Objects.equals(HttpStatusEnum.SUCCESS.getCode(), this.code);
+    }
+
+    public static <T> ResultVO<T> fail(String msg) {
+        return new ResultVO<>(HttpStatusEnum.ERROR.getCode(), msg);
+    }
+
+    public static <T> ResultVO<T> ok(int code, String msg, T data) {
+        return new ResultVO<>(code, msg, data);
+    }
+
+    public static <T> ResultVO<T> ok(int code, String msg) {
+        return new ResultVO<>(code, msg);
+    }
+
+    public static <T> ResultVO<T> ok() {
+        return new ResultVO<>(HttpStatusEnum.SUCCESS.getCode(), HttpStatusEnum.SUCCESS.getMsg());
+    }
+
+    public static <T> ResultVO<T> ok(T data) {
+        return new ResultVO<>(HttpStatusEnum.SUCCESS.getCode(), HttpStatusEnum.SUCCESS.getMsg(), data);
+    }
+}

+ 39 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/AppletStoreEnum.java

@@ -0,0 +1,39 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-01-15
+ * @description : 商城小程序枚举类型
+ */
+@Getter
+@AllArgsConstructor
+public enum AppletStoreEnum {
+
+    /**
+     * 商城百货
+     */
+    STORE_GOODS(1, "商城百货"),
+
+    /**
+     * 商城美妆
+     */
+    STORE_BEAUTY(2, "商城美妆"),
+
+    /**
+     * 商城内容
+     */
+    STORE_CONTENT(3, "商城内容");
+
+    /**
+     * 账号类型
+     */
+    private Integer type;
+
+    /**
+     * 账号类型名称
+     */
+    private String name;
+}

+ 35 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/BanStatusEnum.java

@@ -0,0 +1,35 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-28
+ * @description : ip封禁管理状态
+ */
+@Getter
+@AllArgsConstructor
+public enum BanStatusEnum {
+
+    /**
+     * 正常
+     */
+    NORMAL_STATUS(0, "正常"),
+
+    /**
+     * 冻结/封禁 状态
+     */
+    BAN_STATUS(1, " 冻结/封禁 状态");
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 描述
+     */
+    private String describe;
+
+}

+ 39 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/CallBackEnum.java

@@ -0,0 +1,39 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-11
+ * @description : 上报枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum CallBackEnum {
+
+    /**
+     * 未上报
+     */
+    UN_CALL_BACK(0, "未上报"),
+
+    /**
+     * 上报成功
+     */
+    SUCCESS_CALL_BACK(1, "上报成功"),
+
+    /**
+     * 上报失败
+     */
+    FAIL_CALL_BACK(2, "上报失败");
+
+    /**
+     * 数据类型
+     */
+    private Integer callBackStatus;
+
+    /**
+     * 描述
+     */
+    private String name;
+}

+ 38 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/CpStatusEnum.java

@@ -0,0 +1,38 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author xufeng
+ * @date 2022/6/27 14:31
+ */
+@Getter
+@AllArgsConstructor
+public enum CpStatusEnum {
+
+    /**
+     * 同步失败
+     */
+    FAIL(-1, "失败"),
+
+    /**
+     * 待同步
+     */
+    READY(1, "待同步"),
+
+    /**
+     * 同步成功
+     */
+    SUCCESS(2, "同步成功");
+
+    /**
+     * 类型
+     */
+    private Integer status;
+
+    /**
+     * 描述
+     */
+    private String desc;
+}

+ 33 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/DeleteEnum.java

@@ -0,0 +1,33 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author xufeng
+ * @date 2022/6/13 11:39
+ */
+@Getter
+@AllArgsConstructor
+public enum DeleteEnum {
+
+    /**
+     * 正常
+     */
+    NO(0, "正常"),
+
+    /**
+     * 已删除
+     */
+    YES(1, "已删除");
+
+    /**
+     *
+     */
+    private int code;
+
+    /**
+     * 状态
+     */
+    private String name;
+}

+ 55 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/DeviceTypeEnum.java

@@ -0,0 +1,55 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-07
+ * @description : 客户端类型
+ */
+@Getter
+@AllArgsConstructor
+public enum DeviceTypeEnum {
+
+    /**
+     * 安卓app
+     */
+    DEVICE_TYPE_ANDROID(1, "android"),
+
+    /**
+     * 苹果app
+     */
+    DEVICE_TYPE_IOS(2, "ios"),
+
+    /**
+     * h5网页
+     */
+    DEVICE_TYPE_H5(3, "h5"),
+
+    /**
+     * 小程序
+     */
+    DEVICE_TYPE_MINI_APP(4, "miniApp");
+
+    /**
+     * 设备类型
+     */
+    private Integer deviceType;
+
+    /**
+     * 描述
+     */
+    private String describe;
+
+    public static DeviceTypeEnum getByDeviceType(Integer deviceType) {
+        for (DeviceTypeEnum deviceTypeEnum : DeviceTypeEnum.values()) {
+            if (Objects.equals(deviceTypeEnum.getDeviceType(), deviceType)) {
+                return deviceTypeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 65 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/ExpireTimeEnum.java

@@ -0,0 +1,65 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2021-11-16
+ * @description : 时间常量
+ */
+@Getter
+@AllArgsConstructor
+public enum ExpireTimeEnum {
+
+    /**
+     * 无固定期限
+     */
+    NONE(0, "无固定期限"),
+
+    /**
+     * 1分钟
+     */
+    ONE_MIN(60, "1分钟"),
+
+    /**
+     * 5分钟
+     */
+    FIVE_MIN(5 * 60, "5分钟"),
+
+    /**
+     * 1小时
+     */
+    ONE_HOUR(60 * 60, "1小时"),
+
+    /**
+     * 1天
+     */
+    ONE_DAY(24 * 60 * 60, "1天"),
+
+    /**
+     * 一周
+     */
+    ONE_WEEK(24 * 60 * 60 * 7, "一周"),
+
+    /**
+     * 1个月
+     */
+    ONE_MON(30 * 24 * 60 * 60, "1个月"),
+
+    /**
+     * 1年
+     */
+    ONE_YEAR(365 * 24 * 60 * 60, "1年");
+
+    /**
+     * 时间
+     */
+    private final long time;
+
+    /**
+     * 描述
+     */
+    private final String desc;
+
+}  

+ 46 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/FileTypeEnum.java

@@ -0,0 +1,46 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2021-08-11
+ * @description : oss文件上传类型
+ */
+@Getter
+public enum FileTypeEnum {
+
+    /**
+     * 视频类型
+     */
+    FILE_TYPE_VIDEO("video", "video/"),
+
+    /**
+     * 图片类型
+     */
+    FILE_TYPE_IMAGE("image", "image/");
+
+    /**
+     * 文件类型
+     */
+    private String fileType;
+
+    /**
+     * 文件存储文件名
+     */
+    private String filePath;
+
+    FileTypeEnum(String fileType, String filePath) {
+        this.fileType = fileType;
+        this.filePath = filePath;
+    }
+
+    public static FileTypeEnum getByFileType(String fileType) {
+        for (FileTypeEnum fileTypeEnum : FileTypeEnum.values()) {
+            if (fileTypeEnum.getFileType().equals(fileType)) {
+                return fileTypeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 44 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/GameCategoryEnum.java

@@ -0,0 +1,44 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-13
+ * @description : 游戏应用类型
+ */
+@Getter
+@AllArgsConstructor
+public enum GameCategoryEnum {
+
+    /**
+     * 微信小游戏
+     */
+    CATEGORY_WX_APPLET("wx_applet", "微信小游戏"),
+
+    /**
+     * 抖音小游戏
+     */
+    CATEGORY_DY_APPLET("byte_applet", "抖音小游戏"),
+
+    /**
+     * h5游戏
+     */
+    CATEGORY_H5("h5", "h5游戏"),
+
+    /**
+     * app游戏
+     */
+    CATEGORY_APP("app", "app游戏");
+
+    /**
+     * 游戏分类key
+     */
+    private String key;
+
+    /**
+     * 描述
+     */
+    private String name;
+}

+ 44 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/GameStatusEnum.java

@@ -0,0 +1,44 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-15
+ * @description : 游戏状态
+ */
+@Getter
+@AllArgsConstructor
+public enum GameStatusEnum {
+
+    /**
+     * 未接入
+     */
+    UN_JOIN_UP(1, "未接入"),
+
+    /**
+     * 接入中
+     */
+    NOW_JOIN_UP(2, "接入中"),
+
+    /**
+     * 上线
+     */
+    ON_LINE(3, "上线"),
+
+    /**
+     * 下线
+     */
+    OFF_LINE(4, "下线");
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 描述
+     */
+    private String name;
+}

+ 50 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/GameStrategyTypeEnum.java

@@ -0,0 +1,50 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-02-16
+ * @description : 游戏支付策略类型
+ */
+@Getter
+@AllArgsConstructor
+public enum GameStrategyTypeEnum {
+
+    /**
+     * 切换规则
+     */
+    CUT_RULE(1, "切换规则"),
+
+    /**
+     * 显示规则
+     */
+    SHOW_RULE(2, "显示规则"),
+
+    /**
+     * 订单起量切换规则
+     */
+    QUANTITY_CUT_RULE(3, "订单起量切换规则");
+
+    /**
+     * 游戏支付策略类型
+     */
+    private Integer type;
+
+    /**
+     * 游戏支付策略类型名称
+     */
+    private String name;
+
+    public static String getNameByType(Integer type) {
+        for (GameStrategyTypeEnum gameStrategyTypeEnum : GameStrategyTypeEnum.values()) {
+            if (Objects.equals(type, gameStrategyTypeEnum.getType())) {
+                return gameStrategyTypeEnum.getName();
+            }
+        }
+        return null;
+    }
+}

+ 294 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/HttpStatusEnum.java

@@ -0,0 +1,294 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-07
+ * @description : 用户状态
+ */
+@Getter
+@AllArgsConstructor
+public enum HttpStatusEnum {
+
+    /**
+     * 成功
+     */
+    SUCCESS(200, "success"),
+
+    /**
+     * 失败
+     */
+    FAIL(400, "failed"),
+
+    /**
+     * 服务器异常
+     */
+    ERROR(500, "服务器异常"),
+
+    /**
+     * 未知错误
+     */
+    UNKNOWN_ERROR(-9999, "未知错误"),
+
+    /**
+     * 请先登录
+     */
+    USER_NO_LOGIN(40400, "请登录"),
+
+    /**
+     * 用户名为空
+     */
+    USERNAME_EMPTY(41101, "用户名为空"),
+
+    /**
+     * 用户名含敏感字
+     */
+    USERNAME_SENSITIVE(41102, "用户名含敏感字"),
+
+    /**
+     * 用户名已存在
+     */
+    USERNAME_EXISTS(41103, "用户名已存在"),
+
+    /**
+     * 用户名不存在
+     */
+    USERNAME_NOT_EXISTS(41114, "用户名不存在"),
+
+    /**
+     * 用户名或密码错误
+     */
+    USERNAME_OR_PASSWORD_ERR(41104, "用户名或密码错误"),
+
+    /**
+     * 用户名太短
+     */
+    USERNAME_TOO_SHORT(41105, "用户名太短"),
+
+    /**
+     * 用户名太长
+     */
+    USERNAME_TOO_LONG(41106, "用户名太长"),
+
+    /**
+     * 用户名必须为数字字母组合
+     */
+    USERNAME_BAD_CHAR(41107, "用户名必须为数字字母组合"),
+
+    /**
+     * 账号停用
+     */
+    ACCOUNT_HALT(41108, "账号停用"),
+
+    /**
+     * ip封禁
+     */
+    IP_HALT(41109, "ip封禁"),
+
+    /**
+     * 账户未绑定手机
+     */
+    ACCOUNT_NOT_BIND_PHONE(41110, "账户未绑定手机"),
+
+    /**
+     * 手机号请使用手机注册
+     */
+    USERNAME_LIKE_MOBILE(41113, "手机号请使用手机注册"),
+
+    /**
+     * 密码为空
+     */
+    PASSWORD_EMPTY(41201, "密码为空"),
+
+    /**
+     * 密码必须为数字字母组合
+     */
+    PASSWORD_BAD_CHAR(41202, "密码必须为数字字母组合"),
+
+    /**
+     * 密码太长
+     */
+    PASSWORD_TOO_LONG(41203, "密码太长"),
+
+    /**
+     * 密码太短
+     */
+    PASSWORD_TOO_SHORT(41204, "密码太短"),
+
+    /**
+     * 密码错误
+     */
+    PASSWORD_ERROR(41205, "密码错误"),
+
+    /**
+     * 旧密码错误
+     */
+    OLD_PASSWORD_ERROR(41206, "旧密码错误"),
+
+    /**
+     * 旧密码不可为空
+     */
+    OLD_PASSWORD_EMPTY(41207, "旧密码不可为空"),
+
+    /**
+     * 手机号为空
+     */
+    PHONE_EMPTY(41301, "手机号为空"),
+
+    /**
+     * 手机号格式错误
+     */
+    PHONE_ERROR(41302, "手机号格式错误"),
+
+    /**
+     * 未绑定手机号
+     */
+    PHONE_NOT_BIND(41304, "未绑定手机号"),
+
+    /**
+     * 账号已绑定该手机号
+     */
+    PHONE_IS_BIND(41305, "账号已绑定该手机号"),
+
+    /**
+     * 验证码发送过于频繁
+     */
+    PHONE_SEND_MORE(41306, "验证码发送过于频繁"),
+
+    /**
+     * 验证码发送失败
+     */
+    PHONE_SEND_ERROR(41307, "验证码发送失败"),
+
+    /**
+     * 验证码已发送请稍后再试
+     */
+    PHONE_HAS_SEND(41308, "验证码已发送请稍后再试"),
+
+    /**
+     * 手机号已注册
+     */
+    PHONE_IS_REG(41309, "手机号已注册"),
+
+    /**
+     * 手机号未注册
+     */
+    PHONE_NOT_REG(41310, "手机号未注册"),
+
+    /**
+     * 请先校验原有手机号
+     */
+    PHONE_NOT_CHECK(41311, "请先校验原有手机号"),
+
+    /**
+     * 手机号绑定账号过多
+     */
+    PHONE_BIND_TOO_MUCH(41312, "手机号绑定账号过多"),
+
+    /**
+     * 手机号错误
+     */
+    PHONE_NUM_ERROR(41313, "手机号错误"),
+
+    /**
+     * 验证码错误
+     */
+    CODE_ERROR(41601, "验证码错误"),
+
+    /**
+     * 验证码类型错误
+     */
+    CODE_TYPE_ERROR(41602, "验证码类型错误"),
+
+    /**
+     * 验证码类型错误
+     */
+    CODE_NOT_SEND(41603, "验证码类型错误"),
+
+    /**
+     * 验证码已过期
+     */
+    CODE_IS_EXPIRED(41604, "验证码已过期"),
+
+    /**
+     * 配置错误
+     */
+    CONFIG_ERROR(41699, "配置错误"),
+
+    /**
+     * 参数非法
+     */
+    INVALID_PARAMS(1000, "参数非法"),
+
+    /**
+     * 订单游戏id为空
+     */
+    ORDER_GAME_ID_IS_NULL(41501, "订单游戏id为空"),
+
+    /**
+     * 订单不存在
+     */
+    ORDER_NO_FIND(41502, "订单不存在"),
+
+    /**
+     * 玩家充值未达标
+     */
+    ORDER_AMOUNT_IS_NULL(41503, "订单金额为空"),
+
+    /**
+     * 生成access_token失败
+     */
+    ACCESS_TOKEN_CREATE_ERROR(41504, "生成access_token失败"),
+
+    /**
+     * 米大师连接失败
+     */
+    MDS_CONNECT_ERROR(41505, "米大师连接失败"),
+
+    /**
+     * 获取配置异常
+     */
+    GET_CONFIG_ERROR(41507, "获取配置异常"),
+
+    /**
+     * 游戏用户未创建成功
+     */
+    GAME_USER_UN_CREATE(41511, "更新游戏角色时,检测为先创建游戏用户"),
+
+    /**
+     * 实名认证名字不合法
+     */
+    CARD_NAME_ERROR(41512, "名字输入错误"),
+
+    /**
+     * 实名认证身份证号不合法
+     */
+    CARD_ID_ERROR(41513, "身份证号输入错误"),
+
+    /**
+     * 已实名认证, 不可重复操作
+     */
+    REPEAT_OPERATE(41514, "已实名认证, 不可重复操作"),
+
+    /**
+     * 实名认证失败
+     */
+    AUTHENTICATION_FAIL(41515, "实名认证失败"),
+
+    /**
+     * 参数为空
+     */
+    PARAM_IS_NULL(41500, "参数为空:");
+
+    /**
+     * 回传类型
+     */
+    private final Integer code;
+
+    /**
+     * 回传名称
+     */
+    private final String msg;
+}

+ 33 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/MaxPayLock.java

@@ -0,0 +1,33 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author xufeng
+ * @date 2022/6/13 13:39
+ */
+@Getter
+@AllArgsConstructor
+public enum MaxPayLock {
+
+    /**
+     * 已锁定
+     */
+    LOCK(1, "已锁定"),
+
+    /**
+     * 未锁定
+     */
+    UNLOCK(0, "未锁定");
+
+    /**
+     * 状态
+     */
+    private Integer code;
+
+    /**
+     * 描述
+     */
+    private String name;
+}

+ 44 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/OrderStateEnum.java

@@ -0,0 +1,44 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-07
+ * @description : 用户状态
+ */
+@Getter
+@AllArgsConstructor
+public enum OrderStateEnum {
+
+    /**
+     * 预下单
+     */
+    READY_PAY(0, "预下单"),
+
+    /**
+     * 待支付
+     */
+    WAIT_PAY(1, "待支付"),
+
+    /**
+     * 支付成功
+     */
+    SUCCESS_PAY(2, "支付成功"),
+
+    /**
+     * 订单关闭
+     */
+    CANCEL_PAY(-1, "订单关闭");
+
+    /**
+     * 状态
+     */
+    private final Integer code;
+
+    /**
+     * 描述
+     */
+    private final String msg;
+}

+ 77 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/OsEnum.java

@@ -0,0 +1,77 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-30
+ * @description : 操作系统类型
+ */
+@Getter
+@AllArgsConstructor
+public enum OsEnum {
+
+    /**
+     * 安卓
+     */
+    SYSTEM_ANDROID(1, "android", "安卓手机操作系统"),
+
+    /**
+     * 苹果
+     */
+    SYSTEM_IOS(2, "ios", "苹果手机操作系统"),
+
+    /**
+     * window操作系统
+     */
+    SYSTEM_WINDOW(3, "windows", "window操作系统"),
+
+    /**
+     * Mac操作系统
+     */
+    SYSTEM_MAC(4, "mac", "Mac操作系统"),
+
+    /**
+     * linux操作系统
+     */
+    SYSTEM_LINUX(5, "linux", "linux操作系统"),
+
+    /**
+     * 其它操作系统
+     */
+    SYSTEM_OTHER(0, "other", "other操作系统");
+
+    /**
+     * 数据类型
+     */
+    private Integer osType;
+
+    /**
+     * 平台id
+     */
+    private String os;
+
+    /**
+     * 平台名称
+     */
+    private String osName;
+
+
+    /**
+     * 得到名字
+     *
+     * @param name 名字
+     * @return {@link Integer}
+     */
+    public static Integer getByName(String name) {
+        for (OsEnum osEnum : OsEnum.values()) {
+            if (Objects.equals(name, osEnum.getOsName())) {
+                return osEnum.getOsType();
+            }
+        }
+        return OsEnum.SYSTEM_OTHER.osType;
+    }
+}

+ 51 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/Pay/AlipayPayConfigEnum.java

@@ -0,0 +1,51 @@
+package com.zanxiang.game.common.enums.Pay;
+
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author xufeng
+ * @date 2022/6/9 15:29
+ */
+@Getter
+public enum AlipayPayConfigEnum {
+    APPID("appId", "商户支付appId", false),
+    ALIPAYPUBLICKEY("alipayPublicKey", "支付宝公钥key", false),
+    MERCHANTPRIVATEKEY("merchantPrivateKey", "商户私钥key", false),
+    SIGNTYPE("signType", "加密方式", false),
+    MERCHANTCERTPATH("merchantCertPath", "商户证书", true),
+    ALIPAYCERTPATH("alipayCertPath", "支付宝证书", true),
+    ALIPAYROOTCERTPATH("alipayRootCertPath", "支付宝根证书", true);
+
+    private final String code;
+    private final String msg;
+    private Boolean isFile; //是否为文件
+
+    AlipayPayConfigEnum(String code, String msg, Boolean isFile) {
+        this.code = code;
+        this.msg = msg;
+        this.isFile = isFile;
+    }
+
+    public static List<String> getCodeList() {
+        List<String> arr = new ArrayList<>(20);
+        AlipayPayConfigEnum[] data = AlipayPayConfigEnum.values();
+        if (data.length == 0) {
+            return arr;
+        }
+        for (int i = 0; i < data.length; i++) {
+            arr.add(data[i].getCode());
+        }
+        return arr;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+}

+ 46 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/Pay/WxPayConfigEnum.java

@@ -0,0 +1,46 @@
+package com.zanxiang.game.common.enums.Pay;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author xufeng
+ * @date 2022/6/9 15:29
+ */
+public enum WxPayConfigEnum {
+    APPID("appId", "商户支付appId"),
+    APPSECRET("appSecret", "公众帐号secert"),
+    MCHID("mchId", "商户号"),
+    APIKEY("apiKey", "商户支付密钥"),
+    SIGNTYPE("signType", "加密方式"),
+    CERTPATH("certPath", "密钥地址"),
+    NOTIFYURL("notifyUrl", "回调地址(默认为空即可)");
+
+    private final String code;
+    private final String msg;
+
+    WxPayConfigEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public static List<String> getCodeList() {
+        List<String> arr = new ArrayList<>(20);
+        WxPayConfigEnum[] data = WxPayConfigEnum.values();
+        if (data.length == 0) {
+            return arr;
+        }
+        for (int i = 0; i < data.length; i++) {
+            arr.add(data[i].getCode());
+        }
+        return arr;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+}

+ 49 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PayApplicationTypeEnum.java

@@ -0,0 +1,49 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-25
+ * @description : 应用类型枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum PayApplicationTypeEnum {
+
+    /**
+     * 微信小程序
+     */
+    WX_MINI_APP(1, "微信小程序"),
+
+    /**
+     * 微信公众号
+     */
+    WX_MP(2, "微信公众号"),
+
+    /**
+     * 支付宝应用
+     */
+    ALI_PAY_APP(3, "支付宝应用");
+
+    /**
+     * 应用类型
+     */
+    private Integer type;
+
+    /**
+     * 描述
+     */
+    private String describe;
+
+    public static String getDescByType(Integer type) {
+        PayApplicationTypeEnum[] values = PayApplicationTypeEnum.values();
+        for (PayApplicationTypeEnum value : values) {
+            if (value.getType().equals(type)) {
+                return value.getDescribe();
+            }
+        }
+        return null;
+    }
+}

+ 85 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PayDeviceEnum.java

@@ -0,0 +1,85 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 支付设备类型
+ *
+ * @author xufeng
+ * @date 2022/6/16 18:07
+ */
+@Getter
+@AllArgsConstructor
+public enum PayDeviceEnum {
+
+    /**
+     * Pc端支付
+     */
+    PC_PAY(1L, "PC", "PC二维码支付"),
+
+    /**
+     * h5支付
+     */
+    H5_PAY(2L, "H5", "H5支付"),
+
+    /**
+     * App支付
+     */
+    APP_PAY(3L, "APP", "APP支付"),
+
+    /**
+     * 小程序支付
+     */
+    APPLET_PAY(4L, "APPLET", "盒子支付"),
+
+    /**
+     * 米大师支付
+     */
+    MI_PAY(5L, "MI_PAY", "米大师支付"),
+
+    /**
+     * 客服支付
+     */
+    CUSTOM_PAY(6L, "CUSTOM_PAY", "客服支付");
+
+    /**
+     * 支付方式id
+     */
+    private Long payDeviceId;
+
+    /**
+     * 支付方式key
+     */
+    private String payDeviceKey;
+
+    /**
+     * 支付方式名称
+     */
+    private String payDeviceName;
+
+    public static String getDescByNum(Integer code) {
+        PayDeviceEnum[] values = PayDeviceEnum.values();
+        for (int i = 0; i < values.length; i++) {
+            if (values[i].getPayDeviceId().equals(code)) {
+                return values[i].getPayDeviceName();
+            }
+        }
+        return "";
+    }
+
+    public static String getDesc(String obj) {
+        List<String> Desc = new ArrayList<>(10);
+        String str = obj.substring(1, obj.length() - 1);
+        String[] strArr = str.split(",");
+        for (int i = 0; i < strArr.length; i++) {
+            String name = PayDeviceEnum.getDescByNum(Integer.valueOf(strArr[i]));
+            Desc.add(name);
+        }
+        return Desc.stream().collect(Collectors.joining(","));
+    }
+}

+ 66 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PayWayEnum.java

@@ -0,0 +1,66 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * 支付渠道枚举
+ *
+ * @author xufeng
+ * @date 2022/6/9 10:41
+ */
+@Getter
+@AllArgsConstructor
+public enum PayWayEnum {
+
+    /**
+     * 支付宝
+     */
+    ALI_PAY(1, "ALI_PAY", "支付宝"),
+
+    /**
+     * 微信
+     */
+    WX_PAY(2, "WX_PAY", "微信"),
+
+    /**
+     * 米大师
+     */
+    MI_PAY(3, "MI_PAY", "米大师");
+
+    /**
+     * 支付渠道id
+     */
+    private Integer payWayId;
+
+    /**
+     * 支付渠道key
+     */
+    private String payWayKey;
+
+    /**
+     * 支付渠道名称
+     */
+    private String payWayName;
+
+    /**
+     * 根据书城key获取名称
+     *
+     * @param payType : 支付类型
+     * @return : 支付类型枚举
+     */
+    public static String getByPayType(Long payType) {
+        if (payType == null) {
+            return null;
+        }
+        for (PayWayEnum payWayEnum : PayWayEnum.values()) {
+            if (Objects.equals(payType.intValue(), payWayEnum.getPayWayId())) {
+                return payWayEnum.getPayWayName();
+            }
+        }
+        return null;
+    }
+
+}

+ 57 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PromoAccountTypeEnum.java

@@ -0,0 +1,57 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-21
+ * @description : 推广账号类型
+ */
+@Getter
+@AllArgsConstructor
+public enum PromoAccountTypeEnum {
+
+    /**
+     * 微信公众号
+     */
+    ACCOUNT_WX_MP(1, "微信公众号"),
+
+    /**
+     * 今日头条账号
+     */
+    ACCOUNT_BYTE(2, "今日头条账号"),
+
+    /**
+     * ADQ(QQ)账号
+     */
+    ACCOUNT_ADQ_QQ(3, "ADQ(QQ)账号");
+
+    /**
+     * 账号类型
+     */
+    private Integer type;
+
+    /**
+     * 账号类型名称
+     */
+    private String name;
+
+    /**
+     * 被类型名称
+     *
+     * @param type 类型
+     * @return {@link String}
+     */
+    public static String getNameByType(Integer type) {
+        PromoAccountTypeEnum[] values = PromoAccountTypeEnum.values();
+        for (PromoAccountTypeEnum promoAccountTypeEnum : values) {
+            if (Objects.equals(promoAccountTypeEnum.getType(), type)) {
+                return promoAccountTypeEnum.getName();
+            }
+        }
+        return null;
+    }
+}

+ 62 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PromoMediaTypeEnum.java

@@ -0,0 +1,62 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-17
+ * @description : 推广媒体类型
+ */
+@Getter
+@AllArgsConstructor
+public enum PromoMediaTypeEnum {
+
+    /**
+     * 社交类
+     */
+    MEDIA_SOCIAL_CONTACT(1, "社交类"),
+
+    /**
+     * 短视频
+     */
+    MEDIA_SHORT_VIDEO(2, "短视频"),
+
+    /**
+     * 资讯
+     */
+    MEDIA_NEWS_INFO(3, "资讯"),
+
+    /**
+     * 视频
+     */
+    MEDIA_VIDEO(4, "视频");
+
+    /**
+     * 媒体类型
+     */
+    private Integer type;
+
+    /**
+     * 媒体名称
+     */
+    private String name;
+
+    /**
+     * 被类型名称
+     *
+     * @param type 类型
+     * @return {@link String}
+     */
+    public static String getNameByType(Integer type) {
+        PromoMediaTypeEnum[] values = PromoMediaTypeEnum.values();
+        for (PromoMediaTypeEnum promoMediaTypeEnum : values) {
+            if (Objects.equals(promoMediaTypeEnum.getType(), type)) {
+                return promoMediaTypeEnum.getName();
+            }
+        }
+        return null;
+    }
+}

+ 57 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/PromoProviderEnum.java

@@ -0,0 +1,57 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-10-26
+ * @description : 推广服务商
+ */
+@Getter
+@AllArgsConstructor
+public enum PromoProviderEnum {
+
+    /**
+     * 巨网
+     */
+    JU_GU(1, "巨网"),
+
+    /**
+     * 广联
+     */
+    GUANG_LIAN(2, "广联"),
+
+    /**
+     * 太古
+     */
+    TAI_GU(3, "太古");
+
+    /**
+     * 推广服务商id
+     */
+    private Integer providerId;
+
+    /**
+     * 推广媒体
+     */
+    private String providerName;
+
+    /**
+     * 被类型名称
+     *
+     * @param type 类型
+     * @return {@link String}
+     */
+    public static String getNameByType(Integer type) {
+        PromoProviderEnum[] values = PromoProviderEnum.values();
+        for (PromoProviderEnum promoProviderEnum : values) {
+            if (Objects.equals(promoProviderEnum.getProviderId(), type)) {
+                return promoProviderEnum.getProviderName();
+            }
+        }
+        return null;
+    }
+}

+ 61 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/SmsTypeEnum.java

@@ -0,0 +1,61 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.Objects;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-07
+ * @description : 手机验证码类型枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum SmsTypeEnum {
+
+    /**
+     * 注册登录
+     */
+    SMS_REG(1, "注册登录"),
+
+    /**
+     * 修改密码
+     */
+    SMS_MODIFY(2, "修改密码"),
+
+    /**
+     * 绑定手机
+     */
+    SMS_BIND(3, "绑定手机"),
+
+    /**
+     * 找回密码
+     */
+    SMS_FIND_PWD(4, "找回密码");
+
+    /**
+     * 类型
+     */
+    private Integer type;
+
+    /**
+     * 描述
+     */
+    private String describe;
+
+    /**
+     * 根据type获取枚举
+     *
+     * @return : 返回枚举对象
+     */
+    public static SmsTypeEnum getByType(Integer type) {
+        if (type == null) {
+            return null;
+        }
+        return Arrays.stream(SmsTypeEnum.values())
+                .filter(e -> Objects.equals(e.getType(), type))
+                .findFirst().orElse(null);
+    }
+}

+ 33 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/StatusEnum.java

@@ -0,0 +1,33 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author xufeng
+ * @date 2022/6/13 11:39
+ */
+@Getter
+@AllArgsConstructor
+public enum StatusEnum {
+
+    /**
+     * 正常
+     */
+    YES(0, "正常"),
+
+    /**
+     * 禁止
+     */
+    NO(1, "禁止");
+
+    /**
+     * 状态
+     */
+    private int code;
+
+    /**
+     * 描述
+     */
+    private String name;
+}

+ 84 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/enums/VipLevelEnum.java

@@ -0,0 +1,84 @@
+package com.zanxiang.game.common.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-30
+ * @description : vip等级枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum VipLevelEnum {
+
+    /**
+     * vip_0
+     */
+    VIP_LEVEL_ZERO(0, "0"),
+
+    /**
+     * vip_1
+     */
+    VIP_LEVEL_ONE(1, "1"),
+
+    /**
+     * vip_2
+     */
+    VIP_LEVEL_TWO(2, "2"),
+
+    /**
+     * vip_3
+     */
+    VIP_LEVEL_THREE(3, "3"),
+
+    /**
+     * vip_4
+     */
+    VIP_LEVEL_FOUR(4, "4"),
+
+    /**
+     * vip_5
+     */
+    VIP_LEVEL_FIVE(5, "5"),
+
+    /**
+     * vip_6
+     */
+    VIP_LEVEL_SIX(6, "6"),
+
+    /**
+     * vip_7
+     */
+    VIP_LEVEL_SEVEN(7, "7"),
+
+    /**
+     * vip_8
+     */
+    VIP_LEVEL_EIGHT(8, "8"),
+
+    /**
+     * vip_9
+     */
+    VIP_LEVEL_NINE(9, "9"),
+
+    /**
+     * vip_10
+     */
+    VIP_LEVEL_TEN(10, "10"),
+
+    /**
+     * vip_10以上
+     */
+    VIP_LEVEL_GT_TEN(1010, "10以上");
+
+    /**
+     * vip等级
+     */
+    private Integer vipLevel;
+
+    /**
+     * vip等级名称
+     */
+    private String vipLevelName;
+}

+ 59 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/exception/BaseException.java

@@ -0,0 +1,59 @@
+package com.zanxiang.game.common.exception;
+
+/**
+ * 基础异常
+ */
+public class BaseException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 所属模块
+     */
+    private String module;
+
+    /**
+     * 错误码
+     */
+    private String code;
+
+    /**
+     * 错误码对应的参数
+     */
+    private Object[] args;
+
+    public BaseException(String module, String code, Object[] args, String message) {
+        super(message);
+        this.module = module;
+        this.code = code;
+        this.args = args;
+    }
+
+    public BaseException(String module, String code, Object[] args) {
+        this(module, code, args, null);
+    }
+
+    public BaseException(String module, String message) {
+        this(module, null, null, message);
+    }
+
+    public BaseException(String code, Object[] args) {
+        this(null, code, args, null);
+    }
+
+    public BaseException(String message) {
+        this(null, null, null, message);
+    }
+
+    public String getModule() {
+        return module;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public Object[] getArgs() {
+        return args;
+    }
+}
+

+ 42 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/exception/CustomException.java

@@ -0,0 +1,42 @@
+package com.zanxiang.game.common.exception;
+
+import com.zanxiang.game.common.enums.HttpStatusEnum;
+
+/**
+ * 自定义异常
+ */
+public class CustomException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    private Integer code;
+
+    private String message;
+
+    public CustomException(String message) {
+        this.message = message;
+    }
+
+    public CustomException(String message, Integer code) {
+        this.message = message;
+        this.code = code;
+    }
+
+    public CustomException(HttpStatusEnum httpStatusEnum) {
+        this.message = httpStatusEnum.getMsg();
+        this.code = httpStatusEnum.getCode();
+    }
+
+    public CustomException(String message, Throwable e) {
+        super(message, e);
+        this.message = message;
+    }
+
+    @Override
+    public String getMessage() {
+        return message;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+}

+ 19 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/exception/ParamNullException.java

@@ -0,0 +1,19 @@
+package com.zanxiang.game.common.exception;
+
+/**
+ * 参数为空异常
+ *
+ * @author xufeng
+ * @date 2022/6/22 17:31
+ */
+public class ParamNullException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    private Integer code;
+
+    private String message;
+
+    public ParamNullException(String message) {
+        this.message = message;
+    }
+}

+ 13 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/exception/PreAuthorizeException.java

@@ -0,0 +1,13 @@
+package com.zanxiang.game.common.exception;
+
+/**
+ * 权限异常
+ *
+ * @author ruoyi
+ */
+public class PreAuthorizeException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    public PreAuthorizeException() {
+    }
+}

+ 22 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/exception/UtilException.java

@@ -0,0 +1,22 @@
+package com.zanxiang.game.common.exception;
+
+/**
+ * 工具类异常
+ *
+ * @author ruoyi
+ */
+public class UtilException extends RuntimeException {
+    private static final long serialVersionUID = 8247610319171014183L;
+
+    public UtilException(Throwable e) {
+        super(e.getMessage(), e);
+    }
+
+    public UtilException(String message) {
+        super(message);
+    }
+
+    public UtilException(String message, Throwable throwable) {
+        super(message, throwable);
+    }
+}

+ 101 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/handler/GlobalExceptionHandler.java

@@ -0,0 +1,101 @@
+package com.zanxiang.game.common.handler;
+
+import com.zanxiang.game.common.domain.ResultVO;
+import com.zanxiang.game.common.enums.HttpStatusEnum;
+import com.zanxiang.game.common.exception.BaseException;
+import com.zanxiang.game.common.exception.CustomException;
+import com.zanxiang.game.common.exception.ParamNullException;
+import com.zanxiang.game.common.exception.PreAuthorizeException;
+import com.zanxiang.game.common.utils.StringUtils;
+import com.zanxiang.game.common.utils.http.AjaxResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.validation.BindException;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
+
+/**
+ * 全局异常处理器
+ */
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+    private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
+
+    /**
+     * 基础异常
+     */
+    @ExceptionHandler(BaseException.class)
+    public ResultVO<?> baseException(BaseException e) {
+        return ResultVO.fail(e.getMessage());
+    }
+
+    /**
+     * 业务异常
+     */
+    @ExceptionHandler(CustomException.class)
+    public ResultVO<?> businessException(CustomException e) {
+        if (StringUtils.isNull(e.getCode())) {
+            return ResultVO.fail(e.getMessage());
+        }
+        return new ResultVO<>(e.getCode(), e.getMessage());
+    }
+
+    /**
+     * 参数异常
+     */
+    @ExceptionHandler(ParamNullException.class)
+    public ResultVO<?> paramNullException(CustomException e) {
+        if (StringUtils.isNull(e.getCode())) {
+            return new ResultVO<>(HttpStatusEnum.PARAM_IS_NULL.getCode(), HttpStatusEnum.PARAM_IS_NULL.getMsg() + e.getMessage());
+        }
+        return new ResultVO<>(e.getCode(), e.getMessage());
+    }
+
+    @ExceptionHandler(Exception.class)
+    public ResultVO<?> handleException(Exception e) {
+        log.error(e.getMessage(), e);
+        return ResultVO.fail("操作异常");
+    }
+
+    /**
+     * 自定义验证异常
+     */
+    @ExceptionHandler(BindException.class)
+    public ResultVO<?> validatedBindException(BindException e) {
+        log.error(e.getMessage(), e);
+        String message = e.getAllErrors().get(0).getDefaultMessage();
+        return ResultVO.fail(message);
+    }
+
+    /**
+     * 参数类型不匹配导致转换异常
+     *
+     * @param e
+     * @return
+     */
+    @ExceptionHandler(MethodArgumentTypeMismatchException.class)
+    public ResultVO<?> mismatchErrorHandler(MethodArgumentTypeMismatchException e) {
+        log.error("方法:{},字段:{},参数:{},错误信息:{}", e.getParameter().getMethod(), e.getName(), e.getValue(), e.getMessage());
+        return ResultVO.fail("参数异常,请勿非法操作");
+    }
+
+    /**
+     * 自定义验证异常
+     */
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    public Object validExceptionHandler(MethodArgumentNotValidException e) {
+        log.error(e.getMessage(), e);
+        String message = e.getBindingResult().getFieldError().getDefaultMessage();
+        return AjaxResult.error(message);
+    }
+
+    /**
+     * 权限异常
+     */
+    @ExceptionHandler(PreAuthorizeException.class)
+    public ResultVO<?> preAuthorizeException(PreAuthorizeException e) {
+        return ResultVO.fail("没有权限,请联系管理员授权");
+    }
+}

+ 91 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/text/CharsetKit.java

@@ -0,0 +1,91 @@
+package com.zanxiang.game.common.text;
+
+import org.springframework.util.StringUtils;
+
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * 字符集工具类
+ *
+ * @author ruoyi
+ */
+public class CharsetKit {
+    /**
+     * ISO-8859-1
+     */
+    public static final String ISO_8859_1 = "ISO-8859-1";
+    /**
+     * UTF-8
+     */
+    public static final String UTF_8 = "UTF-8";
+    /**
+     * GBK
+     */
+    public static final String GBK = "GBK";
+
+    /**
+     * ISO-8859-1
+     */
+    public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
+    /**
+     * UTF-8
+     */
+    public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
+    /**
+     * GBK
+     */
+    public static final Charset CHARSET_GBK = Charset.forName(GBK);
+
+    /**
+     * 转换为Charset对象
+     *
+     * @param charset 字符集,为空则返回默认字符集
+     * @return Charset
+     */
+    public static Charset charset(String charset) {
+        return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     *
+     * @param source      字符串
+     * @param srcCharset  源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, String srcCharset, String destCharset) {
+        return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
+    }
+
+    /**
+     * 转换字符串的字符集编码
+     *
+     * @param source      字符串
+     * @param srcCharset  源字符集,默认ISO-8859-1
+     * @param destCharset 目标字符集,默认UTF-8
+     * @return 转换后的字符集
+     */
+    public static String convert(String source, Charset srcCharset, Charset destCharset) {
+        if (null == srcCharset) {
+            srcCharset = StandardCharsets.ISO_8859_1;
+        }
+
+        if (null == destCharset) {
+            srcCharset = StandardCharsets.UTF_8;
+        }
+
+        if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset)) {
+            return source;
+        }
+        return new String(source.getBytes(srcCharset), destCharset);
+    }
+
+    /**
+     * @return 系统字符集编码
+     */
+    public static String systemCharset() {
+        return Charset.defaultCharset().name();
+    }
+}

+ 870 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/text/Convert.java

@@ -0,0 +1,870 @@
+package com.zanxiang.game.common.text;
+
+
+import com.zanxiang.game.common.utils.StringUtils;
+import com.zanxiang.module.util.JsonUtil;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.text.NumberFormat;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 类型转换器
+ *
+ * @author ruoyi
+ */
+public class Convert {
+    /**
+     * 转换为字符串<br>
+     * 如果给定的值为null,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static String toStr(Object value, String defaultValue) {
+        if (null == value) {
+            return defaultValue;
+        }
+        if (value instanceof String) {
+            return (String) value;
+        }
+        return value.toString();
+    }
+
+    /**
+     * 转换为字符串<br>
+     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static String toStr(Object value) {
+        return toStr(value, null);
+    }
+
+    /**
+     * 转换为字符<br>
+     * 如果给定的值为null,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Character toChar(Object value, Character defaultValue) {
+        if (null == value) {
+            return defaultValue;
+        }
+        if (value instanceof Character) {
+            return (Character) value;
+        }
+
+        final String valueStr = toStr(value, null);
+        return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0);
+    }
+
+    /**
+     * 转换为字符<br>
+     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Character toChar(Object value) {
+        return toChar(value, null);
+    }
+
+    /**
+     * 转换为byte<br>
+     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Byte toByte(Object value, Byte defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof Byte) {
+            return (Byte) value;
+        }
+        if (value instanceof Number) {
+            return ((Number) value).byteValue();
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            return Byte.parseByte(valueStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为byte<br>
+     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Byte toByte(Object value) {
+        return toByte(value, null);
+    }
+
+    /**
+     * 转换为Short<br>
+     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Short toShort(Object value, Short defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof Short) {
+            return (Short) value;
+        }
+        if (value instanceof Number) {
+            return ((Number) value).shortValue();
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            return Short.parseShort(valueStr.trim());
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为Short<br>
+     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Short toShort(Object value) {
+        return toShort(value, null);
+    }
+
+    /**
+     * 转换为Number<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Number toNumber(Object value, Number defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof Number) {
+            return (Number) value;
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            return NumberFormat.getInstance().parse(valueStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为Number<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Number toNumber(Object value) {
+        return toNumber(value, null);
+    }
+
+    /**
+     * 转换为int<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Integer toInt(Object value, Integer defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof Integer) {
+            return (Integer) value;
+        }
+        if (value instanceof Number) {
+            return ((Number) value).intValue();
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            return Integer.parseInt(valueStr.trim());
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为int<br>
+     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Integer toInt(Object value) {
+        return toInt(value, null);
+    }
+
+    /**
+     * 转换为Integer数组<br>
+     *
+     * @param str 被转换的值
+     * @return 结果
+     */
+    public static Integer[] toIntArray(String str) {
+        return toIntArray(",", str);
+    }
+
+    /**
+     * 转换为Long数组<br>
+     *
+     * @param str 被转换的值
+     * @return 结果
+     */
+    public static Long[] toLongArray(String str) {
+        return toLongArray(",", str);
+    }
+
+    /**
+     * 转换为Integer数组<br>
+     *
+     * @param split 分隔符
+     * @param split 被转换的值
+     * @return 结果
+     */
+    public static Integer[] toIntArray(String split, String str) {
+        if (StringUtils.isEmpty(str)) {
+            return new Integer[]{};
+        }
+        String[] arr = str.split(split);
+        final Integer[] ints = new Integer[arr.length];
+        for (int i = 0; i < arr.length; i++) {
+            final Integer v = toInt(arr[i], 0);
+            ints[i] = v;
+        }
+        return ints;
+    }
+
+    /**
+     * 转换为Long数组<br>
+     *
+     * @param split 分隔符
+     * @param str   被转换的值
+     * @return 结果
+     */
+    public static Long[] toLongArray(String split, String str) {
+        if (StringUtils.isEmpty(str)) {
+            return new Long[]{};
+        }
+        String[] arr = str.split(split);
+        final Long[] longs = new Long[arr.length];
+        for (int i = 0; i < arr.length; i++) {
+            final Long v = toLong(arr[i], null);
+            longs[i] = v;
+        }
+        return longs;
+    }
+
+    /**
+     * 转换为String数组<br>
+     *
+     * @param str 被转换的值
+     * @return 结果
+     */
+    public static String[] toStrArray(String str) {
+        return toStrArray(",", str);
+    }
+
+    /**
+     * 转换为String数组<br>
+     *
+     * @param split 分隔符
+     * @param split 被转换的值
+     * @return 结果
+     */
+    public static String[] toStrArray(String split, String str) {
+        return str.split(split);
+    }
+
+    /**
+     * 转换为long<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Long toLong(Object value, Long defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof Long) {
+            return (Long) value;
+        }
+        if (value instanceof Number) {
+            return ((Number) value).longValue();
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            // 支持科学计数法
+            return new BigDecimal(valueStr.trim()).longValue();
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为long<br>
+     * 如果给定的值为<code>null</code>,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Long toLong(Object value) {
+        return toLong(value, null);
+    }
+
+    /**
+     * 转换为double<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Double toDouble(Object value, Double defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof Double) {
+            return (Double) value;
+        }
+        if (value instanceof Number) {
+            return ((Number) value).doubleValue();
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            // 支持科学计数法
+            return new BigDecimal(valueStr.trim()).doubleValue();
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为double<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Double toDouble(Object value) {
+        return toDouble(value, null);
+    }
+
+    /**
+     * 转换为Float<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Float toFloat(Object value, Float defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof Float) {
+            return (Float) value;
+        }
+        if (value instanceof Number) {
+            return ((Number) value).floatValue();
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            return Float.parseFloat(valueStr.trim());
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为Float<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Float toFloat(Object value) {
+        return toFloat(value, null);
+    }
+
+    /**
+     * 转换为boolean<br>
+     * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static Boolean toBool(Object value, Boolean defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof Boolean) {
+            return (Boolean) value;
+        }
+        String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        valueStr = valueStr.trim().toLowerCase();
+        switch (valueStr) {
+            case "true":
+                return true;
+            case "false":
+                return false;
+            case "yes":
+                return true;
+            case "ok":
+                return true;
+            case "no":
+                return false;
+            case "1":
+                return true;
+            case "0":
+                return false;
+            default:
+                return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为boolean<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static Boolean toBool(Object value) {
+        return toBool(value, null);
+    }
+
+    /**
+     * 转换为Enum对象<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     *
+     * @param clazz        Enum的Class
+     * @param value        值
+     * @param defaultValue 默认值
+     * @return Enum
+     */
+    public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value, E defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (clazz.isAssignableFrom(value.getClass())) {
+            @SuppressWarnings("unchecked")
+            E myE = (E) value;
+            return myE;
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            return Enum.valueOf(clazz, valueStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为Enum对象<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
+     *
+     * @param clazz Enum的Class
+     * @param value 值
+     * @return Enum
+     */
+    public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value) {
+        return toEnum(clazz, value, null);
+    }
+
+    /**
+     * 转换为BigInteger<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static BigInteger toBigInteger(Object value, BigInteger defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof BigInteger) {
+            return (BigInteger) value;
+        }
+        if (value instanceof Long) {
+            return BigInteger.valueOf((Long) value);
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            return new BigInteger(valueStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为BigInteger<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static BigInteger toBigInteger(Object value) {
+        return toBigInteger(value, null);
+    }
+
+    /**
+     * 转换为BigDecimal<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value        被转换的值
+     * @param defaultValue 转换错误时的默认值
+     * @return 结果
+     */
+    public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) {
+        if (value == null) {
+            return defaultValue;
+        }
+        if (value instanceof BigDecimal) {
+            return (BigDecimal) value;
+        }
+        if (value instanceof Long) {
+            return new BigDecimal((Long) value);
+        }
+        if (value instanceof Double) {
+            return new BigDecimal((Double) value);
+        }
+        if (value instanceof Integer) {
+            return new BigDecimal((Integer) value);
+        }
+        final String valueStr = toStr(value, null);
+        if (StringUtils.isEmpty(valueStr)) {
+            return defaultValue;
+        }
+        try {
+            return new BigDecimal(valueStr);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * 转换为BigDecimal<br>
+     * 如果给定的值为空,或者转换失败,返回默认值<br>
+     * 转换失败不会报错
+     *
+     * @param value 被转换的值
+     * @return 结果
+     */
+    public static BigDecimal toBigDecimal(Object value) {
+        return toBigDecimal(value, null);
+    }
+
+    /**
+     * 将对象转为字符串<br>
+     * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
+     *
+     * @param obj 对象
+     * @return 字符串
+     */
+    public static String utf8Str(Object obj) {
+        return str(obj, CharsetKit.CHARSET_UTF_8);
+    }
+
+    /**
+     * 将对象转为字符串<br>
+     * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
+     *
+     * @param obj         对象
+     * @param charsetName 字符集
+     * @return 字符串
+     */
+    public static String str(Object obj, String charsetName) {
+        return str(obj, Charset.forName(charsetName));
+    }
+
+    /**
+     * 将对象转为字符串<br>
+     * 1、Byte数组和ByteBuffer会被转换为对应字符串的数组 2、对象数组会调用Arrays.toString方法
+     *
+     * @param obj     对象
+     * @param charset 字符集
+     * @return 字符串
+     */
+    public static String str(Object obj, Charset charset) {
+        if (null == obj) {
+            return null;
+        }
+
+        if (obj instanceof String) {
+            return (String) obj;
+        } else if (obj instanceof byte[] || obj instanceof Byte[]) {
+            return str((Byte[]) obj, charset);
+        } else if (obj instanceof ByteBuffer) {
+            return str((ByteBuffer) obj, charset);
+        }
+        return obj.toString();
+    }
+
+    /**
+     * 将byte数组转为字符串
+     *
+     * @param bytes   byte数组
+     * @param charset 字符集
+     * @return 字符串
+     */
+    public static String str(byte[] bytes, String charset) {
+        return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset));
+    }
+
+    /**
+     * 解码字节码
+     *
+     * @param data    字符串
+     * @param charset 字符集,如果此字段为空,则解码的结果取决于平台
+     * @return 解码后的字符串
+     */
+    public static String str(byte[] data, Charset charset) {
+        if (data == null) {
+            return null;
+        }
+
+        if (null == charset) {
+            return new String(data);
+        }
+        return new String(data, charset);
+    }
+
+    /**
+     * 将编码的byteBuffer数据转换为字符串
+     *
+     * @param data    数据
+     * @param charset 字符集,如果为空使用当前系统字符集
+     * @return 字符串
+     */
+    public static String str(ByteBuffer data, String charset) {
+        if (data == null) {
+            return null;
+        }
+
+        return str(data, Charset.forName(charset));
+    }
+
+    /**
+     * 将编码的byteBuffer数据转换为字符串
+     *
+     * @param data    数据
+     * @param charset 字符集,如果为空使用当前系统字符集
+     * @return 字符串
+     */
+    public static String str(ByteBuffer data, Charset charset) {
+        if (null == charset) {
+            charset = Charset.defaultCharset();
+        }
+        return charset.decode(data).toString();
+    }
+
+    /**
+     * 半角转全角
+     *
+     * @param input String.
+     * @return 全角字符串.
+     */
+    public static String toSBC(String input) {
+        return toSBC(input, null);
+    }
+
+    /**
+     * 半角转全角
+     *
+     * @param input         String
+     * @param notConvertSet 不替换的字符集合
+     * @return 全角字符串.
+     */
+    public static String toSBC(String input, Set<Character> notConvertSet) {
+        char c[] = input.toCharArray();
+        for (int i = 0; i < c.length; i++) {
+            if (null != notConvertSet && notConvertSet.contains(c[i])) {
+                // 跳过不替换的字符
+                continue;
+            }
+
+            if (c[i] == ' ') {
+                c[i] = '\u3000';
+            } else if (c[i] < '\177') {
+                c[i] = (char) (c[i] + 65248);
+
+            }
+        }
+        return new String(c);
+    }
+
+    /**
+     * 全角转半角
+     *
+     * @param input String.
+     * @return 半角字符串
+     */
+    public static String toDBC(String input) {
+        return toDBC(input, null);
+    }
+
+    /**
+     * 替换全角为半角
+     *
+     * @param text          文本
+     * @param notConvertSet 不替换的字符集合
+     * @return 替换后的字符
+     */
+    public static String toDBC(String text, Set<Character> notConvertSet) {
+        char c[] = text.toCharArray();
+        for (int i = 0; i < c.length; i++) {
+            if (null != notConvertSet && notConvertSet.contains(c[i])) {
+                // 跳过不替换的字符
+                continue;
+            }
+
+            if (c[i] == '\u3000') {
+                c[i] = ' ';
+            } else if (c[i] > '\uFF00' && c[i] < '\uFF5F') {
+                c[i] = (char) (c[i] - 65248);
+            }
+        }
+        String returnString = new String(c);
+
+        return returnString;
+    }
+
+    /**
+     * 数字金额大写转换 先写个完整的然后将如零拾替换成零
+     *
+     * @param n 数字
+     * @return 中文大写数字
+     */
+    public static String digitUppercase(double n) {
+        String[] fraction = {"角", "分"};
+        String[] digit = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
+        String[][] unit = {{"元", "万", "亿"}, {"", "拾", "佰", "仟"}};
+
+        String head = n < 0 ? "负" : "";
+        n = Math.abs(n);
+
+        String s = "";
+        for (int i = 0; i < fraction.length; i++) {
+            s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(零.)+", "");
+        }
+        if (s.length() < 1) {
+            s = "整";
+        }
+        int integerPart = (int) Math.floor(n);
+
+        for (int i = 0; i < unit[0].length && integerPart > 0; i++) {
+            String p = "";
+            for (int j = 0; j < unit[1].length && n > 0; j++) {
+                p = digit[integerPart % 10] + unit[1][j] + p;
+                integerPart = integerPart / 10;
+            }
+            s = p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i] + s;
+        }
+        return head + s.replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整");
+    }
+
+    /**
+     * unicode编码转换中文
+     *
+     * @param object: 需要转码的字符串
+     * @return : 转码之后的结果
+     */
+    public static String unicodeToString(Object object) {
+        String str = JsonUtil.toString(object);
+        Pattern pattern = Pattern.compile("(\\\\u(\\p{XDigit}{4}))");
+        Matcher matcher = pattern.matcher(str);
+        char ch;
+        while (matcher.find()) {
+            ch = (char) Integer.parseInt(matcher.group(2), 16);
+            str = str.replace(matcher.group(1), ch + "");
+        }
+        return str;
+    }
+}

+ 77 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/text/StrFormatter.java

@@ -0,0 +1,77 @@
+package com.zanxiang.game.common.text;
+
+
+import com.zanxiang.game.common.utils.StringUtils;
+
+/**
+ * 字符串格式化
+ *
+ * @author ruoyi
+ */
+public class StrFormatter {
+    public static final String EMPTY_JSON = "{}";
+    public static final char C_BACKSLASH = '\\';
+    public static final char C_DELIM_START = '{';
+    public static final char C_DELIM_END = '}';
+
+    /**
+     * 格式化字符串<br>
+     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
+     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
+     * 例:<br>
+     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
+     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
+     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
+     *
+     * @param strPattern 字符串模板
+     * @param argArray   参数列表
+     * @return 结果
+     */
+    public static String format(final String strPattern, final Object... argArray) {
+        if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray)) {
+            return strPattern;
+        }
+        final int strPatternLength = strPattern.length();
+
+        // 初始化定义好的长度以获得更好的性能
+        StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
+
+        int handledPosition = 0;
+        int delimIndex;// 占位符所在位置
+        for (int argIndex = 0; argIndex < argArray.length; argIndex++) {
+            delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
+            if (delimIndex == -1) {
+                if (handledPosition == 0) {
+                    return strPattern;
+                } else { // 字符串模板剩余部分不再包含占位符,加入剩余部分后返回结果
+                    sbuf.append(strPattern, handledPosition, strPatternLength);
+                    return sbuf.toString();
+                }
+            } else {
+                if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH) {
+                    if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH) {
+                        // 转义符之前还有一个转义符,占位符依旧有效
+                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
+                        sbuf.append(Convert.utf8Str(argArray[argIndex]));
+                        handledPosition = delimIndex + 2;
+                    } else {
+                        // 占位符被转义
+                        argIndex--;
+                        sbuf.append(strPattern, handledPosition, delimIndex - 1);
+                        sbuf.append(C_DELIM_START);
+                        handledPosition = delimIndex + 1;
+                    }
+                } else {
+                    // 正常占位符
+                    sbuf.append(strPattern, handledPosition, delimIndex);
+                    sbuf.append(Convert.utf8Str(argArray[argIndex]));
+                    handledPosition = delimIndex + 2;
+                }
+            }
+        }
+        // 加入最后一个占位符后所有的字符
+        sbuf.append(strPattern, handledPosition, strPattern.length());
+
+        return sbuf.toString();
+    }
+}

+ 441 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/text/UUID.java

@@ -0,0 +1,441 @@
+package com.zanxiang.game.common.text;
+
+
+import com.zanxiang.game.common.exception.UtilException;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.Random;
+import java.util.concurrent.ThreadLocalRandom;
+
+/**
+ * 提供通用唯一识别码(universally unique identifier)(UUID)实现
+ *
+ * @author ruoyi
+ */
+public final class UUID implements java.io.Serializable, Comparable<UUID> {
+    private static final long serialVersionUID = -1185015143654744140L;
+
+    /**
+     * SecureRandom 的单例
+     */
+    private static class Holder {
+        static final SecureRandom numberGenerator = getSecureRandom();
+    }
+
+    /**
+     * 此UUID的最高64有效位
+     */
+    private final long mostSigBits;
+
+    /**
+     * 此UUID的最低64有效位
+     */
+    private final long leastSigBits;
+
+    /**
+     * 私有构造
+     *
+     * @param data 数据
+     */
+    private UUID(byte[] data) {
+        long msb = 0;
+        long lsb = 0;
+        assert data.length == 16 : "data must be 16 bytes in length";
+        for (int i = 0; i < 8; i++) {
+            msb = (msb << 8) | (data[i] & 0xff);
+        }
+        for (int i = 8; i < 16; i++) {
+            lsb = (lsb << 8) | (data[i] & 0xff);
+        }
+        this.mostSigBits = msb;
+        this.leastSigBits = lsb;
+    }
+
+    /**
+     * 使用指定的数据构造新的 UUID。
+     *
+     * @param mostSigBits  用于 {@code UUID} 的最高有效 64 位
+     * @param leastSigBits 用于 {@code UUID} 的最低有效 64 位
+     */
+    public UUID(long mostSigBits, long leastSigBits) {
+        this.mostSigBits = mostSigBits;
+        this.leastSigBits = leastSigBits;
+    }
+
+    /**
+     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。
+     *
+     * @return 随机生成的 {@code UUID}
+     */
+    public static UUID fastUUID() {
+        return randomUUID(false);
+    }
+
+    /**
+     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
+     *
+     * @return 随机生成的 {@code UUID}
+     */
+    public static UUID randomUUID() {
+        return randomUUID(true);
+    }
+
+    /**
+     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
+     *
+     * @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能
+     * @return 随机生成的 {@code UUID}
+     */
+    public static UUID randomUUID(boolean isSecure) {
+        final Random ng = isSecure ? Holder.numberGenerator : getRandom();
+
+        byte[] randomBytes = new byte[16];
+        ng.nextBytes(randomBytes);
+        randomBytes[6] &= 0x0f; /* clear version */
+        randomBytes[6] |= 0x40; /* set to version 4 */
+        randomBytes[8] &= 0x3f; /* clear variant */
+        randomBytes[8] |= 0x80; /* set to IETF variant */
+        return new UUID(randomBytes);
+    }
+
+    /**
+     * 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。
+     *
+     * @param name 用于构造 UUID 的字节数组。
+     * @return 根据指定数组生成的 {@code UUID}
+     */
+    public static UUID nameUUIDFromBytes(byte[] name) {
+        MessageDigest md;
+        try {
+            md = MessageDigest.getInstance("MD5");
+        } catch (NoSuchAlgorithmException nsae) {
+            throw new InternalError("MD5 not supported");
+        }
+        byte[] md5Bytes = md.digest(name);
+        md5Bytes[6] &= 0x0f; /* clear version */
+        md5Bytes[6] |= 0x30; /* set to version 3 */
+        md5Bytes[8] &= 0x3f; /* clear variant */
+        md5Bytes[8] |= 0x80; /* set to IETF variant */
+        return new UUID(md5Bytes);
+    }
+
+    /**
+     * 根据 {@link #toString()} 方法中描述的字符串标准表示形式创建{@code UUID}。
+     *
+     * @param name 指定 {@code UUID} 字符串
+     * @return 具有指定值的 {@code UUID}
+     * @throws IllegalArgumentException 如果 name 与 {@link #toString} 中描述的字符串表示形式不符抛出此异常
+     */
+    public static UUID fromString(String name) {
+        String[] components = name.split("-");
+        if (components.length != 5) {
+            throw new IllegalArgumentException("Invalid UUID string: " + name);
+        }
+        for (int i = 0; i < 5; i++) {
+            components[i] = "0x" + components[i];
+        }
+
+        long mostSigBits = Long.decode(components[0]).longValue();
+        mostSigBits <<= 16;
+        mostSigBits |= Long.decode(components[1]).longValue();
+        mostSigBits <<= 16;
+        mostSigBits |= Long.decode(components[2]).longValue();
+
+        long leastSigBits = Long.decode(components[3]).longValue();
+        leastSigBits <<= 48;
+        leastSigBits |= Long.decode(components[4]).longValue();
+
+        return new UUID(mostSigBits, leastSigBits);
+    }
+
+    /**
+     * 返回此 UUID 的 128 位值中的最低有效 64 位。
+     *
+     * @return 此 UUID 的 128 位值中的最低有效 64 位。
+     */
+    public long getLeastSignificantBits() {
+        return leastSigBits;
+    }
+
+    /**
+     * 返回此 UUID 的 128 位值中的最高有效 64 位。
+     *
+     * @return 此 UUID 的 128 位值中最高有效 64 位。
+     */
+    public long getMostSignificantBits() {
+        return mostSigBits;
+    }
+
+    /**
+     * 与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。
+     * <p>
+     * 版本号具有以下含意:
+     * <ul>
+     * <li>1 基于时间的 UUID
+     * <li>2 DCE 安全 UUID
+     * <li>3 基于名称的 UUID
+     * <li>4 随机生成的 UUID
+     * </ul>
+     *
+     * @return 此 {@code UUID} 的版本号
+     */
+    public int version() {
+        // Version is bits masked by 0x000000000000F000 in MS long
+        return (int) ((mostSigBits >> 12) & 0x0f);
+    }
+
+    /**
+     * 与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。
+     * <p>
+     * 变体号具有以下含意:
+     * <ul>
+     * <li>0 为 NCS 向后兼容保留
+     * <li>2 <a href="http://www.ietf.org/rfc/rfc4122.txt">IETF&nbsp;RFC&nbsp;4122</a>(Leach-Salz), 用于此类
+     * <li>6 保留,微软向后兼容
+     * <li>7 保留供以后定义使用
+     * </ul>
+     *
+     * @return 此 {@code UUID} 相关联的变体号
+     */
+    public int variant() {
+        // This field is composed of a varying number of bits.
+        // 0 - - Reserved for NCS backward compatibility
+        // 1 0 - The IETF aka Leach-Salz variant (used by this class)
+        // 1 1 0 Reserved, Microsoft backward compatibility
+        // 1 1 1 Reserved for future definition.
+        return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63));
+    }
+
+    /**
+     * 与此 UUID 相关联的时间戳值。
+     *
+     * <p>
+     * 60 位的时间戳值根据此 {@code UUID} 的 time_low、time_mid 和 time_hi 字段构造。<br>
+     * 所得到的时间戳以 100 毫微秒为单位,从 UTC(通用协调时间) 1582 年 10 月 15 日零时开始。
+     *
+     * <p>
+     * 时间戳值仅在在基于时间的 UUID(其 version 类型为 1)中才有意义。<br>
+     * 如果此 {@code UUID} 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。
+     *
+     * @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。
+     */
+    public long timestamp() throws UnsupportedOperationException {
+        checkTimeBase();
+        return (mostSigBits & 0x0FFFL) << 48//
+                | ((mostSigBits >> 16) & 0x0FFFFL) << 32//
+                | mostSigBits >>> 32;
+    }
+
+    /**
+     * 与此 UUID 相关联的时钟序列值。
+     *
+     * <p>
+     * 14 位的时钟序列值根据此 UUID 的 clock_seq 字段构造。clock_seq 字段用于保证在基于时间的 UUID 中的时间唯一性。
+     * <p>
+     * {@code clockSequence} 值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。 如果此 UUID 不是基于时间的 UUID,则此方法抛出
+     * UnsupportedOperationException。
+     *
+     * @return 此 {@code UUID} 的时钟序列
+     * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1
+     */
+    public int clockSequence() throws UnsupportedOperationException {
+        checkTimeBase();
+        return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48);
+    }
+
+    /**
+     * 与此 UUID 相关的节点值。
+     *
+     * <p>
+     * 48 位的节点值根据此 UUID 的 node 字段构造。此字段旨在用于保存机器的 IEEE 802 地址,该地址用于生成此 UUID 以保证空间唯一性。
+     * <p>
+     * 节点值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。<br>
+     * 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。
+     *
+     * @return 此 {@code UUID} 的节点值
+     * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1
+     */
+    public long node() throws UnsupportedOperationException {
+        checkTimeBase();
+        return leastSigBits & 0x0000FFFFFFFFFFFFL;
+    }
+
+    /**
+     * 返回此{@code UUID} 的字符串表现形式。
+     *
+     * <p>
+     * UUID 的字符串表示形式由此 BNF 描述:
+     *
+     * <pre>
+     * {@code
+     * UUID                   = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
+     * time_low               = 4*<hexOctet>
+     * time_mid               = 2*<hexOctet>
+     * time_high_and_version  = 2*<hexOctet>
+     * variant_and_sequence   = 2*<hexOctet>
+     * node                   = 6*<hexOctet>
+     * hexOctet               = <hexDigit><hexDigit>
+     * hexDigit               = [0-9a-fA-F]
+     * }
+     * </pre>
+     *
+     * </blockquote>
+     *
+     * @return 此{@code UUID} 的字符串表现形式
+     * @see #toString(boolean)
+     */
+    @Override
+    public String toString() {
+        return toString(false);
+    }
+
+    /**
+     * 返回此{@code UUID} 的字符串表现形式。
+     *
+     * <p>
+     * UUID 的字符串表示形式由此 BNF 描述:
+     *
+     * <pre>
+     * {@code
+     * UUID                   = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
+     * time_low               = 4*<hexOctet>
+     * time_mid               = 2*<hexOctet>
+     * time_high_and_version  = 2*<hexOctet>
+     * variant_and_sequence   = 2*<hexOctet>
+     * node                   = 6*<hexOctet>
+     * hexOctet               = <hexDigit><hexDigit>
+     * hexDigit               = [0-9a-fA-F]
+     * }
+     * </pre>
+     *
+     * </blockquote>
+     *
+     * @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串
+     * @return 此{@code UUID} 的字符串表现形式
+     */
+    public String toString(boolean isSimple) {
+        final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
+        // time_low
+        builder.append(digits(mostSigBits >> 32, 8));
+        if (false == isSimple) {
+            builder.append('-');
+        }
+        // time_mid
+        builder.append(digits(mostSigBits >> 16, 4));
+        if (false == isSimple) {
+            builder.append('-');
+        }
+        // time_high_and_version
+        builder.append(digits(mostSigBits, 4));
+        if (false == isSimple) {
+            builder.append('-');
+        }
+        // variant_and_sequence
+        builder.append(digits(leastSigBits >> 48, 4));
+        if (false == isSimple) {
+            builder.append('-');
+        }
+        // node
+        builder.append(digits(leastSigBits, 12));
+
+        return builder.toString();
+    }
+
+    /**
+     * 返回此 UUID 的哈希码。
+     *
+     * @return UUID 的哈希码值。
+     */
+    @Override
+    public int hashCode() {
+        long hilo = mostSigBits ^ leastSigBits;
+        return ((int) (hilo >> 32)) ^ (int) hilo;
+    }
+
+    /**
+     * 将此对象与指定对象比较。
+     * <p>
+     * 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的 varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。
+     *
+     * @param obj 要与之比较的对象
+     * @return 如果对象相同,则返回 {@code true};否则返回 {@code false}
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if ((null == obj) || (obj.getClass() != UUID.class)) {
+            return false;
+        }
+        UUID id = (UUID) obj;
+        return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits);
+    }
+
+    // Comparison Operations
+
+    /**
+     * 将此 UUID 与指定的 UUID 比较。
+     *
+     * <p>
+     * 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。
+     *
+     * @param val 与此 UUID 比较的 UUID
+     * @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。
+     */
+    @Override
+    public int compareTo(UUID val) {
+        // The ordering is intentionally set up so that the UUIDs
+        // can simply be numerically compared as two numbers
+        return (this.mostSigBits < val.mostSigBits ? -1 : //
+                (this.mostSigBits > val.mostSigBits ? 1 : //
+                        (this.leastSigBits < val.leastSigBits ? -1 : //
+                                (this.leastSigBits > val.leastSigBits ? 1 : //
+                                        0))));
+    }
+
+    // Private method start
+
+    /**
+     * 返回指定数字对应的hex值
+     *
+     * @param val    值
+     * @param digits 位
+     * @return 值
+     */
+    private static String digits(long val, int digits) {
+        long hi = 1L << (digits * 4);
+        return Long.toHexString(hi | (val & (hi - 1))).substring(1);
+    }
+
+    /**
+     * 检查是否为time-based版本UUID
+     */
+    private void checkTimeBase() {
+        if (version() != 1) {
+            throw new UnsupportedOperationException("Not a time-based UUID");
+        }
+    }
+
+    /**
+     * 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG)
+     *
+     * @return {@link SecureRandom}
+     */
+    public static SecureRandom getSecureRandom() {
+        try {
+            return SecureRandom.getInstance("SHA1PRNG");
+        } catch (NoSuchAlgorithmException e) {
+            throw new UtilException(e);
+        }
+    }
+
+    /**
+     * 获取随机数生成器对象<br>
+     * ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。
+     *
+     * @return {@link ThreadLocalRandom}
+     */
+    public static ThreadLocalRandom getRandom() {
+        return ThreadLocalRandom.current();
+    }
+}

+ 115 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/BaseHttpSSLSocketFactory.java

@@ -0,0 +1,115 @@
+/**
+ * Licensed Property to China UnionPay Co., Ltd.
+ * <p>
+ * (C) Copyright of China UnionPay Co., Ltd. 2010
+ * All Rights Reserved.
+ * <p>
+ * <p>
+ * Modification History:
+ * =============================================================================
+ * Author         Date          Description
+ * ------------ ---------- ---------------------------------------------------
+ * xshu       2014-05-28     SSLSocket 链接工具类(用于https)
+ * =============================================================================
+ */
+package com.zanxiang.game.common.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.*;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.security.cert.X509Certificate;
+
+public class BaseHttpSSLSocketFactory extends SSLSocketFactory {
+    private static final Logger logger = LoggerFactory.getLogger(BaseHttpSSLSocketFactory.class);
+
+    private SSLContext getSSLContext() {
+        return createEasySSLContext();
+    }
+
+    @Override
+    public Socket createSocket(InetAddress arg0, int arg1, InetAddress arg2,
+                               int arg3) throws IOException {
+        return getSSLContext().getSocketFactory().createSocket(arg0, arg1,
+                arg2, arg3);
+    }
+
+    @Override
+    public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3)
+            throws IOException, UnknownHostException {
+        return getSSLContext().getSocketFactory().createSocket(arg0, arg1,
+                arg2, arg3);
+    }
+
+    @Override
+    public Socket createSocket(InetAddress arg0, int arg1) throws IOException {
+        return getSSLContext().getSocketFactory().createSocket(arg0, arg1);
+    }
+
+    @Override
+    public Socket createSocket(String arg0, int arg1) throws IOException,
+            UnknownHostException {
+        return getSSLContext().getSocketFactory().createSocket(arg0, arg1);
+    }
+
+    @Override
+    public String[] getSupportedCipherSuites() {
+        return null;
+    }
+
+    @Override
+    public String[] getDefaultCipherSuites() {
+        return null;
+    }
+
+    @Override
+    public Socket createSocket(Socket arg0, String arg1, int arg2, boolean arg3)
+            throws IOException {
+        return getSSLContext().getSocketFactory().createSocket(arg0, arg1,
+                arg2, arg3);
+    }
+
+    private SSLContext createEasySSLContext() {
+        try {
+            SSLContext context = SSLContext.getInstance("SSL");
+            context.init(null,
+                    new TrustManager[]{MyX509TrustManager.manger}, null);
+            return context;
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    public static class MyX509TrustManager implements X509TrustManager {
+
+        static MyX509TrustManager manger = new MyX509TrustManager();
+
+        public MyX509TrustManager() {
+        }
+
+        public X509Certificate[] getAcceptedIssuers() {
+            return null;
+        }
+
+        public void checkClientTrusted(X509Certificate[] chain, String authType) {
+        }
+
+        public void checkServerTrusted(X509Certificate[] chain, String authType) {
+        }
+    }
+
+    /**
+     * 解决由于服务器证书问题导致HTTPS无法访问的情况 PS:HTTPS hostname wrong: should be <localhost>
+     */
+    public static class TrustAnyHostnameVerifier implements HostnameVerifier {
+        public boolean verify(String hostname, SSLSession session) {
+            // 直接返回true
+            return true;
+        }
+    }
+}

+ 56 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/DateUtils.java

@@ -0,0 +1,56 @@
+package com.zanxiang.game.common.utils;
+
+import com.zanxiang.module.util.DateUtil;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.temporal.TemporalAdjusters;
+
+/**
+ * 时间工具类
+ *
+ * @author ruoyi
+ */
+public class DateUtils extends DateUtil {
+
+    /**
+     * 验证当前时间是否为当天
+     *
+     * @param time
+     * @return
+     */
+    public static boolean isToday(LocalDateTime time) {
+        LocalDateTime startTime = LocalDateTime.now().with(LocalTime.MIN);
+        LocalDateTime endTime = LocalDateTime.now().with(LocalTime.MAX);
+        //如果大于今天的开始日期,小于今天的结束日期
+        return time.isAfter(startTime) && time.isBefore(endTime);
+    }
+
+    /**
+     * 验证当前时间是否为当月
+     *
+     * @param time
+     * @return
+     */
+    public static boolean isThisMonth(LocalDateTime time) {
+        LocalDate localDate = time.toLocalDate();
+        LocalDate now = LocalDate.now();
+        return localDate.isAfter(now.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth())) &&
+                localDate.isBefore(now.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth()));
+    }
+
+    /**
+     * 验证当前时间是否为本周
+     *
+     * @param time
+     * @return
+     */
+    public static boolean isThisWeek(LocalDateTime time) {
+        LocalDateTime now = LocalDateTime.now();
+        int dayOfWeek = now.getDayOfWeek().getValue();
+        LocalDateTime weekStart = now.minusDays(dayOfWeek - 1).with(LocalTime.MIN);
+        LocalDateTime weekEnd = now.plusDays(7 - dayOfWeek).with(LocalTime.MAX);
+        return time.isAfter(weekStart) && time.isBefore(weekEnd);
+    }
+}

+ 44 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/MD5Util.java

@@ -0,0 +1,44 @@
+package com.zanxiang.game.common.utils;
+
+import java.security.MessageDigest;
+
+/**
+ * MD5加密
+ */
+public class MD5Util {
+
+    private static String byteArrayToHexString(byte[] b) {
+        StringBuffer resultSb = new StringBuffer();
+        for (int i = 0; i < b.length; i++) {
+            resultSb.append(byteToHexString(b[i]));
+        }
+        return resultSb.toString();
+    }
+
+    private static String byteToHexString(byte b) {
+        int n = b;
+        if (n < 0) {
+            n += 256;
+        }
+        int d1 = n / 16;
+        int d2 = n % 16;
+        return hexDigits[d1] + hexDigits[d2];
+    }
+
+    public static String MD5Encode(String origin, String charsetName) {
+        String resultString = null;
+        try {
+            resultString = origin;
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            if (StringUtils.isBlank(charsetName)) {
+                resultString = byteArrayToHexString(md.digest(resultString.getBytes()));
+            } else {
+                resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetName)));
+            }
+        } catch (Exception exception) {
+        }
+        return resultString;
+    }
+
+    private static final String[] hexDigits = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
+}

+ 102 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/SpringUtils.java

@@ -0,0 +1,102 @@
+package com.zanxiang.game.common.utils;
+
+import org.springframework.aop.framework.AopContext;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * spring工具类 方便在非spring管理环境中获取bean
+ *
+ * @author ruoyi
+ */
+@Component
+public final class SpringUtils implements BeanFactoryPostProcessor {
+    /**
+     * Spring应用上下文环境
+     */
+    private static ConfigurableListableBeanFactory beanFactory;
+
+    @Override
+    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
+        SpringUtils.beanFactory = beanFactory;
+    }
+
+    /**
+     * 获取对象
+     *
+     * @param name
+     * @return Object 一个以所给名字注册的bean的实例
+     * @throws BeansException
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T getBean(String name) throws BeansException {
+        return (T) beanFactory.getBean(name);
+    }
+
+    /**
+     * 获取类型为requiredType的对象
+     *
+     * @param clz
+     * @return
+     * @throws BeansException
+     */
+    public static <T> T getBean(Class<T> clz) throws BeansException {
+        T result = (T) beanFactory.getBean(clz);
+        return result;
+    }
+
+    /**
+     * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
+     *
+     * @param name
+     * @return boolean
+     */
+    public static boolean containsBean(String name) {
+        return beanFactory.containsBean(name);
+    }
+
+    /**
+     * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException)
+     *
+     * @param name
+     * @return boolean
+     * @throws NoSuchBeanDefinitionException
+     */
+    public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
+        return beanFactory.isSingleton(name);
+    }
+
+    /**
+     * @param name
+     * @return Class 注册对象的类型
+     * @throws NoSuchBeanDefinitionException
+     */
+    public static Class<?> getType(String name) throws NoSuchBeanDefinitionException {
+        return beanFactory.getType(name);
+    }
+
+    /**
+     * 如果给定的bean名字在bean定义中有别名,则返回这些别名
+     *
+     * @param name
+     * @return
+     * @throws NoSuchBeanDefinitionException
+     */
+    public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
+        return beanFactory.getAliases(name);
+    }
+
+    /**
+     * 获取aop代理对象
+     *
+     * @param invoker
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T getAopProxy(T invoker) {
+        return (T) AopContext.currentProxy();
+    }
+}

+ 366 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/StringUtils.java

@@ -0,0 +1,366 @@
+package com.zanxiang.game.common.utils;
+
+import com.zanxiang.game.common.text.StrFormatter;
+import org.apache.commons.lang3.ArrayUtils;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * 字符串工具类
+ *
+ * @author ruoyi
+ */
+public class StringUtils extends org.apache.commons.lang3.StringUtils {
+
+    /**
+     * 空字符串
+     */
+    private static final String NULLSTR = "";
+
+    /**
+     * 下划线
+     */
+    private static final char SEPARATOR = '_';
+
+    /**
+     * 获取参数不为空值
+     *
+     * @param value defaultValue 要判断的value
+     * @return value 返回值
+     */
+    public static <T> T nvl(T value, T defaultValue) {
+        return value != null ? value : defaultValue;
+    }
+
+    /**
+     * * 判断一个Collection是否为空, 包含List,Set,Queue
+     *
+     * @param coll 要判断的Collection
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Collection<?> coll) {
+        return isNull(coll) || coll.isEmpty();
+    }
+
+    /**
+     * * 判断一个Collection是否非空,包含List,Set,Queue
+     *
+     * @param coll 要判断的Collection
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Collection<?> coll) {
+        return !isEmpty(coll);
+    }
+
+    /**
+     * * 判断一个对象数组是否为空
+     *
+     * @param objects 要判断的对象数组
+     *                * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Object[] objects) {
+        return isNull(objects) || (objects.length == 0);
+    }
+
+    /**
+     * * 判断一个对象数组是否非空
+     *
+     * @param objects 要判断的对象数组
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Object[] objects) {
+        return !isEmpty(objects);
+    }
+
+    /**
+     * * 判断一个Map是否为空
+     *
+     * @param map 要判断的Map
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Map<?, ?> map) {
+        return isNull(map) || map.isEmpty();
+    }
+
+    /**
+     * * 判断一个Map是否为空
+     *
+     * @param map 要判断的Map
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Map<?, ?> map) {
+        return !isEmpty(map);
+    }
+
+    /**
+     * * 判断一个字符串是否为空串
+     *
+     * @param str String
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(String str) {
+        return isNull(str) || NULLSTR.equals(str.trim());
+    }
+
+    /**
+     * * 判断一个字符串是否为非空串
+     *
+     * @param str String
+     * @return true:非空串 false:空串
+     */
+    public static boolean isNotEmpty(String str) {
+        return !isEmpty(str);
+    }
+
+    /**
+     * * 判断一个对象是否为空
+     *
+     * @param object Object
+     * @return true:为空 false:非空
+     */
+    public static boolean isNull(Object object) {
+        return object == null;
+    }
+
+    /**
+     * * 判断一个对象是否非空
+     *
+     * @param object Object
+     * @return true:非空 false:空
+     */
+    public static boolean isNotNull(Object object) {
+        return !isNull(object);
+    }
+
+    /**
+     * * 判断一个对象是否是数组类型(Java基本型别的数组)
+     *
+     * @param object 对象
+     * @return true:是数组 false:不是数组
+     */
+    public static boolean isArray(Object object) {
+        return isNotNull(object) && object.getClass().isArray();
+    }
+
+    /**
+     * 去空格
+     */
+    public static String trim(String str) {
+        return (str == null ? "" : str.trim());
+    }
+
+    /**
+     * 截取字符串
+     *
+     * @param str   字符串
+     * @param start 开始
+     * @return 结果
+     */
+    public static String substring(final String str, int start) {
+        if (str == null) {
+            return NULLSTR;
+        }
+
+        if (start < 0) {
+            start = str.length() + start;
+        }
+
+        if (start < 0) {
+            start = 0;
+        }
+        if (start > str.length()) {
+            return NULLSTR;
+        }
+
+        return str.substring(start);
+    }
+
+    /**
+     * 截取字符串
+     *
+     * @param str   字符串
+     * @param start 开始
+     * @param end   结束
+     * @return 结果
+     */
+    public static String substring(final String str, int start, int end) {
+        if (str == null) {
+            return NULLSTR;
+        }
+
+        if (end < 0) {
+            end = str.length() + end;
+        }
+        if (start < 0) {
+            start = str.length() + start;
+        }
+
+        if (end > str.length()) {
+            end = str.length();
+        }
+
+        if (start > end) {
+            return NULLSTR;
+        }
+
+        if (start < 0) {
+            start = 0;
+        }
+        if (end < 0) {
+            end = 0;
+        }
+
+        return str.substring(start, end);
+    }
+
+    /**
+     * 格式化文本, {} 表示占位符<br>
+     * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
+     * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
+     * 例:<br>
+     * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
+     * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
+     * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
+     *
+     * @param template 文本模板,被替换的部分用 {} 表示
+     * @param params   参数值
+     * @return 格式化后的文本
+     */
+    public static String format(String template, Object... params) {
+        if (isEmpty(params) || isEmpty(template)) {
+            return template;
+        }
+        return StrFormatter.format(template, params);
+    }
+
+    /**
+     * 下划线转驼峰命名
+     */
+    public static String toUnderScoreCase(String str) {
+        if (str == null) {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder();
+        // 前置字符是否大写
+        boolean preCharIsUpperCase = true;
+        // 当前字符是否大写
+        boolean curreCharIsUpperCase = true;
+        // 下一字符是否大写
+        boolean nexteCharIsUpperCase = true;
+        for (int i = 0; i < str.length(); i++) {
+            char c = str.charAt(i);
+            if (i > 0) {
+                preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
+            } else {
+                preCharIsUpperCase = false;
+            }
+
+            curreCharIsUpperCase = Character.isUpperCase(c);
+
+            if (i < (str.length() - 1)) {
+                nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
+            }
+
+            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
+                sb.append(SEPARATOR);
+            } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
+                sb.append(SEPARATOR);
+            }
+            sb.append(Character.toLowerCase(c));
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * 是否包含字符串
+     *
+     * @param str  验证字符串
+     * @param strs 字符串组
+     * @return 包含返回true
+     */
+    public static boolean inStringIgnoreCase(String str, String... strs) {
+        if (str != null && strs != null) {
+            for (String s : strs) {
+                if (str.equalsIgnoreCase(trim(s))) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
+     *
+     * @param name 转换前的下划线大写方式命名的字符串
+     * @return 转换后的驼峰式命名的字符串
+     */
+    public static String convertToCamelCase(String name) {
+        StringBuilder result = new StringBuilder();
+        // 快速检查
+        if (name == null || name.isEmpty()) {
+            // 没必要转换
+            return "";
+        } else if (!name.contains("_")) {
+            // 不含下划线,仅将首字母大写
+            return name.substring(0, 1).toUpperCase() + name.substring(1);
+        }
+        // 用下划线将原始字符串分割
+        String[] camels = name.split("_");
+        for (String camel : camels) {
+            // 跳过原始字符串中开头、结尾的下换线或双重下划线
+            if (camel.isEmpty()) {
+                continue;
+            }
+            // 首字母大写
+            result.append(camel.substring(0, 1).toUpperCase());
+            result.append(camel.substring(1).toLowerCase());
+        }
+        return result.toString();
+    }
+
+    /**
+     * 驼峰式命名法 例如:user_name->userName
+     */
+    public static String toCamelCase(String s) {
+        if (s == null) {
+            return null;
+        }
+        s = s.toLowerCase();
+        StringBuilder sb = new StringBuilder(s.length());
+        boolean upperCase = false;
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+
+            if (c == SEPARATOR) {
+                upperCase = true;
+            } else if (upperCase) {
+                sb.append(Character.toUpperCase(c));
+                upperCase = false;
+            } else {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 判断数组里的字符串是否存在空值
+     *
+     * @param css : 需要判断的参数
+     * @return : 返回判断结果
+     */
+    public static boolean isAnyEmpty(final String... css) {
+        if (ArrayUtils.isEmpty(css)) {
+            return false;
+        }
+        for (final String cs : css) {
+            if (isEmpty(cs)) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

+ 149 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/URIUtil.java

@@ -0,0 +1,149 @@
+package com.zanxiang.game.common.utils;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.Assert;
+
+import java.io.UnsupportedEncodingException;
+import java.net.InetSocketAddress;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.util.Map;
+
+/**
+ * @Author wcc
+ * @Date 2020/12/28 11:36
+ * @Version 1.0
+ * @Description
+ */
+@Slf4j
+public class URIUtil {
+
+    /**
+     * 填充 url的请求参数,如果 params的值为空,不会写在 url上
+     *
+     * @param url
+     * @param params
+     * @return
+     */
+    public static String fillUrlParams(String url, Map<String, String> params, boolean ignoreBlank) {
+        if (params == null || params.isEmpty()) {
+            return url;
+        }
+        boolean first = !url.contains("?");
+        StringBuilder urlBuilder = new StringBuilder(url);
+        for (Map.Entry<String, String> param : params.entrySet()) {
+            if (ignoreBlank && StringUtils.isBlank(param.getValue())) {
+                continue;
+            }
+            if (first) {
+                urlBuilder.append("?");
+                first = false;
+            } else {
+                urlBuilder.append("&");
+            }
+            urlBuilder.append(param.getKey()).append("=").append(StringUtils.isBlank(param.getValue()) ? "" : param.getValue());
+        }
+        url = urlBuilder.toString();
+        return url;
+    }
+
+    /**
+     * 对应 js中的 encodeURIComponent
+     *
+     * @param uri
+     * @return
+     */
+    public static String encodeURIComponent(String uri) {
+        return encodeURIComponent(uri, "UTF-8");
+    }
+
+    /**
+     * 对应 js中的 encodeURIComponent
+     *
+     * @param uri
+     * @return
+     */
+    public static String encodeURIComponent(String uri, String enc) {
+        try {
+            return URLEncoder.encode(uri, enc)
+                    .replaceAll("\\+", "%20")
+                    .replaceAll("\\!", "%21")
+                    .replaceAll("\\'", "%27")
+                    .replaceAll("\\(", "%28")
+                    .replaceAll("\\)", "%29")
+                    .replaceAll("\\~", "%7E");
+        } catch (UnsupportedEncodingException e) {
+            log.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    /**
+     * 对应 js的 decodeURIComponent
+     *
+     * @param uri
+     * @return
+     */
+    public static String decodeURIComponent(String uri) {
+        return decodeURIComponent(uri, "UTF-8");
+    }
+
+    /**
+     * 对应 js的 decodeURIComponent
+     *
+     * @param uri
+     * @return
+     */
+    public static String decodeURIComponent(String uri, String enc) {
+        try {
+            return URLDecoder.decode(uri.replaceAll("%20", "+")
+                    .replaceAll("%21", "!")
+                    .replaceAll("%27", "'")
+                    .replaceAll("%28", "(")
+                    .replaceAll("%29", ")")
+                    .replaceAll("%7E", "~"), enc);
+        } catch (UnsupportedEncodingException e) {
+            log.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    public static InetSocketAddress parseURI(String uri, int defaultPort) {
+        Assert.notNull(uri, "uri must not be null");
+        String host;
+        String portString = null;
+
+        int colonPos = uri.indexOf(':');
+        if (colonPos >= 0 && uri.indexOf(':', colonPos + 1) == -1) {
+            // Exactly 1 colon. Split into host:port.
+            host = uri.substring(0, colonPos);
+            portString = uri.substring(colonPos + 1);
+        } else {
+            // 0 or 2+ colons. Bare hostname or IPv6 literal.
+            host = uri;
+        }
+
+        int port = defaultPort;
+        if (StringUtils.isNotBlank(portString)) {
+            // Try to parse the whole port string as a number.
+            Assert.isTrue(!portString.startsWith("+"), String.format("Cannot parse port number: %s", uri));
+            try {
+                port = Integer.parseInt(portString);
+            } catch (NumberFormatException e) {
+                throw new IllegalArgumentException(String.format("Cannot parse port number: %s", uri));
+            }
+
+            Assert.isTrue(isValidPort(port), String.format("Port number out of range: %s", uri));
+        }
+
+        return InetSocketAddress.createUnresolved(host, port);
+    }
+
+    /**
+     * @param port the port number
+     * @return {@literal true} for valid port numbers.
+     */
+    private static boolean isValidPort(int port) {
+        return port >= 0 && port <= 65535;
+    }
+}

+ 144 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/bean/BeanUtils.java

@@ -0,0 +1,144 @@
+package com.zanxiang.game.common.utils.bean;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Bean 工具类
+ *
+ * @author ruoyi
+ */
+public class BeanUtils extends org.springframework.beans.BeanUtils {
+    /**
+     * Bean方法名中属性名开始的下标
+     */
+    private static final int BEAN_METHOD_PROP_INDEX = 3;
+
+    /**
+     * 匹配getter方法的正则表达式
+     */
+    private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
+
+    /**
+     * 匹配setter方法的正则表达式
+     */
+    private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
+
+    /**
+     * 对象浅拷贝
+     *
+     * @param source
+     * @param target
+     * @param <T>
+     * @return
+     */
+    public static <T> T copy(Object source, Class<T> target) {
+        if (source == null) {
+            return null;
+        }
+        T obj = instantiateClass(target);
+        copyProperties(source, obj);
+        return obj;
+    }
+
+    /**
+     * 对象浅拷贝
+     *
+     * @param sourceList
+     * @param target
+     * @param <T>
+     * @return
+     */
+    public static <T> List<T> copyList(Collection sourceList, Class<T> target) {
+        if (sourceList == null || sourceList.isEmpty()) {
+            return Collections.emptyList();
+        }
+        List<T> objs = new ArrayList<>(sourceList.size());
+        for (Object source : sourceList) {
+            objs.add(copy(source, target));
+        }
+        return objs;
+    }
+
+    /**
+     * 获取对象的setter方法。
+     *
+     * @param obj 对象
+     * @return 对象的setter方法列表
+     */
+    public static List<Method> getSetterMethods(Object obj) {
+        // setter方法列表
+        List<Method> setterMethods = new ArrayList<Method>();
+
+        // 获取所有方法
+        Method[] methods = obj.getClass().getMethods();
+
+        // 查找setter方法
+
+        for (Method method : methods) {
+            Matcher m = SET_PATTERN.matcher(method.getName());
+            if (m.matches() && (method.getParameterTypes().length == 1)) {
+                setterMethods.add(method);
+            }
+        }
+        // 返回setter方法列表
+        return setterMethods;
+    }
+
+    /**
+     * 获取对象的getter方法。
+     *
+     * @param obj 对象
+     * @return 对象的getter方法列表
+     */
+
+    public static List<Method> getGetterMethods(Object obj) {
+        // getter方法列表
+        List<Method> getterMethods = new ArrayList<Method>();
+        // 获取所有方法
+        Method[] methods = obj.getClass().getMethods();
+        // 查找getter方法
+        for (Method method : methods) {
+            Matcher m = GET_PATTERN.matcher(method.getName());
+            if (m.matches() && (method.getParameterTypes().length == 0)) {
+                getterMethods.add(method);
+            }
+        }
+        // 返回getter方法列表
+        return getterMethods;
+    }
+
+    /**
+     * 检查Bean方法名中的属性名是否相等。<br>
+     * 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。
+     *
+     * @param m1 方法名1
+     * @param m2 方法名2
+     * @return 属性名一样返回true,否则返回false
+     */
+
+    public static boolean isMethodPropEquals(String m1, String m2) {
+        return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
+    }
+
+    /**
+     * 将对象转为map
+     *
+     * @param obj
+     * @return
+     */
+    public static Map<String, String> parseObj2Map(Object obj) throws IllegalAccessException {
+        Map<String, String> map = new HashMap();
+        Field[] declaredFields = obj.getClass().getDeclaredFields();
+        for (Field field : declaredFields) {
+            field.setAccessible(true);
+            if (Objects.nonNull(field.get(obj))) {
+                map.put(field.getName(), field.get(obj).toString());
+            }
+        }
+        return map;
+    }
+}

+ 139 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/http/AjaxResult.java

@@ -0,0 +1,139 @@
+package com.zanxiang.game.common.utils.http;
+
+import com.zanxiang.game.common.utils.StringUtils;
+
+import java.util.HashMap;
+
+/**
+ * 操作消息提醒
+ */
+public class AjaxResult<T> extends HashMap<String, Object> {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 状态码
+     */
+    public static final String CODE_TAG = "code";
+
+    /**
+     * 返回内容
+     */
+    public static final String MSG_TAG = "msg";
+
+    /**
+     * 数据对象
+     */
+    public static final String DATA_TAG = "data";
+
+    /**
+     * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
+     */
+    public AjaxResult() {
+    }
+
+    /**
+     * 初始化一个新创建的 AjaxResult 对象
+     *
+     * @param code 状态码
+     * @param msg  返回内容
+     */
+    public AjaxResult(int code, String msg) {
+        super.put(CODE_TAG, code);
+        super.put(MSG_TAG, msg);
+    }
+
+    /**
+     * 初始化一个新创建的 AjaxResult 对象
+     *
+     * @param code 状态码
+     * @param msg  返回内容
+     * @param data 数据对象
+     */
+    public AjaxResult(int code, String msg, T data) {
+        super.put(CODE_TAG, code);
+        super.put(MSG_TAG, msg);
+        if (StringUtils.isNotNull(data)) {
+            super.put(DATA_TAG, data);
+        }
+    }
+
+    /**
+     * 返回成功消息
+     *
+     * @return 成功消息
+     */
+    public static <T> AjaxResult<T> success() {
+        return AjaxResult.success("操作成功");
+    }
+
+    /**
+     * 返回成功数据
+     *
+     * @return 成功消息
+     */
+    public static <T> AjaxResult<T> success(T data) {
+        return AjaxResult.success("操作成功", data);
+    }
+
+    /**
+     * 返回成功消息
+     *
+     * @param msg 返回内容
+     * @return 成功消息
+     */
+    public static <T> AjaxResult<T> success(String msg) {
+        return AjaxResult.success(msg, null);
+    }
+
+    /**
+     * 返回成功消息
+     *
+     * @param msg  返回内容
+     * @param data 数据对象
+     * @return 成功消息
+     */
+    public static <T> AjaxResult<T> success(String msg, T data) {
+        return new AjaxResult<>(HttpStatus.SUCCESS, msg, data);
+    }
+
+    /**
+     * 返回错误消息
+     *
+     * @return
+     */
+    public static <T> AjaxResult<T> error() {
+        return AjaxResult.error("操作失败");
+    }
+
+    /**
+     * 返回错误消息
+     *
+     * @param msg 返回内容
+     * @return 警告消息
+     */
+    public static <T> AjaxResult<T> error(String msg) {
+        return AjaxResult.error(msg, null);
+    }
+
+    /**
+     * 返回错误消息
+     *
+     * @param msg  返回内容
+     * @param data 数据对象
+     * @return 警告消息
+     */
+    public static <T> AjaxResult<T> error(String msg, T data) {
+        return new AjaxResult<>(HttpStatus.ERROR, msg, data);
+    }
+
+    /**
+     * 返回错误消息
+     *
+     * @param code 状态码
+     * @param msg  返回内容
+     * @return 警告消息
+     */
+    public static <T> AjaxResult<T> error(int code, String msg) {
+        return new AjaxResult<>(code, msg, null);
+    }
+}

+ 88 - 0
game-module/game-common/src/main/java/com/zanxiang/game/common/utils/http/HttpStatus.java

@@ -0,0 +1,88 @@
+package com.zanxiang.game.common.utils.http;
+
+/**
+ * 返回状态码
+ *
+ * @author ruoyi
+ */
+public class HttpStatus {
+    /**
+     * 操作成功
+     */
+    public static final int SUCCESS = 200;
+
+    /**
+     * 对象创建成功
+     */
+    public static final int CREATED = 201;
+
+    /**
+     * 请求已经被接受
+     */
+    public static final int ACCEPTED = 202;
+
+    /**
+     * 操作已经执行成功,但是没有返回数据
+     */
+    public static final int NO_CONTENT = 204;
+
+    /**
+     * 资源已被移除
+     */
+    public static final int MOVED_PERM = 301;
+
+    /**
+     * 重定向
+     */
+    public static final int SEE_OTHER = 303;
+
+    /**
+     * 资源没有被修改
+     */
+    public static final int NOT_MODIFIED = 304;
+
+    /**
+     * 参数列表错误(缺少,格式不匹配)
+     */
+    public static final int BAD_REQUEST = 400;
+
+    /**
+     * 未授权
+     */
+    public static final int UNAUTHORIZED = 401;
+
+    /**
+     * 访问受限,授权过期
+     */
+    public static final int FORBIDDEN = 403;
+
+    /**
+     * 资源,服务未找到
+     */
+    public static final int NOT_FOUND = 404;
+
+    /**
+     * 不允许的http方法
+     */
+    public static final int BAD_METHOD = 405;
+
+    /**
+     * 资源冲突,或者资源被锁
+     */
+    public static final int CONFLICT = 409;
+
+    /**
+     * 不支持的数据,媒体类型
+     */
+    public static final int UNSUPPORTED_TYPE = 415;
+
+    /**
+     * 系统内部错误
+     */
+    public static final int ERROR = 500;
+
+    /**
+     * 接口未实现
+     */
+    public static final int NOT_IMPLEMENTED = 501;
+}

+ 36 - 0
game-module/game-manage/src/main/java/com/zanxiang/game/manage/ManageApplication.java

@@ -0,0 +1,36 @@
+package com.zanxiang.game.manage;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-25
+ * @description : 启动类
+ */
+@Slf4j
+@EnableDiscoveryClient
+@SpringBootApplication
+@MapperScan({"com.zanxiang.mybatis.mapper"})
+@EnableDubbo
+@EnableSwagger2
+public class ManageApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(ManageApplication.class, args);
+        System.out.println("赞象Manage服务启动成功opQ ( ´・・)ノ(._.`) \n" +
+                " ______  __     __     \n" +
+                "/_____/\\/__/\\ /__/\\    \n" +
+                "\\:::__\\/\\ \\::\\\\:.\\ \\   \n" +
+                "   /: /  \\_\\::_\\:_\\/   \n" +
+                "  /::/___  _\\/__\\_\\_/\\ \n" +
+                " /_:/____/\\\\ \\ \\ \\::\\ \\\n" +
+                " \\_______\\/ \\_\\/  \\__\\/\n");
+    }
+
+}

+ 13 - 0
game-module/game-manage/src/main/java/com/zanxiang/game/manage/config/MybatisPlusConfig.java

@@ -0,0 +1,13 @@
+package com.zanxiang.game.manage.config;
+
+import com.zanxiang.game.mybatis.config.MybatisConfig;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-22
+ * @description : 数据库分页插件
+ */
+@Configuration
+public class MybatisPlusConfig extends MybatisConfig {
+}

Some files were not shown because too many files changed in this diff