slambb 3 лет назад
Родитель
Сommit
dc494b0e6b
41 измененных файлов с 156 добавлено и 1542 удалено
  1. 0 6
      src/main/java/com/td/Dawa/BossApplication.java
  2. 4 0
      src/main/java/com/td/Dawa/config/enums/GameEnum.java
  3. 2 91
      src/main/java/com/td/Dawa/config/enums/ResultEnum.java
  4. 0 3
      src/main/java/com/td/Dawa/filter/gameFilter.java
  5. 38 6
      src/main/java/com/td/Dawa/game/comcharacters/controller/ComCharactersController.java
  6. 2 0
      src/main/java/com/td/Dawa/game/comloggoldtran/pojo/ComLogGoldTran.java
  7. 6 0
      src/main/java/com/td/Dawa/game/comloggoldtran/repository/ComLogGoldTranRepository.java
  8. 4 1
      src/main/java/com/td/Dawa/game/comloggoldtran/service/ComLogGoldTranService.java
  9. 21 3
      src/main/java/com/td/Dawa/game/comloggoldtran/service/ComLogGoldTranServiceImpl.java
  10. 2 0
      src/main/java/com/td/Dawa/game/comloggoldtran/vo/ComLogGoldTranSimpleVo.java
  11. 3 0
      src/main/java/com/td/Dawa/game/comloggoldtran/vo/ComLogGoldTranVo.java
  12. 8 0
      src/main/java/com/td/Dawa/game/complayerbackpack/controller/ComPlayerBackpackController.java
  13. 0 2
      src/main/java/com/td/Dawa/game/complayersattri/controller/ComPlayersAttriController.java
  14. 5 0
      src/main/java/com/td/Dawa/game/comsetting/controller/ComSettingController.java
  15. 2 7
      src/main/java/com/td/Dawa/game/comusers/controller/ComUsersController.java
  16. 0 8
      src/main/java/com/td/Dawa/game/comusers/pojo/ComUsers.java
  17. 0 3
      src/main/java/com/td/Dawa/game/comusers/service/ComUsersService.java
  18. 31 25
      src/main/java/com/td/Dawa/game/comusers/service/ComUsersServiceImpl.java
  19. 0 8
      src/main/java/com/td/Dawa/game/comusers/vo/ComUsersSimpleVo.java
  20. 0 8
      src/main/java/com/td/Dawa/game/comusers/vo/ComUsersVo.java
  21. 5 1
      src/main/java/com/td/Dawa/sys/sysGame/controller/sysExcelController.java
  22. 0 25
      src/main/java/com/td/Dawa/sys/sysGame/controller/sysGamePropertyController.java
  23. 12 6
      src/main/java/com/td/Dawa/sys/sysGame/controller/sysGameUsersController.java
  24. 0 15
      src/main/java/com/td/Dawa/sys/syssettingtask/controller/SysSettingTaskController.java
  25. 0 27
      src/main/java/com/td/Dawa/sys/syssettingtask/pojo/SysSettingTask.java
  26. 0 9
      src/main/java/com/td/Dawa/sys/syssettingtask/repository/SysSettingTaskRepository.java
  27. 0 8
      src/main/java/com/td/Dawa/sys/syssettingtask/service/SysSettingTaskService.java
  28. 0 35
      src/main/java/com/td/Dawa/sys/syssettingtask/service/SysSettingTaskServiceImpl.java
  29. 0 23
      src/main/java/com/td/Dawa/sys/syssettingtask/vo/SysSettingTaskVo.java
  30. 0 559
      src/main/java/com/td/Dawa/util/CodeDOM.java
  31. 0 123
      src/main/java/com/td/Dawa/util/DoubleUtil.java
  32. 0 16
      src/main/java/com/td/Dawa/util/KeyUtil.java
  33. 0 48
      src/main/java/com/td/Dawa/util/NumUtil.java
  34. 8 100
      src/main/java/com/td/Dawa/util/RedisData.java
  35. 1 30
      src/main/java/com/td/Dawa/util/RedisSettingMap.java
  36. 0 189
      src/main/java/com/td/Dawa/util/RsaUtil.java
  37. 0 59
      src/main/java/com/td/Dawa/util/RunScript.java
  38. 0 30
      src/main/java/com/td/Dawa/util/SysSettingLimitUtil.java
  39. 0 30
      src/main/java/com/td/Dawa/util/SysSettingTaskUtil.java
  40. 0 30
      src/main/java/com/td/Dawa/util/SysSettingUtil.java
  41. 2 8
      src/main/resources/application.yml

+ 0 - 6
src/main/java/com/td/Dawa/BossApplication.java

@@ -171,9 +171,6 @@ class IndexController {
         //系统信息 SysSettingUtil.getSysSetting()
         //系统信息 SysSettingUtil.getSysSetting()
         modelAndView.addObject("sys", redisSettingMap.getSysSettingMap());
         modelAndView.addObject("sys", redisSettingMap.getSysSettingMap());
 
 
-        //系统审查信息 SysSettingTaskUtil.getSysSettingTask()
-        modelAndView.addObject("sysSettingTask", redisSettingMap.getSysSettingTaskMap());
-
         //系统限制信息 SysSettingLimitUtil.getSysSettingLimit()
         //系统限制信息 SysSettingLimitUtil.getSysSettingLimit()
         modelAndView.addObject("sysSettingLimit", redisSettingMap.getSysSettingLimitMap());
         modelAndView.addObject("sysSettingLimit", redisSettingMap.getSysSettingLimitMap());
 
 
@@ -207,9 +204,6 @@ class IndexController {
         //系统信息 SysSettingUtil.getSysSetting()
         //系统信息 SysSettingUtil.getSysSetting()
         modelAndView.addObject("sys", redisSettingMap.getSysSettingMap());
         modelAndView.addObject("sys", redisSettingMap.getSysSettingMap());
 
 
-        //系统审查信息 SysSettingTaskUtil.getSysSettingTask()
-        modelAndView.addObject("sysSettingTask", redisSettingMap.getSysSettingTaskMap());
-
         //系统限制信息 SysSettingLimitUtil.getSysSettingLimit()
         //系统限制信息 SysSettingLimitUtil.getSysSettingLimit()
         modelAndView.addObject("sysSettingLimit", redisSettingMap.getSysSettingLimitMap());
         modelAndView.addObject("sysSettingLimit", redisSettingMap.getSysSettingLimitMap());
 
 

+ 4 - 0
src/main/java/com/td/Dawa/config/enums/GameEnum.java

@@ -14,6 +14,10 @@ import java.util.Map;
 public enum GameEnum {
 public enum GameEnum {
     //Log gold
     //Log gold
     TRAN_GOLD_SUMMON(0,"消费金币:召唤角色时候消耗"),
     TRAN_GOLD_SUMMON(0,"消费金币:召唤角色时候消耗"),
+    //交易状态,默认是0:交易中,1:交易完成,2:交易失败
+    TRAN_STATUS_00(0,"交易状态:交易中"),
+    TRAN_STATUS_01(1,"交易状态:交易完成"),
+    TRAN_STATUS_02(2,"交易状态:交易失败"),
 
 
     //redis key
     //redis key
     REDIS_KEY_EXCEL_WORK_PRO(0,"work_pro"),//工作效率表key
     REDIS_KEY_EXCEL_WORK_PRO(0,"work_pro"),//工作效率表key

+ 2 - 91
src/main/java/com/td/Dawa/config/enums/ResultEnum.java

@@ -30,27 +30,13 @@ public enum ResultEnum {
     LOGIN_IP_IS_ERROR(309,"IP异常?!"),
     LOGIN_IP_IS_ERROR(309,"IP异常?!"),
     //用户数据
     //用户数据
     USER_DOES_NOT_EXIST(400,"不能存在用户信息!"),
     USER_DOES_NOT_EXIST(400,"不能存在用户信息!"),
-    USER_ENERGY_IS_INSUFFICIENT(401,"用户能量不足!"),
     USER_VERIFICATION_ERROR(402,"登录验证失败异常!"),
     USER_VERIFICATION_ERROR(402,"登录验证失败异常!"),
-
     USER_NOT_ADDRESS(403,"用户地址不存在!"),
     USER_NOT_ADDRESS(403,"用户地址不存在!"),
     USER_LIMIT_LOGIN(404,"用户限制登录!"),
     USER_LIMIT_LOGIN(404,"用户限制登录!"),
-
     USER_LOGIN_LOCK(405,"用户保存繁忙,请重试操作!"),
     USER_LOGIN_LOCK(405,"用户保存繁忙,请重试操作!"),
     //角色数据 和 属性
     //角色数据 和 属性
-    PLAYER_DOES_NOT_EXIST(500,"不存在角色信息!"),
     PLAYER_ATTRIBUTE_ERROR(500,"角色属性信息异常!"),
     PLAYER_ATTRIBUTE_ERROR(500,"角色属性信息异常!"),
-    PLAYER_DOES_NOT_ATTRIBUTES(501,"battle player 数据不存在!"),
-    PLAYER_GOODS_LIMIT_ERROR(510,"背包超过预设长度!"),
-    PLAYER_NO_CHEST_INFO(511,"没有对应宝箱类型信息"),
-    PLAYER_NO_EQUIP_TYPE(512,"没有对应装备信息"),
-    PLAYER_GOODS_NO_CHEST(513,"背包没有对应宝箱"),
-    PLAYER_GOODS_NOT_CHEST_TYPE(514,"不是宝箱类型对象"),
-    PLAYER_GOODS_WEAR_NUM_ERROR(515,"请输入对应的参数,isWear:0或者1"),
-    PLAYER_GOODS_NO_QUIP_REQUIRED(516,"不用获取多余装备"),
-    PLAYER_GOODS_SEEDS_AMOUNT_ERROR(517,"土地消耗种子数量不足"),
     PLAYER_ATTRIBUTE_STRENGTH_IS_NOT(518,"当前体力不足,队伍无法工作"),
     PLAYER_ATTRIBUTE_STRENGTH_IS_NOT(518,"当前体力不足,队伍无法工作"),
-    PLAYER_GOODS_SAVE_LOCK(520,"操作繁忙,保存背包失败,稍后再试!"),
     PLAYER_ATTRIBUTE_SAVE_LOCK(520,"属性操作繁满,稍后再试!"),
     PLAYER_ATTRIBUTE_SAVE_LOCK(520,"属性操作繁满,稍后再试!"),
     //背包
     //背包
     PLAYER_BACKPACK_ERROR(510,"背包异常"),
     PLAYER_BACKPACK_ERROR(510,"背包异常"),
@@ -66,6 +52,8 @@ public enum ResultEnum {
     ROLE_NAME_TOO_LONG(522,"角色名字不能大于12个字!"),
     ROLE_NAME_TOO_LONG(522,"角色名字不能大于12个字!"),
     ROLE_ALREADY_ADD(522,"角色已经添加!"),
     ROLE_ALREADY_ADD(522,"角色已经添加!"),
     GOLD_NOT_GET_ROLE(522,"金币不足,无法召唤!"),
     GOLD_NOT_GET_ROLE(522,"金币不足,无法召唤!"),
+    ROLE_NOT_TRAN_STATUS(522,"没有交易记录!"),
+    ROLE_GET_RANDOM(522,"先获取角色!"),
     ROLE_REPATRIATE_ERROR(522,"角色遣返错误!"),
     ROLE_REPATRIATE_ERROR(522,"角色遣返错误!"),
 
 
     EXPLORATION_INFO_ERROR(523 ,"勘探队伍异常!"),
     EXPLORATION_INFO_ERROR(523 ,"勘探队伍异常!"),
@@ -77,84 +65,7 @@ public enum ResultEnum {
     EXPLORATION_COMPLETE(527,"勘探队伍已完成工作!"),
     EXPLORATION_COMPLETE(527,"勘探队伍已完成工作!"),
     EXPLORATION_NOT_STOP(528,"工作时间未结束!"),
     EXPLORATION_NOT_STOP(528,"工作时间未结束!"),
 
 
-
     SCENE_ID_NOT(530,"没有对应场景!"),
     SCENE_ID_NOT(530,"没有对应场景!"),
-    //钱包数据
-    WALLET_CNT_PLAY_ERROR(601,"钱包CNT支付参数数据错误!"),
-    WALLET_SNB_INSUFFICIENT_QUANTITY(602,"snb不足以支付!"),
-    WALLET_SNB_SUCCESS_NOT_ZERO(603,"snb不可操作"),
-    WALLET_SNB_SIGN_ERROR(604,"钱包SNB参数签名错误!"),
-
-    APPLY_SNB_AMOUNT_ERROR(605,"snb参数错误!"),
-    APPLY_SNB_TOO_MUCH(606,"snb申请过多,待审核完成后再申请!"),
-    APPLY_SNB_HAS_APPLY(607,"已有一笔snb申请中,待审核完成后再申请!"),
-    APPLY_SNB_STATE_ERROR(608,"状态信息错误!"),
-
-
-    WALLET_SNB_ABNORMAL(609,"SNB异常状态"),
-    //土地数据
-    LAND_DATA_ERROR(701,"土地数据不能初始化!"),
-    LAND_NOT_LEASE(702,"土地未租赁!"),
-    LAND_IS_LEASE(703,"土地已租赁!"),
-    LAND_IS_PLANT(704,"土地已种植!"),
-    LAND_NOT_PLANT(705,"土地未种植!"),
-    LAND_LEASE_EXPIRED(706,"土地租赁已过期!"),
-    LAND_HARVEST_STOLEN(707,"土地已收成过!"),
-    LAND_STEAL_ALL(708,"土地已无多余收成!"),
-    LAND_STEAL_LOCK(709,"当前偷取人数过多,稍后再试!"),
-    LAND_PLANT_FLAG_IS_NULL(710,"土地标识为空,不能偷取"),
-    LAND_CAN_STEAL_IS_ZERO(711,"没有可收取果实的土地不存在!"),
-    LAND_CAN_STEAL_IS_NULL(712,"没有可收取果实的土地!"),
-
-    LAND_CAN_STEAL_IS_MAX(713,"已无多余利润!"),//达到最大值
-    LAND_USE_TOOL(714,"该土地正在使用工具中!"),
-    LAND_LAND_LEVELUPPING(715,"该土地正在升级中!"),
-
-    //土地受灾中,稍后重试!
-    LAND_DISATER_LOCK(716,"土地正在遭受灾害,稍后重试!"),
-    LAND_MALL_TYPE_ERROR(717,"种植或养殖类型不对!"),
-    LAND_MULTIPLE_ERROR(718,"土地倍数异常!"),
-    LAND_MULTIPLE_CONFIG_ERROR(719,"土地倍数与配置不符!"),
-
-    LAND_CAN_STEAL_SELF(720,"不能偷取自己的土地!"),
-
-    //种子数据不能存在
-    SEED_DATA_ERROR(801,"种子数据不存在!"),
-    FRUIT_DATA_ERROR(802,"果实数据不存在!"),
-    FRUIT_AMOUNT_ERROR(803,"果实数据出错!"),
-    FRUIT_SEND_SELF(804,"不能赠送给自己!"),
-    SEED_DATE_ERROR(805,"未到成熟时间!"),
-    SEED_AMOUNT_ERROR(806,"背包数量不对!"),
-    SEED_PLAY_ERROR(807,"支付价格不对!"),
-    SEED_PLAY_DIAMOND_ERROR(808,"钻石不足以兑换支付!"),
-    SEED_IS_EXCHANGE(809,"种子已经兑换过!"),
-
-    FOOD_DATA_ERROR(810,"食物数据不存在"),
-    FOOD_DOT_NOT(811,"狗粮不足!"),
-
-    SEED_SALE_SAVE_LOCK(810,"操作繁忙,出售失败,稍后再试!"),
-    SEED_NO_LAND_ERROR(812,"种子土地不匹配!"),
-    SEED_LAND_TIME_ERROR(813,"土地租赁时间不足!"),
-
-    LAND_NO_TIMES_ERROR(814,"次数不足,租赁失败!"),
-    FOOD_NO_TYPE_ERROR(815,"粮食和养殖类型不匹配!"),
-    LAND_NO_PLANT_ERROR(816,"土地未养殖,喂养失败!"),
-    FOOD_NO_ERROR(817,"未找到养料!"),
-    FOOD_REPEAT_ERROR(818,"今日已喂养!"),
-    SEED_LAND_WITHERED(819,"果实已枯萎!"),
-    //装备相关
-    MALL_OTHER_IS_NULL(810,"商城装备不存在!"),
-    MALL_OTHER_IS_HAVE(811,"商城装备已经存在!"),
-    PLAYER_OTHER_IS_NULL(812,"商城装备不存在!"),
-    PLAYER_OTHER_IS_HAVE(813,"商城装备已经存在!"),
-    MALL_ID_LIMIT(820,"商城装备不符合购买需求!"),
-    MALL_FOOD_ID_LIMIT(821,"粮食不符合购买需求!"),
-
-    DOG_SHOW_STATE_ERROR(822,"装备狗状态错误!"),
-
-
-    FRUIT_AMOUNT_IS_ZERO_AND_NOT_MULTIPLE(814,"请输入出售果实的数量!"),
-
     //excel 配置信息
     //excel 配置信息
     EXCEL_ERROR(901,"excel 配置错误!"),
     EXCEL_ERROR(901,"excel 配置错误!"),
     ;
     ;

+ 0 - 3
src/main/java/com/td/Dawa/filter/gameFilter.java

@@ -40,9 +40,6 @@ public class gameFilter implements Filter {
     @Autowired
     @Autowired
     private StringRedisTemplate redisTemplate;
     private StringRedisTemplate redisTemplate;
 
 
-    @Autowired
-    private RedisSettingMap redisSettingMap;
-
     @Override
     @Override
     public void init(FilterConfig filterConfig) throws ServletException {
     public void init(FilterConfig filterConfig) throws ServletException {
     }
     }

+ 38 - 6
src/main/java/com/td/Dawa/game/comcharacters/controller/ComCharactersController.java

@@ -16,10 +16,14 @@ import com.td.Dawa.game.comcharacters.vo.ComCharactersClientVo;
 import com.td.Dawa.game.comcharacters.vo.ComCharactersRandomVo;
 import com.td.Dawa.game.comcharacters.vo.ComCharactersRandomVo;
 import com.td.Dawa.game.comcharacters.vo.ComCharactersVo;
 import com.td.Dawa.game.comcharacters.vo.ComCharactersVo;
 import com.td.Dawa.game.comcharacters.service.ComCharactersService;
 import com.td.Dawa.game.comcharacters.service.ComCharactersService;
+import com.td.Dawa.game.comloggoldtran.service.ComLogGoldTranService;
+import com.td.Dawa.game.comloggoldtran.vo.ComLogGoldTranVo;
 import com.td.Dawa.game.comusers.service.ComUsersService;
 import com.td.Dawa.game.comusers.service.ComUsersService;
 import com.td.Dawa.game.excelcharacterattri.service.ExcelCharacterAttriService;
 import com.td.Dawa.game.excelcharacterattri.service.ExcelCharacterAttriService;
 import com.td.Dawa.game.excelcharacterattri.vo.ExcelCharacterAttriVo;
 import com.td.Dawa.game.excelcharacterattri.vo.ExcelCharacterAttriVo;
 import com.td.Dawa.util.CopyUtil;
 import com.td.Dawa.util.CopyUtil;
+import com.td.Dawa.util.RedisData;
+import com.td.Dawa.util.RedisLock;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -39,9 +43,14 @@ public class ComCharactersController extends CommonController<ComCharactersVo, C
     @Autowired
     @Autowired
     private ComUsersService comUsersService;
     private ComUsersService comUsersService;
 
 
+    @Autowired
+    private ComLogGoldTranService comLogGoldTranService;
+
+    @Autowired
+    private RedisLock redisLock;
+
     /**
     /**
      * 返回三个随机的角色数据
      * 返回三个随机的角色数据
-     *
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
@@ -49,16 +58,23 @@ public class ComCharactersController extends CommonController<ComCharactersVo, C
     @Encrypt
     @Encrypt
     public Result<List<ComCharactersRandomVo>> getRole(@RequestParam(value = "userId") String userId) {
     public Result<List<ComCharactersRandomVo>> getRole(@RequestParam(value = "userId") String userId) {
 
 
-        //消耗
+        long time = System.currentTimeMillis() + RedisData.getRoleTimeout();
+        String _redisKey = RedisData.getRoleKey(userId);
         try {
         try {
-            //消耗金币返回一个提示
+            // 防止重复操作
+            if (!redisLock.lock(_redisKey, String.valueOf(time))) {
+                return Result.of(null, false, ResultEnum.REDIS_IS_LOCK);
+            }
+            //消耗金币,记录购买状态
             comUsersService.consumesGoldFromGetRole(userId);
             comUsersService.consumesGoldFromGetRole(userId);
-            //1.excel 随机拿出number 数据, todo 暂时以attri表为主
+            //1.excel 随机拿出number 数据, 以attri表数据为主
             List<ComCharactersRandomVo> excelCharacter =  comCharactersService.randomRoleByNumber(3);
             List<ComCharactersRandomVo> excelCharacter =  comCharactersService.randomRoleByNumber(3);
             //2.返回给前端一个character 数据表里面
             //2.返回给前端一个character 数据表里面
             return Result.of(excelCharacter);
             return Result.of(excelCharacter);
         }catch (AuthorizeException e) {
         }catch (AuthorizeException e) {
             return Result.of(null, false, e.getMessage(), e.getCode());
             return Result.of(null, false, e.getMessage(), e.getCode());
+        } finally {
+            redisLock.unlock(_redisKey, String.valueOf(time));
         }
         }
 
 
 
 
@@ -76,9 +92,19 @@ public class ComCharactersController extends CommonController<ComCharactersVo, C
     public Result<ComCharactersClientVo> addRole(@RequestParam(value = "userId") String userId,
     public Result<ComCharactersClientVo> addRole(@RequestParam(value = "userId") String userId,
                                                  @RequestParam(value = "roleId") Integer roleId) {
                                                  @RequestParam(value = "roleId") Integer roleId) {
 
 
-        //todo  暂时roleType对应这roleId
-        //      暂时可以创建多个相同的角色
+        long time = System.currentTimeMillis() + RedisData.getRoleTimeout();
+        String _redisKey = RedisData.getRoleKey(userId);
         try {
         try {
+            // 防止重复操作
+            if (!redisLock.lock(_redisKey, String.valueOf(time))) {
+                return Result.of(null, false, ResultEnum.REDIS_IS_LOCK);
+            }
+            //判断是否消费过
+            ComLogGoldTranVo comLogGoldTranVo = comLogGoldTranService.findByUserIdAndStatus(userId,GameEnum.TRAN_STATUS_00.getValue());
+            if(comLogGoldTranVo == null)
+            {
+                return Result.of(null, false, ResultEnum.ROLE_GET_RANDOM);
+            }
             //拿出一个角色对应的配置数据来生成角色
             //拿出一个角色对应的配置数据来生成角色
             ExcelCharacterAttriVo excelCharacterAttriVo = excelCharacterAttriService.getVo(roleId);
             ExcelCharacterAttriVo excelCharacterAttriVo = excelCharacterAttriService.getVo(roleId);
             if (excelCharacterAttriVo == null) {
             if (excelCharacterAttriVo == null) {
@@ -86,9 +112,15 @@ public class ComCharactersController extends CommonController<ComCharactersVo, C
             }
             }
             //根据roleId 对应的数据,生成玩家数据,属性
             //根据roleId 对应的数据,生成玩家数据,属性
             ComCharactersClientVo comCharacters = comCharactersService.addRole(excelCharacterAttriVo, userId);
             ComCharactersClientVo comCharacters = comCharactersService.addRole(excelCharacterAttriVo, userId);
+
+            //修改交易记录状态
+            comLogGoldTranVo.setStatus(GameEnum.TRAN_STATUS_01.getValue());
+            comLogGoldTranService.save(comLogGoldTranVo);
             return Result.of(comCharacters);
             return Result.of(comCharacters);
         } catch (Exception e) {
         } catch (Exception e) {
             return Result.of(null, false, ResultEnum.ROLE_ADD_ERROR);
             return Result.of(null, false, ResultEnum.ROLE_ADD_ERROR);
+        } finally {
+            redisLock.unlock(_redisKey, String.valueOf(time));
         }
         }
 
 
     }
     }

+ 2 - 0
src/main/java/com/td/Dawa/game/comloggoldtran/pojo/ComLogGoldTran.java

@@ -34,6 +34,8 @@ public class ComLogGoldTran implements Serializable {
 
 
     private Double afterPart;//
     private Double afterPart;//
 
 
+    private Integer status;//交易状态,默认是0:交易中,1:交易完成,2:交易失败
+
     private Date createTime;//
     private Date createTime;//
 
 
     private Date updateTime;//
     private Date updateTime;//

+ 6 - 0
src/main/java/com/td/Dawa/game/comloggoldtran/repository/ComLogGoldTranRepository.java

@@ -4,6 +4,12 @@ import com.td.Dawa.common.repository.*;
 import com.td.Dawa.game.comloggoldtran.pojo.ComLogGoldTran;
 import com.td.Dawa.game.comloggoldtran.pojo.ComLogGoldTran;
 import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Repository;
 
 
+import java.util.Optional;
+
 @Repository
 @Repository
 public interface ComLogGoldTranRepository extends CommonRepository<ComLogGoldTran, String> {
 public interface ComLogGoldTranRepository extends CommonRepository<ComLogGoldTran, String> {
+
+    //查询当前用户的交易记录
+    Optional<ComLogGoldTran> findByUserIdAndTranTypeAndStatus(String userId, Integer tranType, Integer status);
+
 }
 }

+ 4 - 1
src/main/java/com/td/Dawa/game/comloggoldtran/service/ComLogGoldTranService.java

@@ -3,8 +3,11 @@ package com.td.Dawa.game.comloggoldtran.service;
 import com.td.Dawa.common.service.*;
 import com.td.Dawa.common.service.*;
 import com.td.Dawa.game.comloggoldtran.pojo.ComLogGoldTran;
 import com.td.Dawa.game.comloggoldtran.pojo.ComLogGoldTran;
 import com.td.Dawa.game.comloggoldtran.vo.ComLogGoldTranVo;
 import com.td.Dawa.game.comloggoldtran.vo.ComLogGoldTranVo;
+import com.td.Dawa.game.comusers.vo.ComUsersVo;
 
 
 public interface ComLogGoldTranService extends CommonService<ComLogGoldTranVo, ComLogGoldTran, String> {
 public interface ComLogGoldTranService extends CommonService<ComLogGoldTranVo, ComLogGoldTran, String> {
 
 
-    ComLogGoldTran summonRoleConsumption();
+    ComLogGoldTranVo summonRoleConsumption(ComUsersVo usersVo, Integer consumptionGold);
+
+    ComLogGoldTranVo findByUserIdAndStatus(String userId, Integer status);
 }
 }

+ 21 - 3
src/main/java/com/td/Dawa/game/comloggoldtran/service/ComLogGoldTranServiceImpl.java

@@ -5,6 +5,8 @@ import com.td.Dawa.config.enums.GameEnum;
 import com.td.Dawa.game.comloggoldtran.pojo.ComLogGoldTran;
 import com.td.Dawa.game.comloggoldtran.pojo.ComLogGoldTran;
 import com.td.Dawa.game.comloggoldtran.vo.ComLogGoldTranVo;
 import com.td.Dawa.game.comloggoldtran.vo.ComLogGoldTranVo;
 import com.td.Dawa.game.comloggoldtran.repository.ComLogGoldTranRepository;
 import com.td.Dawa.game.comloggoldtran.repository.ComLogGoldTranRepository;
+import com.td.Dawa.game.comusers.vo.ComUsersVo;
+import com.td.Dawa.util.CopyUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -25,14 +27,30 @@ public class ComLogGoldTranServiceImpl extends CommonServiceImpl<ComLogGoldTranV
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public ComLogGoldTran summonRoleConsumption() {
-
+    public ComLogGoldTranVo summonRoleConsumption(ComUsersVo usersVo, Integer consumptionGold) {
+        Integer _gold = usersVo.getGold() - consumptionGold;
         ComLogGoldTranVo logGoldTranVo = new ComLogGoldTranVo();
         ComLogGoldTranVo logGoldTranVo = new ComLogGoldTranVo();
+        logGoldTranVo.setUserId(usersVo.getUserId());
 
 
         logGoldTranVo.setTranAmount(1d);
         logGoldTranVo.setTranAmount(1d);
+        logGoldTranVo.setTranPrice(consumptionGold);
         logGoldTranVo.setTranType(GameEnum.TRAN_GOLD_SUMMON.getValue());
         logGoldTranVo.setTranType(GameEnum.TRAN_GOLD_SUMMON.getValue());
+        logGoldTranVo.setTranDescribe(GameEnum.TRAN_GOLD_SUMMON.getMessage());
         logGoldTranVo.setIsAdd(0);
         logGoldTranVo.setIsAdd(0);
+
+        logGoldTranVo.setBeforePart(usersVo.getGold().doubleValue());
+        logGoldTranVo.setTranPart(consumptionGold.doubleValue());
+        logGoldTranVo.setAfterPart(_gold.doubleValue());
+        //当前交易状态
+        logGoldTranVo.setStatus(GameEnum.TRAN_STATUS_00.getValue());
         super.save(logGoldTranVo);
         super.save(logGoldTranVo);
-        return null;
+        return logGoldTranVo;
+    }
+
+
+    @Override
+    public ComLogGoldTranVo findByUserIdAndStatus(String userId,Integer status) {
+        ComLogGoldTran comLogGoldTran = comLogGoldTranRepository.findByUserIdAndTranTypeAndStatus(userId,0,status).orElse(null);
+        return comLogGoldTran == null?null: CopyUtil.copy(comLogGoldTran,ComLogGoldTranVo.class);
     }
     }
 }
 }

+ 2 - 0
src/main/java/com/td/Dawa/game/comloggoldtran/vo/ComLogGoldTranSimpleVo.java

@@ -30,6 +30,8 @@ public class ComLogGoldTranSimpleVo implements Serializable {
 
 
     private Double afterPart;//
     private Double afterPart;//
 
 
+    private Integer status;//交易状态,默认是0:交易中,1:交易完成,2:交易失败
+
     private Date createTime;//
     private Date createTime;//
 
 
     private Date updateTime;//
     private Date updateTime;//

+ 3 - 0
src/main/java/com/td/Dawa/game/comloggoldtran/vo/ComLogGoldTranVo.java

@@ -30,6 +30,9 @@ public class ComLogGoldTranVo extends PageCondition implements Serializable {
 
 
     private Double afterPart;//
     private Double afterPart;//
 
 
+    private Integer status;//交易状态,默认是0:交易中,1:交易完成,2:交易失败
+
+
     private Date createTime;//
     private Date createTime;//
 
 
     private Date updateTime;//
     private Date updateTime;//

+ 8 - 0
src/main/java/com/td/Dawa/game/complayerbackpack/controller/ComPlayerBackpackController.java

@@ -24,6 +24,14 @@ public class ComPlayerBackpackController extends CommonController<ComPlayerBackp
     private ComPlayerBackpackService comPlayerBackpackService;
     private ComPlayerBackpackService comPlayerBackpackService;
 
 
 
 
+    /**
+     * 获取背包数据
+     * @param userId
+     * @param tag
+     * @param page
+     * @param pageSize
+     * @return
+     */
     @PostMapping("getByTag")
     @PostMapping("getByTag")
     @Encrypt
     @Encrypt
     public Result<?> getByTag(@RequestParam(value = "userId") String userId,
     public Result<?> getByTag(@RequestParam(value = "userId") String userId,

+ 0 - 2
src/main/java/com/td/Dawa/game/complayersattri/controller/ComPlayersAttriController.java

@@ -31,11 +31,9 @@ public class ComPlayersAttriController extends CommonController<ComPlayersAttriV
     public Result<ComPlayersAttriClientVo> getPlayerAttributeFunction(@RequestParam(value = "userId") String userId) {
     public Result<ComPlayersAttriClientVo> getPlayerAttributeFunction(@RequestParam(value = "userId") String userId) {
         try {
         try {
             //获取数据库相关配置
             //获取数据库相关配置
-            //ComSettingVo comSettingVo = redisSettingMap.getComSettingMap();//comSettingService.get("1").getData();
             //todo 暂时是id=1为体力
             //todo 暂时是id=1为体力
             ExcelParameterVo excelParameterVo = excelParameterService.getVo(1);
             ExcelParameterVo excelParameterVo = excelParameterService.getVo(1);
             if (excelParameterVo.equals(null)) {
             if (excelParameterVo.equals(null)) {
-                //return Result.of(null, false, ResultEnum.SETTING_IS_NULL);
                 throw new AuthorizeException(ResultEnum.SETTING_IS_NULL);
                 throw new AuthorizeException(ResultEnum.SETTING_IS_NULL);
             }
             }
             //获取一下用户属性,新增表
             //获取一下用户属性,新增表

+ 5 - 0
src/main/java/com/td/Dawa/game/comsetting/controller/ComSettingController.java

@@ -78,6 +78,11 @@ public class ComSettingController{
     private ExcelWorkProService excelWorkProService;
     private ExcelWorkProService excelWorkProService;
 
 
 
 
+    /**
+     * 根据配置文件,导入对应的数据库表
+     * @param file
+     * @return
+     */
     @ResponseBody
     @ResponseBody
     @RequestMapping(value = "/excelImport")
     @RequestMapping(value = "/excelImport")
     public Result<?> importExcel(@RequestParam("file") MultipartFile file) {
     public Result<?> importExcel(@RequestParam("file") MultipartFile file) {

+ 2 - 7
src/main/java/com/td/Dawa/game/comusers/controller/ComUsersController.java

@@ -61,7 +61,7 @@ public class ComUsersController extends CommonController<ComUsersVo, ComUsers, S
 
 
     /**
     /**
      * 接口需要token放行
      * 接口需要token放行
-     *
+     * gameFilter进行过滤
      * @return
      * @return
      */
      */
     @PostMapping("RSAConfig")
     @PostMapping("RSAConfig")
@@ -100,8 +100,7 @@ public class ComUsersController extends CommonController<ComUsersVo, ComUsers, S
             }
             }
             String uuid = jsonObject.getStr("uuid"), address = jsonObject.getStr("wallet");
             String uuid = jsonObject.getStr("uuid"), address = jsonObject.getStr("wallet");
             String _redisKey = "SNB_SAVE_" + uuid;
             String _redisKey = "SNB_SAVE_" + uuid;
-            //todo snb冻结加锁
-            long time = System.currentTimeMillis() + RedisData.getSnbTimeout();
+            long time = System.currentTimeMillis() + RedisData.getLoginTimeout();
             //如果校验通过,生成用户数据,生成token
             //如果校验通过,生成用户数据,生成token
             ComUsersVo comUsersVo = comUsersService.findByUserId(uuid);
             ComUsersVo comUsersVo = comUsersService.findByUserId(uuid);
             if (comUsersVo == null) {
             if (comUsersVo == null) {
@@ -109,10 +108,6 @@ public class ComUsersController extends CommonController<ComUsersVo, ComUsers, S
                 comUsersVo = new ComUsersVo();
                 comUsersVo = new ComUsersVo();
                 comUsersVo.setUserId(uuid);
                 comUsersVo.setUserId(uuid);
                 comUsersVo.setGold(0);
                 comUsersVo.setGold(0);
-                comUsersVo.setDiamond(0);
-                comUsersVo.setCnt(0);
-                comUsersVo.setSnb(0);
-                comUsersVo.setSnbPart(0d);
                 comUsersVo.setName(jsonObject.getStr("userName"));
                 comUsersVo.setName(jsonObject.getStr("userName"));
                 comUsersVo.setRealName(jsonObject.getStr("realName"));
                 comUsersVo.setRealName(jsonObject.getStr("realName"));
                 comUsersVo.setEmail(jsonObject.getStr("email"));
                 comUsersVo.setEmail(jsonObject.getStr("email"));

+ 0 - 8
src/main/java/com/td/Dawa/game/comusers/pojo/ComUsers.java

@@ -14,14 +14,6 @@ public class ComUsers implements Serializable {
 
 
     private Integer gold;//游戏本身金币
     private Integer gold;//游戏本身金币
 
 
-    private Integer diamond;//游戏本身钻石
-
-    private Integer cnt;//
-
-    private Integer snb;//
-
-    private Double snbPart;//神农呗小数部分
-
     private String name;//登录名字
     private String name;//登录名字
 
 
     private String realName;//真实名字
     private String realName;//真实名字

+ 0 - 3
src/main/java/com/td/Dawa/game/comusers/service/ComUsersService.java

@@ -16,9 +16,6 @@ public interface ComUsersService extends CommonService<ComUsersVo, ComUsers, Str
 
 
     ComUsersVo findByAddress(String address);
     ComUsersVo findByAddress(String address);
 
 
-
-    ComUsersVo tranSNBByUserId(Double tranSnb,String userId);
-
     /**
     /**
      * 全部注册数量
      * 全部注册数量
      * @return
      * @return

+ 31 - 25
src/main/java/com/td/Dawa/game/comusers/service/ComUsersServiceImpl.java

@@ -1,8 +1,11 @@
 package com.td.Dawa.game.comusers.service;
 package com.td.Dawa.game.comusers.service;
 
 
 import com.td.Dawa.common.service.*;
 import com.td.Dawa.common.service.*;
+import com.td.Dawa.config.enums.GameEnum;
 import com.td.Dawa.config.enums.ResultEnum;
 import com.td.Dawa.config.enums.ResultEnum;
 import com.td.Dawa.config.exception.AuthorizeException;
 import com.td.Dawa.config.exception.AuthorizeException;
+import com.td.Dawa.game.comloggoldtran.service.ComLogGoldTranService;
+import com.td.Dawa.game.comloggoldtran.vo.ComLogGoldTranVo;
 import com.td.Dawa.game.comusers.pojo.ComUsers;
 import com.td.Dawa.game.comusers.pojo.ComUsers;
 import com.td.Dawa.game.comusers.vo.ComUsersVo;
 import com.td.Dawa.game.comusers.vo.ComUsersVo;
 import com.td.Dawa.game.comusers.repository.ComUsersRepository;
 import com.td.Dawa.game.comusers.repository.ComUsersRepository;
@@ -28,6 +31,9 @@ public class ComUsersServiceImpl extends CommonServiceImpl<ComUsersVo, ComUsers,
     @Autowired
     @Autowired
     private ExcelParameterService excelParameterService;
     private ExcelParameterService excelParameterService;
 
 
+    @Autowired
+    private ComLogGoldTranService comLogGoldTranService;
+
     @Override
     @Override
     public ComUsersVo findByUserId(String userId) {
     public ComUsersVo findByUserId(String userId) {
         Optional<ComUsers>  comUsers =  comUsersRepository.findById(userId);
         Optional<ComUsers>  comUsers =  comUsersRepository.findById(userId);
@@ -49,18 +55,6 @@ public class ComUsersServiceImpl extends CommonServiceImpl<ComUsersVo, ComUsers,
         }
         }
     }
     }
 
 
-    /**
-     * 统一交易double snb 操作
-     * @param tranSnb
-     * @param userId
-     * @return
-     */
-    @Override
-    public ComUsersVo tranSNBByUserId(Double tranSnb, String userId) {
-
-        return null;
-    }
-
     @Override
     @Override
     public Long findAllCount() {
     public Long findAllCount() {
         return comUsersRepository.count();
         return comUsersRepository.count();
@@ -72,22 +66,34 @@ public class ComUsersServiceImpl extends CommonServiceImpl<ComUsersVo, ComUsers,
     }
     }
 
 
 
 
+    /**
+     * 判断是否召唤过然后没生成角色。不再重复扣取
+     * 判断是扣取过金币,然后交易未完成的。
+     * @param userId
+     */
     @Override
     @Override
     public void consumesGoldFromGetRole(String userId) {
     public void consumesGoldFromGetRole(String userId) {
-        ExcelParameterVo characterConsumesGold = excelParameterService.getVo(3); //召唤角色时候消耗的金币
-        if (characterConsumesGold == null) {
-            throw new AuthorizeException(ResultEnum.SETTING_IS_NULL);
-        }
-        ComUsersVo attriVo = super.getVo(userId);
-        //todo 改成double
-        Integer _gold = attriVo.getGold() - characterConsumesGold.getValue().intValue();
-        if( _gold <0){
-            //XX不足,无法召唤
-            throw new AuthorizeException(ResultEnum.GOLD_NOT_GET_ROLE);
+
+        //判断是否存在交易中的物品
+        ComLogGoldTranVo comLogGoldTranVo = comLogGoldTranService.findByUserIdAndStatus(userId, GameEnum.TRAN_STATUS_00.getValue());
+        //如果没有记录消费信息,则扣取金币
+        if(comLogGoldTranVo == null){
+            ExcelParameterVo characterConsumesGold = excelParameterService.getVo(3); //召唤角色时候消耗的金币
+            if (characterConsumesGold == null) {
+                throw new AuthorizeException(ResultEnum.SETTING_IS_NULL);
+            }
+            ComUsersVo attriVo = super.getVo(userId);
+            Integer _gold = attriVo.getGold() - characterConsumesGold.getValue().intValue();
+            if( _gold <0){
+                //XX不足,无法召唤
+                throw new AuthorizeException(ResultEnum.GOLD_NOT_GET_ROLE);
+            }
+            //记录消费log
+            comLogGoldTranService.summonRoleConsumption(attriVo,characterConsumesGold.getValue().intValue());
+            //记录当前金币
+            attriVo.setGold(_gold);
+            super.save(attriVo);
         }
         }
-        //记录当前金币
-        attriVo.setGold(_gold);
-        super.save(attriVo);
     }
     }
 
 
 
 

+ 0 - 8
src/main/java/com/td/Dawa/game/comusers/vo/ComUsersSimpleVo.java

@@ -9,14 +9,6 @@ public class ComUsersSimpleVo implements Serializable {
 
 
     private Integer gold;//游戏本身金币
     private Integer gold;//游戏本身金币
 
 
-    private Integer diamond;//游戏本身钻石
-
-    private Integer cnt;//
-
-    private Integer snb;//
-
-    private Double snbPart;//神农呗小数部分
-
     private String name;//登录名字
     private String name;//登录名字
 
 
     private String realName;//真实名字
     private String realName;//真实名字

+ 0 - 8
src/main/java/com/td/Dawa/game/comusers/vo/ComUsersVo.java

@@ -13,14 +13,6 @@ public class ComUsersVo extends PageCondition implements Serializable {
 
 
     private Integer gold;//游戏本身金币
     private Integer gold;//游戏本身金币
 
 
-    private Integer diamond;//游戏本身钻石
-
-    private Integer cnt;//
-
-    private Integer snb;//
-
-    private Double snbPart;//神农呗小数部分
-
     private String name;//登录名字
     private String name;//登录名字
 
 
     private String realName;//真实名字
     private String realName;//真实名字

+ 5 - 1
src/main/java/com/td/Dawa/sys/sysGame/controller/sysExcelController.java

@@ -33,6 +33,11 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.ModelAndView;
 
 
+/**
+ * 参数表操作,修改数据需要刷新缓存
+ * 此controller和后台excel页面操作相关
+ */
+
 @Slf4j
 @Slf4j
 @RestController
 @RestController
 @RequestMapping("/sys/sysExcel/")
 @RequestMapping("/sys/sysExcel/")
@@ -65,7 +70,6 @@ public class sysExcelController extends CommonController<ComUsersVo, ComUsers, S
     @Autowired
     @Autowired
     private ExcelCharacterAttriService excelCharacterAttriService;
     private ExcelCharacterAttriService excelCharacterAttriService;
 
 
-    //参数表操作,修改数据需要刷新缓存
     @GetMapping("excelWorkPro")
     @GetMapping("excelWorkPro")
     public ModelAndView excelWorkPro() {
     public ModelAndView excelWorkPro() {
         return new ModelAndView("sys/aComConfig/excelWorkPro");
         return new ModelAndView("sys/aComConfig/excelWorkPro");

+ 0 - 25
src/main/java/com/td/Dawa/sys/sysGame/controller/sysGamePropertyController.java

@@ -1,25 +0,0 @@
-package com.td.Dawa.sys.sysGame.controller;
-
-import com.td.Dawa.common.controller.CommonController;
-
-import com.td.Dawa.game.comusers.pojo.ComUsers;
-import com.td.Dawa.game.comusers.vo.ComUsersVo;
-import com.td.Dawa.util.RedisSettingMap;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import java.util.*;
-
-@Slf4j
-@RestController
-@RequestMapping("/sys/sysProperty/")
-public class sysGamePropertyController extends CommonController<ComUsersVo, ComUsers, String> {
-
-    @Autowired
-    private RedisSettingMap redisSettingMap;
-
-
-
-}

+ 12 - 6
src/main/java/com/td/Dawa/sys/sysGame/controller/sysGameUsersController.java

@@ -74,6 +74,10 @@ public class sysGameUsersController extends CommonController<ComUsersVo, ComUser
     @Value("${spring.profiles.active}")
     @Value("${spring.profiles.active}")
     private String active;
     private String active;
 
 
+    /**
+     * 后台用户页面相关
+     * @return
+     */
     @GetMapping("user")
     @GetMapping("user")
     public ModelAndView user() {
     public ModelAndView user() {
         return new ModelAndView("sys/aComUser/user");
         return new ModelAndView("sys/aComUser/user");
@@ -98,8 +102,10 @@ public class sysGameUsersController extends CommonController<ComUsersVo, ComUser
         return Result.of(pageInfo);
         return Result.of(pageInfo);
     }
     }
 
 
-
-    //属性表
+    /**
+     * 后台属性表页面相关
+     * @return
+     */
     @GetMapping("userAttribute")
     @GetMapping("userAttribute")
     public ModelAndView userAttribute() {
     public ModelAndView userAttribute() {
         return new ModelAndView("sys/aComUser/userAttri");
         return new ModelAndView("sys/aComUser/userAttri");
@@ -143,9 +149,6 @@ public class sysGameUsersController extends CommonController<ComUsersVo, ComUser
         return result;
         return result;
     }
     }
 
 
-
-    //瓦达接口相关
-
     /**
     /**
      * 根据地址获取用户信息
      * 根据地址获取用户信息
      *
      *
@@ -265,7 +268,10 @@ public class sysGameUsersController extends CommonController<ComUsersVo, ComUser
     }
     }
 
 
 
 
-    //用户管理
+    /**
+     * 后台用户管理页面相关
+     * @return
+     */
     @GetMapping("userCharacters")
     @GetMapping("userCharacters")
     public ModelAndView userCharacters() {
     public ModelAndView userCharacters() {
         List<ExcelCharacterAttri> excelCharacterAttris = excelCharacterAttriService.getListFromCache(GameEnum.REDIS_KEY_EXCEL_CHARACTER_ATTRI.getMessage());
         List<ExcelCharacterAttri> excelCharacterAttris = excelCharacterAttriService.getListFromCache(GameEnum.REDIS_KEY_EXCEL_CHARACTER_ATTRI.getMessage());

+ 0 - 15
src/main/java/com/td/Dawa/sys/syssettingtask/controller/SysSettingTaskController.java

@@ -1,15 +0,0 @@
-package com.td.Dawa.sys.syssettingtask.controller;
-
-import com.td.Dawa.common.controller.*;
-import com.td.Dawa.sys.syssettingtask.pojo.SysSettingTask;
-import com.td.Dawa.sys.syssettingtask.vo.SysSettingTaskVo;
-import com.td.Dawa.sys.syssettingtask.service.SysSettingTaskService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-@RestController
-@RequestMapping("/sys/sysSettingTask/")
-public class SysSettingTaskController extends CommonController<SysSettingTaskVo, SysSettingTask, String> {
-    @Autowired
-    private SysSettingTaskService sysSettingTaskService;
-}

+ 0 - 27
src/main/java/com/td/Dawa/sys/syssettingtask/pojo/SysSettingTask.java

@@ -1,27 +0,0 @@
-package com.td.Dawa.sys.syssettingtask.pojo;
-
-import lombok.Data;
-import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
-
-@Entity
-@Table(name = "sys_setting_task")
-@Data
-public class SysSettingTask implements Serializable {
-    @Id
-    private String id;//表id
-
-    private String applyAutoExamine;//是否自动审查 Y/N
-
-    private Integer conditionSnbMax;//自动过审时候限制snb条件,最大值
-
-    private Integer conditionSnbMin;//自动过审时候限制snb条件,最小值
-
-    private Integer applyCount;//当天的提现次数
-
-    private Date createTime;//创建时间
-
-    private Date updateTime;//修改时间
-
-}

+ 0 - 9
src/main/java/com/td/Dawa/sys/syssettingtask/repository/SysSettingTaskRepository.java

@@ -1,9 +0,0 @@
-package com.td.Dawa.sys.syssettingtask.repository;
-
-import com.td.Dawa.common.repository.*;
-import com.td.Dawa.sys.syssettingtask.pojo.SysSettingTask;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface SysSettingTaskRepository extends CommonRepository<SysSettingTask, String> {
-}

+ 0 - 8
src/main/java/com/td/Dawa/sys/syssettingtask/service/SysSettingTaskService.java

@@ -1,8 +0,0 @@
-package com.td.Dawa.sys.syssettingtask.service;
-
-import com.td.Dawa.common.service.*;
-import com.td.Dawa.sys.syssettingtask.pojo.SysSettingTask;
-import com.td.Dawa.sys.syssettingtask.vo.SysSettingTaskVo;
-
-public interface SysSettingTaskService extends CommonService<SysSettingTaskVo, SysSettingTask, String> {
-}

+ 0 - 35
src/main/java/com/td/Dawa/sys/syssettingtask/service/SysSettingTaskServiceImpl.java

@@ -1,35 +0,0 @@
-package com.td.Dawa.sys.syssettingtask.service;
-
-import com.td.Dawa.common.pojo.Result;
-import com.td.Dawa.common.service.*;
-import com.td.Dawa.sys.syssettingtask.pojo.SysSettingTask;
-import com.td.Dawa.sys.syssettingtask.vo.SysSettingTaskVo;
-import com.td.Dawa.sys.syssettingtask.repository.SysSettingTaskRepository;
-import com.td.Dawa.util.RedisSettingMap;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-@Service
-@Transactional
-public class SysSettingTaskServiceImpl extends CommonServiceImpl<SysSettingTaskVo, SysSettingTask, String> implements SysSettingTaskService{
-
-    @PersistenceContext
-    private EntityManager em;
-    @Autowired
-    private SysSettingTaskRepository sysSettingTaskRepository;
-    @Autowired
-    private RedisSettingMap redisSettingMap;
-    @Override
-    public Result<SysSettingTaskVo> save(SysSettingTaskVo entityVo) {
-        //调用父类
-        Result<SysSettingTaskVo> result = super.save(entityVo);
-
-        //更新系统设置时同步更新公用静态集合sysSettingTaskMap
-        // SysSettingTaskUtil.setSysSettingTaskMap(result.getData());
-        redisSettingMap.setSysSettingTaskMap(result.getData());
-        return result;
-    }
-}

+ 0 - 23
src/main/java/com/td/Dawa/sys/syssettingtask/vo/SysSettingTaskVo.java

@@ -1,23 +0,0 @@
-package com.td.Dawa.sys.syssettingtask.vo;
-
-import com.td.Dawa. common.pojo.PageCondition;import lombok.Data;
-import java.io.Serializable;
-import java.util.Date;
-
-@Data
-public class SysSettingTaskVo extends PageCondition implements Serializable {
-    private String id;//表id
-
-    private String applyAutoExamine;//是否自动审查 Y/N
-
-    private Integer conditionSnbMax;//自动过审时候限制snb条件,最大值
-
-    private Integer conditionSnbMin;//自动过审时候限制snb条件,最小值
-
-    private Integer applyCount;//当天的提现次数
-
-    private Date createTime;//创建时间
-
-    private Date updateTime;//修改时间
-
-}

+ 0 - 559
src/main/java/com/td/Dawa/util/CodeDOM.java

@@ -1,559 +0,0 @@
-package com.td.Dawa.util;
-
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 自动生成代码
- */
-@Slf4j
-public class CodeDOM {
-
-    /**
-     * 构造参数,出入表名
-     */
-    private CodeDOM(String tableName) {
-        this.tableName = tableName;
-        basePackage_ = "com\\td\\Dawa\\game\\";
-        package_ = basePackage_ + StringUtil.camelCaseName(tableName).toLowerCase() + "\\";
-        //System.getProperty("user.dir") 获取的是项目所在路径,如果我们是子项目,则需要添加一层路径
-        basePath = System.getProperty("user.dir") + "\\src\\main\\java\\" + package_;
-        basePackage_ = "com\\td\\Dawa\\";
-    }
-
-    /**
-     * 数据连接相关
-     */
-    private static final String URL = "jdbc:mysql://42.192.165.168:3306/wada?serverTimezone=GMT%2B8&characterEncoding=utf-8";
-    private static final String USERNAME = "root";
-    private static final String PASSWORD = "9ab8fad748dead93";
-    private static final String DRIVER_CLASSNAME = "com.mysql.jdbc.Driver";
-    /**
-     * 表名
-     */
-    private String tableName;
-
-    /**
-     * 基础路径
-     */
-    private String basePackage_;
-    private String package_;
-    private String basePath;
-
-    /**
-     * 创建pojo实体类
-     */
-    private void createPojo(List<TableInfo> tableInfos) {
-        File file = FileUtil.createFile(basePath + "pojo\\" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ".java");
-        StringBuffer stringBuffer = new StringBuffer();
-        stringBuffer.append(
-                "package " + package_.replaceAll("\\\\", ".") + "pojo;\n" +
-                        "\n" +
-                        "import lombok.Data;\n" +
-                        "import javax.persistence.*;\n" +
-                        "import java.io.Serializable;\n" +
-                        "import java.util.Date;\n" +
-                        "\n" +
-                        "@Entity\n" +
-                        "@Table(name = \"" + tableName + "\")\n" +
-                        "@Data\n" +
-                        "public class " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + " implements Serializable {\n"
-        );
-        //遍历设置属性
-        for (TableInfo tableInfo : tableInfos) {
-            //主键
-            if ("PRI".equals(tableInfo.getColumnKey())) {
-                stringBuffer.append("    @Id\n");
-            }
-            //自增
-            if ("auto_increment".equals(tableInfo.getExtra())) {
-                stringBuffer.append("    @GeneratedValue(strategy= GenerationType.IDENTITY)\n");
-            }
-            stringBuffer.append("    private " + StringUtil.typeMapping(tableInfo.getDataType()) + " " + StringUtil.camelCaseName(tableInfo.getColumnName()) + ";//" + tableInfo.getColumnComment() + "\n\n");
-        }
-        stringBuffer.append("}");
-        FileUtil.fileWriter(file, stringBuffer);
-    }
-
-    /**
-     * 创建vo类
-     */
-    private void createVo(List<TableInfo> tableInfos) {
-        File file = FileUtil.createFile(basePath + "vo\\" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Vo.java");
-        StringBuffer stringBuffer = new StringBuffer();
-        stringBuffer.append(
-                "package " + package_.replaceAll("\\\\", ".") + "vo;\n" +
-                        "\n" +
-                        "import "+ basePackage_.replaceAll("\\\\", ".") +" common.pojo.PageCondition;"+
-                        "import lombok.Data;\n" +
-                        "import java.io.Serializable;\n" +
-                        "import java.util.Date;\n" +
-                        "\n" +
-                        "@Data\n" +
-                        "public class " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Vo extends PageCondition implements Serializable {\n"
-        );
-        //遍历设置属性
-        for (TableInfo tableInfo : tableInfos) {
-            stringBuffer.append("    private " + StringUtil.typeMapping(tableInfo.getDataType()) + " " + StringUtil.camelCaseName(tableInfo.getColumnName()) + ";//" + tableInfo.getColumnComment() + "\n\n");
-        }
-        stringBuffer.append("}");
-        FileUtil.fileWriter(file, stringBuffer);
-
-
-
-        File fileSimple = FileUtil.createFile(basePath + "vo\\" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "SimpleVo.java");
-        StringBuffer stringBufferSimple = new StringBuffer();
-        stringBufferSimple.append(
-                "package " + package_.replaceAll("\\\\", ".") + "vo;\n" +
-                        "\n" +
-                        "import lombok.Data;\n" +
-                        "import java.io.Serializable;\n" +
-                        "import java.util.Date;\n" +
-                        "\n" +
-                        "@Data\n" +
-                        "public class " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "SimpleVo implements Serializable {\n"
-        );
-        //遍历设置属性
-        for (TableInfo tableInfo : tableInfos) {
-            stringBufferSimple.append("    private " + StringUtil.typeMapping(tableInfo.getDataType()) + " " + StringUtil.camelCaseName(tableInfo.getColumnName()) + ";//" + tableInfo.getColumnComment() + "\n\n");
-        }
-        stringBufferSimple.append("}");
-        FileUtil.fileWriter(fileSimple, stringBufferSimple);
-    }
-
-    /**
-     * 创建repository类
-     */
-    private void createRepository(List<TableInfo> tableInfos) {
-        File file = FileUtil.createFile(basePath + "repository\\" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Repository.java");
-        StringBuffer stringBuffer = new StringBuffer();
-        String t = "String";
-        //遍历属性
-        for (TableInfo tableInfo : tableInfos) {
-            //主键
-            if ("PRI".equals(tableInfo.getColumnKey())) {
-                t = StringUtil.typeMapping(tableInfo.getDataType());
-            }
-        }
-        stringBuffer.append(
-                "package " + package_.replaceAll("\\\\", ".") + "repository;\n" +
-                        "\n" +
-                        "import " + basePackage_.replaceAll("\\\\", ".") + "common.repository.*;\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "pojo." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ";\n" +
-                        "import org.springframework.stereotype.Repository;\n" +
-                        "\n" +
-                        "@Repository\n" +
-                        "public interface " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Repository extends CommonRepository<" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ", " + t + "> {"
-        );
-        stringBuffer.append("\n");
-        stringBuffer.append("}");
-        FileUtil.fileWriter(file, stringBuffer);
-    }
-
-    /**
-     * 创建service类
-     */
-    private void createService(List<TableInfo> tableInfos) {
-        File file = FileUtil.createFile(basePath + "service\\" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Service.java");
-        StringBuffer stringBuffer = new StringBuffer();
-        String t = "String";
-        //遍历属性
-        for (TableInfo tableInfo : tableInfos) {
-            //主键
-            if ("PRI".equals(tableInfo.getColumnKey())) {
-                t = StringUtil.typeMapping(tableInfo.getDataType());
-            }
-        }
-        stringBuffer.append(
-                "package " + package_.replaceAll("\\\\", ".") + "service;\n" +
-                        "\n" +
-                        "import " + basePackage_.replaceAll("\\\\", ".") + "common.service.*;\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "pojo." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ";\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "vo." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Vo;\n" +
-                        "\n" +
-                        "public interface " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Service extends CommonService<" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Vo, " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ", " + t + "> {"
-        );
-        stringBuffer.append("\n");
-        stringBuffer.append("}");
-        FileUtil.fileWriter(file, stringBuffer);
-
-        //Impl
-        File file1 = FileUtil.createFile(basePath + "service\\" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "ServiceImpl.java");
-        StringBuffer stringBuffer1 = new StringBuffer();
-        stringBuffer1.append(
-                "package " + package_.replaceAll("\\\\", ".") + "service;\n" +
-                        "\n" +
-                        "import " + basePackage_.replaceAll("\\\\", ".") + "common.service.*;\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "pojo." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ";\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "vo." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Vo;\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "repository." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Repository;\n" +
-                        "import org.springframework.beans.factory.annotation.Autowired;\n" +
-                        "import org.springframework.stereotype.Service;\n" +
-                        "import org.springframework.transaction.annotation.Transactional;\n" +
-                        "import javax.persistence.EntityManager;\n" +
-                        "import javax.persistence.PersistenceContext;\n" +
-                        "\n" +
-                        "@Service\n" +
-                        "@Transactional\n" +
-                        "public class " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "ServiceImpl extends CommonServiceImpl<" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Vo, " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ", " + t + "> implements " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Service{"
-        );
-        stringBuffer1.append("\n\n");
-        stringBuffer1.append(
-                "    @PersistenceContext\n" +
-                        "    private EntityManager em;\n");
-
-        stringBuffer1.append("" +
-                "    @Autowired\n" +
-                "    private " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Repository " + StringUtil.camelCaseName(tableName) + "Repository;\n");
-        stringBuffer1.append("}");
-        FileUtil.fileWriter(file1, stringBuffer1);
-    }
-
-    /**
-     * 创建controller类
-     */
-    private void createController(List<TableInfo> tableInfos) {
-        File file = FileUtil.createFile(basePath + "controller\\" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Controller.java");
-        StringBuffer stringBuffer = new StringBuffer();
-        String t = "String";
-        //遍历属性
-        for (TableInfo tableInfo : tableInfos) {
-            //主键
-            if ("PRI".equals(tableInfo.getColumnKey())) {
-                t = StringUtil.typeMapping(tableInfo.getDataType());
-            }
-        }
-        stringBuffer.append(
-                "package " + package_.replaceAll("\\\\", ".") + "controller;\n" +
-                        "\n" +
-                        "import " + basePackage_.replaceAll("\\\\", ".") + "common.controller.*;\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "pojo." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ";\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "vo." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Vo;\n" +
-                        "import " + package_.replaceAll("\\\\", ".") + "service." + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Service;\n" +
-                        "import org.springframework.beans.factory.annotation.Autowired;\n" +
-                        "import org.springframework.web.bind.annotation.*;\n" +
-                        "\n" +
-                        "@RestController\n" +
-                        "@RequestMapping(\"/game/" + StringUtil.camelCaseName(tableName) + "/\")\n" +
-                        "public class " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Controller extends CommonController<" + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Vo, " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + ", " + t + "> {"
-        );
-        stringBuffer.append("\n");
-        stringBuffer.append("" +
-                "    @Autowired\n" +
-                "    private " + StringUtil.captureName(StringUtil.camelCaseName(tableName)) + "Service " + StringUtil.camelCaseName(tableName) + "Service;\n");
-        stringBuffer.append("}");
-        FileUtil.fileWriter(file, stringBuffer);
-    }
-
-    /**
-     * 获取表结构信息
-     */
-    private List<TableInfo> getTableInfo() {
-        Connection conn = null;
-        PreparedStatement ps = null;
-        ResultSet rs = null;
-        ArrayList<TableInfo> list = new ArrayList<>();
-        try {
-            conn = DBConnectionUtil.getConnection();
-            String sql = "select column_name,data_type,column_comment,column_key,extra from information_schema.columns where table_schema = (select database()) and table_name=?";
-            ps = conn.prepareStatement(sql);
-            ps.setString(1, tableName);
-            rs = ps.executeQuery();
-            while (rs.next()) {
-                TableInfo tableInfo = new TableInfo();
-                //列名,全部转为小写
-                tableInfo.setColumnName(rs.getString("column_name").toLowerCase());
-                //列类型
-                tableInfo.setDataType(rs.getString("data_type"));
-                //列注释
-                tableInfo.setColumnComment(rs.getString("column_comment"));
-                //主键
-                tableInfo.setColumnKey(rs.getString("column_key"));
-                //主键类型
-                tableInfo.setExtra(rs.getString("extra"));
-                list.add(tableInfo);
-            }
-        } catch (SQLException e) {
-            //输出到日志文件中
-            log.error(ErrorUtil.errorInfoToString(e));
-        } finally {
-            assert rs != null;
-            DBConnectionUtil.close(conn, ps, rs);
-        }
-        return list;
-    }
-
-    /**
-     * file工具类
-     */
-    private static class FileUtil {
-        /**
-         * 创建文件
-         *
-         * @param pathNameAndFileName 路径跟文件名
-         * @return File对象
-         */
-        private static File createFile(String pathNameAndFileName) {
-            File file = new File(pathNameAndFileName);
-            try {
-                //获取父目录
-                File fileParent = file.getParentFile();
-                if (!fileParent.exists()) {
-                    fileParent.mkdirs();
-                }
-                //创建文件
-                if (!file.exists()) {
-                    file.createNewFile();
-                }
-            } catch (Exception e) {
-                file = null;
-                System.err.println("新建文件操作出错");
-                //输出到日志文件中
-                log.error(ErrorUtil.errorInfoToString(e));
-            }
-            return file;
-        }
-
-        /**
-         * 字符流写入文件
-         *
-         * @param file         file对象
-         * @param stringBuffer 要写入的数据
-         */
-        private static void fileWriter(File file, StringBuffer stringBuffer) {
-            //字符流
-            try {
-                FileWriter resultFile = new FileWriter(file, false);//true,则追加写入 false,则覆盖写入
-                PrintWriter myFile = new PrintWriter(resultFile);
-                //写入
-                myFile.println(stringBuffer.toString());
-
-                myFile.close();
-                resultFile.close();
-            } catch (Exception e) {
-                System.err.println("写入操作出错");
-                //输出到日志文件中
-                log.error(ErrorUtil.errorInfoToString(e));
-            }
-        }
-    }
-
-    /**
-     * 字符串处理工具类
-     */
-    private static class StringUtil {
-        /**
-         * 数据库类型->JAVA类型
-         *
-         * @param dbType 数据库类型
-         * @return JAVA类型
-         */
-        private static String typeMapping(String dbType) {
-            String javaType;
-            if ("int|integer".contains(dbType)) {
-                javaType = "Integer";
-            } else if ("float|double|decimal|real".contains(dbType)) {
-                javaType = "Double";
-            } else if ("date|time|datetime|timestamp".contains(dbType)) {
-                javaType = "Date";
-            } else {
-                javaType = "String";
-            }
-            return javaType;
-        }
-
-        /**
-         * 驼峰转换为下划线
-         */
-        public static String underscoreName(String camelCaseName) {
-            StringBuilder result = new StringBuilder();
-            if (camelCaseName != null && camelCaseName.length() > 0) {
-                result.append(camelCaseName.substring(0, 1).toLowerCase());
-                for (int i = 1; i < camelCaseName.length(); i++) {
-                    char ch = camelCaseName.charAt(i);
-                    if (Character.isUpperCase(ch)) {
-                        result.append("_");
-                        result.append(Character.toLowerCase(ch));
-                    } else {
-                        result.append(ch);
-                    }
-                }
-            }
-            return result.toString();
-        }
-
-        /**
-         * 首字母大写
-         */
-        static String captureName(String name) {
-            char[] cs = name.toCharArray();
-            cs[0] -= 32;
-            return String.valueOf(cs);
-
-        }
-
-        /**
-         * 下划线转换为驼峰
-         */
-        static String camelCaseName(String underscoreName) {
-            StringBuilder result = new StringBuilder();
-            if (underscoreName != null && underscoreName.length() > 0) {
-                boolean flag = false;
-                for (int i = 0; i < underscoreName.length(); i++) {
-                    char ch = underscoreName.charAt(i);
-                    if ("_".charAt(0) == ch) {
-                        flag = true;
-                    } else {
-                        if (flag) {
-                            result.append(Character.toUpperCase(ch));
-                            flag = false;
-                        } else {
-                            result.append(ch);
-                        }
-                    }
-                }
-            }
-            return result.toString();
-        }
-    }
-
-    /**
-     * JDBC连接数据库工具类
-     */
-    private static class DBConnectionUtil {
-
-        static {
-            // 1、加载驱动
-            try {
-                Class.forName(DRIVER_CLASSNAME);
-            } catch (ClassNotFoundException e) {
-                //输出到日志文件中
-                log.error(ErrorUtil.errorInfoToString(e));
-            }
-        }
-
-        /**
-         * 返回一个Connection连接
-         */
-        static Connection getConnection() {
-            Connection conn = null;
-            // 2、连接数据库
-            try {
-                conn = DriverManager.getConnection(URL, USERNAME, PASSWORD);
-            } catch (SQLException e) {
-                //输出到日志文件中
-                log.error(ErrorUtil.errorInfoToString(e));
-            }
-            return conn;
-        }
-
-        /**
-         * 关闭Connection,Statement连接
-         */
-        public static void close(Connection conn, Statement stmt) {
-            try {
-                conn.close();
-                stmt.close();
-            } catch (SQLException e) {
-                //输出到日志文件中
-                log.error(ErrorUtil.errorInfoToString(e));
-            }
-        }
-
-        /**
-         * 关闭Connection,Statement,ResultSet连接
-         */
-        public static void close(Connection conn, Statement stmt, ResultSet rs) {
-            try {
-                close(conn, stmt);
-                rs.close();
-            } catch (SQLException e) {
-                //输出到日志文件中
-                log.error(ErrorUtil.errorInfoToString(e));
-            }
-        }
-
-    }
-
-    /**
-     * 表结构行信息实体类
-     */
-    private class TableInfo {
-        private String columnName;
-        private String dataType;
-        private String columnComment;
-        private String columnKey;
-        private String extra;
-
-        TableInfo() {
-        }
-
-        String getColumnName() {
-            return columnName;
-        }
-
-        void setColumnName(String columnName) {
-            this.columnName = columnName;
-        }
-
-        String getDataType() {
-            return dataType;
-        }
-
-        void setDataType(String dataType) {
-            this.dataType = dataType;
-        }
-
-        String getColumnComment() {
-            return columnComment;
-        }
-
-        void setColumnComment(String columnComment) {
-            this.columnComment = columnComment;
-        }
-
-        String getColumnKey() {
-            return columnKey;
-        }
-
-        void setColumnKey(String columnKey) {
-            this.columnKey = columnKey;
-        }
-
-        String getExtra() {
-            return extra;
-        }
-
-        void setExtra(String extra) {
-            this.extra = extra;
-        }
-    }
-
-    /**
-     * 快速创建,供外部调用,调用之前先设置一下项目的基础路径
-     */
-    private String create() {
-        List<TableInfo> tableInfo = getTableInfo();
-        createPojo(tableInfo);
-        createVo(tableInfo);
-        createRepository(tableInfo);
-        createService(tableInfo);
-        createController(tableInfo);
-        System.out.println("生成路径位置:" + basePath);
-        return tableName + " 后台代码生成完毕!";
-    }
-
-    public static void main(String[] args) {
-        String[] tables = {""};
-        for (String table : tables) {
-            String msg = new CodeDOM(table).create();
-            System.out.println(msg);
-        }
-    }
-}

+ 0 - 123
src/main/java/com/td/Dawa/util/DoubleUtil.java

@@ -1,123 +0,0 @@
-package com.td.Dawa.util;
-
-/**
- * @author:slambb
- * @date:2022/2/18
- */
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-
-/**
- * double的计算不精确,会有类似0.0000000000000002的误差,正确的方法是使用BigDecimal或者用整型
- * 整型地方法适合于货币精度已知的情况,比如12.11+1.10转成1211+110计算,最后再/100即可
- * 以下是摘抄的BigDecimal方法:
- */
-public class DoubleUtil implements Serializable {
-    private static final long serialVersionUID = -3345205828566485102L;
-    // 默认除法运算精度
-    private static final Integer DEF_DIV_SCALE = 2;
-    /**
-     * 提供精确的加法运算。
-     *
-     * @param value1 被加数
-     * @param value2 加数
-     * @return 两个参数的和
-     */
-    public static Double add(Double value1, Double value2) {
-        BigDecimal b1 = new BigDecimal(Double.toString(value1));
-        BigDecimal b2 = new BigDecimal(Double.toString(value2));
-        return b1.add(b2).doubleValue();
-    }
-    /**
-     * 提供精确的减法运算。
-     *
-     * @param value1 被减数
-     * @param value2 减数
-     * @return 两个参数的差
-     */
-    public static double sub(Double value1, Double value2) {
-        BigDecimal b1 = new BigDecimal(Double.toString(value1));
-        BigDecimal b2 = new BigDecimal(Double.toString(value2));
-        return b1.subtract(b2).doubleValue();
-    }
-    /**
-     * 提供精确的乘法运算。
-     *
-     * @param value1 被乘数
-     * @param value2 乘数
-     * @return 两个参数的积
-     */
-    public static Double mul(Double value1, Double value2) {
-        BigDecimal b1 = new BigDecimal(Double.toString(value1));
-        BigDecimal b2 = new BigDecimal(Double.toString(value2));
-        return b1.multiply(b2).doubleValue();
-    }
-    /**
-     * 提供(相对)精确的除法运算,当发生除不尽的情况时, 精确到小数点以后10位,以后的数字四舍五入。
-     *
-     * @param dividend 被除数
-     * @param divisor 除数
-     * @return 两个参数的商
-     */
-    public static Double divide(Double dividend, Double divisor) {
-        return divide(dividend, divisor, DEF_DIV_SCALE);
-    }
-    /**
-     * 提供(相对)精确的除法运算。 当发生除不尽的情况时,由scale参数指定精度,以后的数字四舍五入。
-     *
-     * @param dividend 被除数
-     * @param divisor 除数
-     * @param scale  表示表示需要精确到小数点以后几位。
-     * @return 两个参数的商
-     */
-    public static Double divide(Double dividend, Double divisor, Integer scale) {
-        if (scale < 0) {
-            throw new IllegalArgumentException("The scale must be a positive integer or zero");
-        }
-        BigDecimal b1 = new BigDecimal(Double.toString(dividend));
-        BigDecimal b2 = new BigDecimal(Double.toString(divisor));
-        return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue();
-    }
-    /**
-     * 提供指定数值的(精确)小数位四舍五入处理。
-     *
-     * @param value 需要四舍五入的数字
-     * @param scale 小数点后保留几位
-     * @return 四舍五入后的结果
-     */
-    public static double round(double value,int scale){
-        if(scale<0){
-            throw new IllegalArgumentException("The scale must be a positive integer or zero");
-        }
-        BigDecimal b = new BigDecimal(Double.toString(value));
-        BigDecimal one = new BigDecimal("1");
-        return b.divide(one,scale, RoundingMode.HALF_UP).doubleValue();
-    }
-
-
-    /**
-     * 提供精确的判断大小。
-     *
-     * @param value1
-     * @param value2
-     * @return 两个参数比较大小
-     */
-    public static Integer compare(Double value1, Double value2) {
-        BigDecimal b1 = new BigDecimal(Double.toString(value1));
-        BigDecimal b2 = new BigDecimal(Double.toString(value2));
-
-        Integer result = 0;
-        if (b1.compareTo(b2) == 0) {
-            result = 0;
-        }else if (b1.compareTo(b2) < 0){
-            result = -1;
-        }else if (b1.compareTo(b2) > 0) {
-            result = 1;
-        }else{
-            throw new IllegalArgumentException("The compare is error!");
-        }
-        return result;
-    }
-}

+ 0 - 16
src/main/java/com/td/Dawa/util/KeyUtil.java

@@ -1,16 +0,0 @@
-package com.td.Dawa.util;
-
-import java.util.Random;
-
-/**
- * @author:slambb
- * @date:2019/12/6
- */
-public class KeyUtil {
-
-    public static  synchronized  String genUniqueKey(){
-        Random random = new Random();
-        Integer number = random.nextInt(900000)+100000;
-        return  System.currentTimeMillis()+String.valueOf(number);
-    }
-}

+ 0 - 48
src/main/java/com/td/Dawa/util/NumUtil.java

@@ -1,48 +0,0 @@
-package com.td.Dawa.util;
-
-import java.util.Random;
-
-/**
- * @author:slambb
- * @date:2021/3/29
- */
-public class NumUtil {
-
-    /**
-     * 随机指定范围内N个不重复的数
-     * 在初始化的无重复待选数组中随机产生一个数放入结果中,
-     * 将待选数组被随机到的数,用待选数组(len-1)下标对应的数替换
-     * 然后从len-2里随机产生下一个随机数,如此类推
-     * @param max  指定范围最大值
-     * @param min  指定范围最小值
-     * @param n  随机数个数
-     * @return int[] 随机数结果集
-     */
-    public static int[] randomArray(int min,int max,int n){
-        int len = max-min+1;
-
-        if(max < min || n > len){
-            return null;
-        }
-
-        //初始化给定范围的待选数组
-        int[] source = new int[len];
-        for (int i = min; i < min+len; i++){
-            source[i-min] = i;
-        }
-
-        int[] result = new int[n];
-        Random rd = new Random();
-        int index = 0;
-        for (int i = 0; i < result.length; i++) {
-            //待选数组0到(len-2)随机一个下标
-            index = Math.abs(rd.nextInt() % len--);
-            //将随机到的数放入结果集
-            result[i] = source[index];
-            //将待选数组中被随机到的数,用待选数组(len-1)下标对应的数替换
-            source[index] = source[len];
-        }
-        return result;
-    }
-
-}

+ 8 - 100
src/main/java/com/td/Dawa/util/RedisData.java

@@ -5,110 +5,18 @@ package com.td.Dawa.util;
  */
  */
 public class RedisData {
 public class RedisData {
 
 
-    /**
-     * 1s SNB锁
-     */
-    private static final int SNB_TIMEOUT = 5 * 1000; //5s锁
-
-    public static int getSnbTimeout() {
-        return SNB_TIMEOUT;
+    private static final int LOGIN_TIMEOUT = 5 * 1000; //5s锁
+    public static int getLoginTimeout() {
+        return LOGIN_TIMEOUT;
     }
     }
 
 
-    /**
-     * 10s 背包锁
-     */
-    private static final int PLAYER_GOODS_TIMEOUT = 10 * 1000; //超时时间 10s
-    public static int getPlayerGoodsTimeout() {
-        return PLAYER_GOODS_TIMEOUT;
+    private static final int ADD_ROLE_TIMEOUT = 3 * 1000; //5s锁
+    public static int getRoleTimeout() {
+        return ADD_ROLE_TIMEOUT;
     }
     }
-
-    /**
-     * 土地操作锁
-     */
-    private static final int LAND_TIMEOUT = 60 * 1000; //超时时间 60s
-    public static int getLandTimeout() {
-        return LAND_TIMEOUT;
-    }
-
-    /**
-     * 10s 第一次触发灾难锁
-     */
-    private static final int PLAYER_DISASTERS_FIRST_TIMEOUT = 10 * 1000; //超时时间 10s
-    public static int getPlayerDisastersFirstTimeout() {
-        return PLAYER_DISASTERS_FIRST_TIMEOUT;
+    public static String getRoleKey(String userId) {
+        return "GAME_GET_ROLE_".concat(userId);
     }
     }
-
-    private static final String PLAYER_DISASTERS_FIRST_KEY = "DISASTERS_FIRST";
-    public static String getPlayerDisastersFirstKey() {
-        return PLAYER_DISASTERS_FIRST_KEY;
-    }
-
-
-    /**
-     * 1h 灾难模块锁
-     */
-    private static final int PLAYER_DISASTERS_WEEK_TIMEOUT = 60 * 1000*60;
-    public static int getDisastersWeekTimeout() {
-        return PLAYER_DISASTERS_WEEK_TIMEOUT;
-    }
-
-    /**
-     * 1h 灾难模块锁
-     */
-    private static final int PLAYER_DISASTERS_DAY_TIMEOUT = 60 * 1000*60;
-    public static int getDisastersDayTimeout() {
-        return PLAYER_DISASTERS_DAY_TIMEOUT;
-    }
-
-    /**
-     * 5s 工具模块锁
-     */
-    private static final int PLAYER_LAND_TOOL_TIMEOUT = 5 * 1000; //超时时间 10s
-    public static int getPlayerLandToolTimeout() {
-        return PLAYER_LAND_TOOL_TIMEOUT;
-    }
-
-    /**
-     * 5s 工具模块锁
-     */
-    private static final int PLAYER_LAND_LEVELUP_TIMEOUT = 5 * 1000; //超时时间 10s
-    public static int getPlayerLandLevelupTimeout() {
-        return PLAYER_LAND_LEVELUP_TIMEOUT;
-    }
-    /**
-     * 20s 自动审核锁
-     */
-    private static final int AUTO_APPLY_TIMEOUT = 1000 * 20;
-    public static int getAutoApplyTimeout () {
-        return AUTO_APPLY_TIMEOUT;
-    }
-
-    /**
-     * 20s 用户申请锁
-     */
-    private static final int USER_APPLY_TIMEOUT = 1000 * 20;
-    public static int getUserApplyTimeout () {
-        return USER_APPLY_TIMEOUT;
-    }
-
-    /**
-     * 5s 养殖模块
-     */
-    private static final int PLAYER_CULTIVATE_BUYFOOD_TIMEOUT = 5 * 1000; //超时时间 5s
-    public static int getPlayerCultivateBuyFoodTimeout() {
-        return PLAYER_CULTIVATE_BUYFOOD_TIMEOUT;
-    }
-
-
-    /**
-     * 10s 兑换种子模块
-     */
-    private static final int PLAYER_SCORE_TIMEOUT = 10 * 1000;
-    public static int getPlayerScoreTimeout() {
-        return PLAYER_SCORE_TIMEOUT;
-    }
-
-
     /**
     /**
      * player 相关
      * player 相关
      */
      */

+ 1 - 30
src/main/java/com/td/Dawa/util/RedisSettingMap.java

@@ -8,8 +8,6 @@ import com.td.Dawa.sys.syssetting.service.SysSettingService;
 import com.td.Dawa.sys.syssetting.vo.SysSettingVo;
 import com.td.Dawa.sys.syssetting.vo.SysSettingVo;
 import com.td.Dawa.sys.syssettinglimit.service.SysSettingLimitService;
 import com.td.Dawa.sys.syssettinglimit.service.SysSettingLimitService;
 import com.td.Dawa.sys.syssettinglimit.vo.SysSettingLimitVo;
 import com.td.Dawa.sys.syssettinglimit.vo.SysSettingLimitVo;
-import com.td.Dawa.sys.syssettingtask.service.SysSettingTaskService;
-import com.td.Dawa.sys.syssettingtask.vo.SysSettingTaskVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
@@ -29,13 +27,9 @@ public class RedisSettingMap {
     @Autowired
     @Autowired
     private SysSettingService sysSettingService;
     private SysSettingService sysSettingService;
 
 
-    @Autowired
-    private SysSettingTaskService sysSettingTaskService;
-
     @Autowired
     @Autowired
     private SysSettingLimitService sysSettingLimitService;
     private SysSettingLimitService sysSettingLimitService;
-
-
+    
 
 
     //动态设置一个RSA key保存
     //动态设置一个RSA key保存
     private String rsaPublicKey = "data:rsa:public";
     private String rsaPublicKey = "data:rsa:public";
@@ -96,29 +90,6 @@ public class RedisSettingMap {
     public void setSysSettingMap(SysSettingVo sysSettingVo){
     public void setSysSettingMap(SysSettingVo sysSettingVo){
         redisTemplate.opsForValue().set(sysSettingKey, JSONUtil.toJsonStr(sysSettingVo));
         redisTemplate.opsForValue().set(sysSettingKey, JSONUtil.toJsonStr(sysSettingVo));
     }
     }
-    //系统任务key
-    private String sysSettingTaskKey = "data:sys:settingTask";
-    //update 一次redis数据
-    public void updateSysSettingTaskMap(){
-        SysSettingTaskVo sysSettingTaskVo = sysSettingTaskService.get("1").getData();
-        redisTemplate.opsForValue().set(sysSettingTaskKey, JSONUtil.toJsonStr(sysSettingTaskVo));
-    }
-    //从redis 获取系统设置 sysSettingTaskMap
-    public SysSettingTaskVo getSysSettingTaskMap(){
-        SysSettingTaskVo sysSettingTaskVo;
-        if (redisTemplate.hasKey(sysSettingTaskKey)) {
-            sysSettingTaskVo = JSON.parseObject(redisTemplate.opsForValue().get(sysSettingTaskKey),new TypeReference<SysSettingTaskVo>(){});
-        } else {
-            //系统启动时获取数据库数据,设置到公用静态集合sysSettingTaskMap
-            sysSettingTaskVo = sysSettingTaskService.get("1").getData();
-            redisTemplate.opsForValue().set(sysSettingTaskKey, JSONUtil.toJsonStr(sysSettingTaskVo));
-        }
-        return sysSettingTaskVo;
-    }
-    //设置SysSettingTask到Map
-    public void setSysSettingTaskMap(SysSettingTaskVo sysSettingTaskVo){
-        redisTemplate.opsForValue().set(sysSettingTaskKey, JSONUtil.toJsonStr(sysSettingTaskVo));
-    }
 
 
     //限制登录ip key
     //限制登录ip key
     private String sysSettingLimitKey = "data:sys:settingLimit";
     private String sysSettingLimitKey = "data:sys:settingLimit";

+ 0 - 189
src/main/java/com/td/Dawa/util/RsaUtil.java

@@ -1,189 +0,0 @@
-package com.td.Dawa.util;
-
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.codec.binary.Base64;
-
-import javax.crypto.Cipher;
-import java.io.ByteArrayOutputStream;
-import java.security.Key;
-import java.security.KeyFactory;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.interfaces.RSAPrivateKey;
-import java.security.interfaces.RSAPublicKey;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.security.spec.X509EncodedKeySpec;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * RSA加、解密算法工具类
- */
-@Slf4j
-public class RsaUtil {
-
-    /**
-     * 加密算法AES
-     */
-    private static final String KEY_ALGORITHM = "RSA";
-
-    /**
-     * 算法名称/加密模式/数据填充方式
-     * 默认:RSA/ECB/PKCS1Padding
-     */
-    private static final String ALGORITHMS = "RSA/ECB/PKCS1Padding";
-
-    /**
-     * Map获取公钥的key
-     */
-    private static final String PUBLIC_KEY = "publicKey";
-
-    /**
-     * Map获取私钥的key
-     */
-    private static final String PRIVATE_KEY = "privateKey";
-
-    /**
-     * RSA最大加密明文大小
-     */
-    private static final int MAX_ENCRYPT_BLOCK = 117;
-
-    /**
-     * RSA最大解密密文大小
-     */
-    private static final int MAX_DECRYPT_BLOCK = 128;
-
-    /**
-     * RSA 位数 如果采用2048 上面最大加密和最大解密则须填写:  245 256
-     */
-    private static final int INITIALIZE_LENGTH = 1024;
-
-    /**
-     * 后端RSA的密钥对(公钥和私钥)Map,由静态代码块赋值
-     */
-    private static Map<String, Object> genKeyPair = new LinkedHashMap<>();
-
-    static {
-        try {
-            genKeyPair.putAll(genKeyPair());
-        } catch (Exception e) {
-            //输出到日志文件中
-            log.error(ErrorUtil.errorInfoToString(e));
-        }
-    }
-
-    /**
-     * 生成密钥对(公钥和私钥)
-     */
-    private static Map<String, Object> genKeyPair() throws Exception {
-        KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM);
-        keyPairGen.initialize(INITIALIZE_LENGTH);
-        KeyPair keyPair = keyPairGen.generateKeyPair();
-        RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
-        RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
-        Map<String, Object> keyMap = new HashMap<String, Object>(2);
-        //公钥
-        keyMap.put(PUBLIC_KEY, publicKey);
-        //私钥
-        keyMap.put(PRIVATE_KEY, privateKey);
-        return keyMap;
-    }
-
-    /**
-     * 私钥解密
-     *
-     * @param encryptedData 已加密数据
-     * @param privateKey    私钥(BASE64编码)
-     */
-    public static byte[] decryptByPrivateKey(byte[] encryptedData, String privateKey) throws Exception {
-        //base64格式的key字符串转Key对象
-        Key privateK = KeyFactory.getInstance(KEY_ALGORITHM).generatePrivate(new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKey)));
-
-        //设置加密、填充方式
-        /*
-            如需使用更多加密、填充方式,引入
-            <dependency>
-                <groupId>org.bouncycastle</groupId>
-                <artifactId>bcprov-jdk16</artifactId>
-                <version>1.46</version>
-            </dependency>
-            并改成
-            Cipher cipher = Cipher.getInstance(ALGORITHMS ,new BouncyCastleProvider());
-         */
-        Cipher cipher = Cipher.getInstance(ALGORITHMS);
-        cipher.init(Cipher.DECRYPT_MODE, privateK);
-
-        //分段进行解密操作
-        return encryptAndDecryptOfSubsection(encryptedData, cipher, MAX_DECRYPT_BLOCK);
-    }
-
-    /**
-     * 公钥加密
-     *
-     * @param data      源数据
-     * @param publicKey 公钥(BASE64编码)
-     */
-    public static byte[] encryptByPublicKey(byte[] data, String publicKey) throws Exception {
-        //base64格式的key字符串转Key对象
-        Key publicK = KeyFactory.getInstance(KEY_ALGORITHM).generatePublic(new X509EncodedKeySpec(Base64.decodeBase64(publicKey)));
-
-        //设置加密、填充方式
-        /*
-            如需使用更多加密、填充方式,引入
-            <dependency>
-                <groupId>org.bouncycastle</groupId>
-                <artifactId>bcprov-jdk16</artifactId>
-                <version>1.46</version>
-            </dependency>
-            并改成
-            Cipher cipher = Cipher.getInstance(ALGORITHMS ,new BouncyCastleProvider());
-         */
-        Cipher cipher = Cipher.getInstance(ALGORITHMS);
-        cipher.init(Cipher.ENCRYPT_MODE, publicK);
-
-        //分段进行加密操作
-        return encryptAndDecryptOfSubsection(data, cipher, MAX_ENCRYPT_BLOCK);
-    }
-
-    /**
-     * 获取私钥
-     */
-    public static String getPrivateKey() {
-        Key key = (Key) genKeyPair.get(PRIVATE_KEY);
-        return Base64.encodeBase64String(key.getEncoded());
-    }
-
-    /**
-     * 获取公钥
-     */
-    public static String getPublicKey() {
-        Key key = (Key) genKeyPair.get(PUBLIC_KEY);
-        return Base64.encodeBase64String(key.getEncoded());
-    }
-
-    /**
-     * 分段进行加密、解密操作
-     */
-    private static byte[] encryptAndDecryptOfSubsection(byte[] data, Cipher cipher, int encryptBlock) throws Exception {
-        int inputLen = data.length;
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        int offSet = 0;
-        byte[] cache;
-        int i = 0;
-        // 对数据分段加密
-        while (inputLen - offSet > 0) {
-            if (inputLen - offSet > encryptBlock) {
-                cache = cipher.doFinal(data, offSet, encryptBlock);
-            } else {
-                cache = cipher.doFinal(data, offSet, inputLen - offSet);
-            }
-            out.write(cache, 0, cache.length);
-            i++;
-            offSet = i * encryptBlock;
-        }
-        out.close();
-        return out.toByteArray();
-    }
-}

+ 0 - 59
src/main/java/com/td/Dawa/util/RunScript.java

@@ -1,59 +0,0 @@
-package com.td.Dawa.util;
-
-/**
- * @author:slambb
- * @date:2021/12/30
- */
-
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-/**
- * 运行脚本
- *
- * @author Ruby
- */
-public class RunScript {
-
-    private ScriptEngineManager manager = new ScriptEngineManager();
-    private ScriptEngine engine;
-    private String fileName;
-    private String dAppName = "D:\\CocosProject\\2.1.4\\FragrantTown_Server\\src\\main\\resources\\static\\dapp\\dapp-plugin.min.js";
-
-    public RunScript(String fileName) {
-        engine = manager.getEngineByName("JavaScript");
-        this.fileName = fileName;
-    }
-
-    /**
-     * 设置变量
-     *
-     * @param varName
-     * @param obj
-     */
-    public void setVar(String varName, Object obj) {
-        engine.put(varName, obj);
-    }
-
-    /**
-     * 启动脚本
-     *
-     * @throws FileNotFoundException
-     * @throws ScriptException
-     */
-    public void start() throws FileNotFoundException, ScriptException, NoSuchMethodException {
-        //engine.eval(new FileReader(dAppName));
-        engine.eval(new FileReader(fileName));
-    }
-    public void invoke(String name,Object... args) throws ScriptException, NoSuchMethodException {
-        Invocable inv = (Invocable) engine;
-        inv.invokeFunction(name, args);
-    }
-
-
-}

+ 0 - 30
src/main/java/com/td/Dawa/util/SysSettingLimitUtil.java

@@ -1,30 +0,0 @@
-package com.td.Dawa.util;
-
-import com.td.Dawa.sys.syssettinglimit.vo.SysSettingLimitVo;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * 系统设置工具类
- * 系统启动时获取数据库数据,设置到公用静态集合sysSettingLimitMap
- * 更新系统设置时同步更新公用静态集合sysSettingLimitMap
- */
-public class SysSettingLimitUtil {
-
-    //使用线程安全的ConcurrentHashMap来存储系统设置
-    private static ConcurrentHashMap<String, SysSettingLimitVo> sysSettingLimitMap = new ConcurrentHashMap<>();
-
-    //从公用静态集合sysSettingLimitMap获取系统设置
-    public static SysSettingLimitVo getSysSettingLimit(){
-        return sysSettingLimitMap.get("sysSettingLimit");
-    }
-
-    //更新公用静态集合sysSettingLimitMap
-    public static void setSysSettingLimitMap(SysSettingLimitVo sysSettingLimitVo){
-        if(sysSettingLimitMap.isEmpty()){
-            sysSettingLimitMap.put("sysSettingLimit",sysSettingLimitVo);
-        }else{
-            sysSettingLimitMap.replace("sysSettingLimit",sysSettingLimitVo);
-        }
-    }
-}

+ 0 - 30
src/main/java/com/td/Dawa/util/SysSettingTaskUtil.java

@@ -1,30 +0,0 @@
-package com.td.Dawa.util;
-
-import com.td.Dawa.sys.syssettingtask.vo.SysSettingTaskVo;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * 系统设置工具类
- * 系统启动时获取数据库数据,设置到公用静态集合sysSettingMap
- * 更新系统设置时同步更新公用静态集合sysSettingMap
- */
-public class SysSettingTaskUtil {
-
-    //使用线程安全的ConcurrentHashMap来存储系统设置
-    private static ConcurrentHashMap<String, SysSettingTaskVo> sysSettingTaskMap = new ConcurrentHashMap<>();
-
-    //从公用静态集合sysSettingTaskMap获取系统设置
-    public static SysSettingTaskVo getSysSettingTask(){
-        return sysSettingTaskMap.get("sysSettingTask");
-    }
-
-    //更新公用静态集合sysSettingTaskMap
-    public static void setSysSettingTaskMap(SysSettingTaskVo sysSettingTaskVo){
-        if(sysSettingTaskMap.isEmpty()){
-            sysSettingTaskMap.put("sysSettingTask",sysSettingTaskVo);
-        }else{
-            sysSettingTaskMap.replace("sysSettingTask",sysSettingTaskVo);
-        }
-    }
-}

+ 0 - 30
src/main/java/com/td/Dawa/util/SysSettingUtil.java

@@ -1,30 +0,0 @@
-package com.td.Dawa.util;
-
-import com.td.Dawa.sys.syssetting.vo.SysSettingVo;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * 系统设置工具类
- * 系统启动时获取数据库数据,设置到公用静态集合sysSettingMap
- * 更新系统设置时同步更新公用静态集合sysSettingMap
- */
-public class SysSettingUtil {
-
-    //使用线程安全的ConcurrentHashMap来存储系统设置
-    private static ConcurrentHashMap<String,SysSettingVo> sysSettingMap = new ConcurrentHashMap<>();
-
-    //从公用静态集合sysSettingMap获取系统设置
-    public static SysSettingVo getSysSetting(){
-        return sysSettingMap.get("sysSetting");
-    }
-
-    //更新公用静态集合sysSettingMap
-    public static void setSysSettingMap(SysSettingVo sysSetting){
-        if(sysSettingMap.isEmpty()){
-            sysSettingMap.put("sysSetting",sysSetting);
-        }else{
-            sysSettingMap.replace("sysSetting",sysSetting);
-        }
-    }
-}

+ 2 - 8
src/main/resources/application.yml

@@ -51,7 +51,7 @@ spring:
 
 
   #数据库配置
   #数据库配置
   datasource:
   datasource:
-    url: jdbc:mysql://42.192.165.168:3306/wada?useSSL=false&serverTimezone=GMT%2B8&characterEncoding=utf-8
+    url: jdbc:mysql://42.192.165.168:3306/dawa?useSSL=false&serverTimezone=GMT%2B8&characterEncoding=utf-8
     username: root
     username: root
     password: 9ab8fad748dead93
     password: 9ab8fad748dead93
     driver-class-name: com.mysql.cj.jdbc.Driver
     driver-class-name: com.mysql.cj.jdbc.Driver
@@ -77,9 +77,6 @@ spring:
 captcha:
 captcha:
   enable: false
   enable: false
 
 
-apply:
-  ip:  "" #183.52.205.93
-
 # 瓦达项目url
 # 瓦达项目url
 meta-pal:
 meta-pal:
   url: https://lionworld.metestsvr.com/marketserver/game
   url: https://lionworld.metestsvr.com/marketserver/game
@@ -93,7 +90,7 @@ spring:
 
 
   #数据库配置
   #数据库配置
   datasource:
   datasource:
-    url: jdbc:mysql://localhost:3306/wada?serverTimezone=GMT%2B8&characterEncoding=utf-8
+    url: jdbc:mysql://localhost:3306/dawa?serverTimezone=GMT%2B8&characterEncoding=utf-8
     username:
     username:
     password:
     password:
     driver-class-name: com.mysql.cj.jdbc.Driver
     driver-class-name: com.mysql.cj.jdbc.Driver
@@ -119,9 +116,6 @@ spring:
 captcha:
 captcha:
   enable: true
   enable: true
 
 
-apply:
-  ip:
-
 # 瓦达项目url
 # 瓦达项目url
 meta-pal:
 meta-pal:
   url:
   url: