slambb 4 лет назад
Родитель
Сommit
469e990ae5

+ 4 - 0
src/main/java/com/td/boss/game/commallother/repository/ComMallOtherRepository.java

@@ -4,6 +4,10 @@ import com.td.boss.common.repository.*;
 import com.td.boss.game.commallother.pojo.ComMallOther;
 import org.springframework.stereotype.Repository;
 
+import java.util.Optional;
+
 @Repository
 public interface ComMallOtherRepository extends CommonRepository<ComMallOther, Integer> {
+
+    Optional<ComMallOther> findByOtherType(Integer otherType);
 }

+ 1 - 1
src/main/java/com/td/boss/game/commallother/service/ComMallOtherService.java

@@ -6,6 +6,6 @@ import com.td.boss.game.commallother.vo.ComMallOtherVo;
 
 public interface ComMallOtherService extends CommonService<ComMallOtherVo, ComMallOther, Integer> {
 
-
+    ComMallOther findByOtherType(Integer otherType);
 
 }

+ 6 - 0
src/main/java/com/td/boss/game/commallother/service/ComMallOtherServiceImpl.java

@@ -18,4 +18,10 @@ public class ComMallOtherServiceImpl extends CommonServiceImpl<ComMallOtherVo, C
     private EntityManager em;
     @Autowired
     private ComMallOtherRepository comMallOtherRepository;
+
+
+    @Override
+    public ComMallOther findByOtherType(Integer otherType) {
+        return comMallOtherRepository.findByOtherType(otherType).orElse(null);
+    }
 }

+ 3 - 2
src/main/java/com/td/boss/game/complayergoods/controller/ComPlayerGoodsController.java

@@ -285,7 +285,7 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
             // 配置的参数。这里先直接定义
             Double profitConfig = comSettingVo.getProfit(), stealRatioMaxConfig = comSettingVo.getStealMaxRatio(), stealRatioMinConfig = comSettingVo.getStealMinRatio(), finallyGetRatioConfig = comSettingVo.getFinalRatio();
             Double landLevelInCome = getLandLevelInCome(comPlayerLand, comMallSeedVo.getPriceSnb());
-            Double _profitDouble = _profit.doubleValue()+landLevelInCome;
+            Double _profitDouble = DoubleUtil.add(_profit.doubleValue(),landLevelInCome);
             Double _residualProfit = DoubleUtil.mul(_profitDouble, DoubleUtil.sub(1d, profitConfig));//如果 profitConfig 0.2,剩余利润就是0.8;
             Double _stealAmount = DoubleUtil.sub(_profitDouble, _residualProfit); //可偷取的利润
 
@@ -529,7 +529,8 @@ public class ComPlayerGoodsController extends CommonController<ComPlayerGoodsVo,
             }
             //todo 拿出计算利润,收获量减去种子的成本(snb)后的百分之30 ,后面需要后台可调整
             Double landLevelInCome = getLandLevelInCome(otherPlayerLand, comMallSeedVo.getPriceSnb());
-            Double _profit = _otherAmount - otherPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb()+landLevelInCome;
+            Integer _profitInt = _otherAmount - otherPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb();
+            Double _profit =  DoubleUtil.add(_profitInt.doubleValue(),landLevelInCome);
             // 配置的参数。这里先直接定义
             // 需要根据 狗是否生效,小偷是否装备打狗棒来确定参数
             Double profitConfig = _dogWork ? comSettingVo.getProfitDog() : comSettingVo.getProfit(),

+ 25 - 4
src/main/java/com/td/boss/game/complayerland/controller/ComPlayerLandController.java

@@ -18,10 +18,7 @@ import com.td.boss.game.complayergoods.vo.ComPlayerGoodsVo;
 import com.td.boss.game.complayerland.pojo.ComPlayerLand;
 import com.td.boss.game.complayerland.pojo.ComPlayerLandAndCanSteal;
 import com.td.boss.game.complayerland.service.ComPlayerDisasterProtectedService;
-import com.td.boss.game.complayerland.vo.ComPlayerLandAndPlantVo;
-import com.td.boss.game.complayerland.vo.ComPlayerLandAndUserInfoVo;
-import com.td.boss.game.complayerland.vo.ComPlayerLandSimpleVo;
-import com.td.boss.game.complayerland.vo.ComPlayerLandVo;
+import com.td.boss.game.complayerland.vo.*;
 import com.td.boss.game.complayerland.service.ComPlayerLandService;
 import com.td.boss.game.complayerlog.service.ComPlayerLogService;
 import com.td.boss.game.complayerlog.vo.ComPlayerLogVo;
@@ -485,6 +482,23 @@ public class ComPlayerLandController extends CommonController<ComPlayerLandVo, C
         return Result.of(history);
     }
 
+    @GetMapping("getDisasterMap")
+    @Transactional(rollbackFor = Exception.class)
+    public Result<Map> getDisasterMap(@RequestParam(value = "userId") String userId) {
+        List<ComPlayerDisasterProtected> protectList = disasterProtectedService.getComPlayerDisasterProtectedByUserIdOrderByProtectTimeDesc(userId);
+       ComPlayerDisasterProtected _naturalDisasterProtected = protectList.stream()
+                .filter(a -> a.getDsasterType().equals(2))
+                .sorted(Comparator.comparing(ComPlayerDisasterProtected::getProtectTime).reversed())
+                .findFirst().orElse(null);
+        ComPlayerDisasterProtected _beastDisasterProtected = protectList.stream()
+                .filter(a -> a.getDsasterType().equals(3))
+                .sorted(Comparator.comparing(ComPlayerDisasterProtected::getProtectTime).reversed())
+                .findFirst().orElse(null);
+        Map map = new HashMap();
+        map.put("naturalProtected",CopyUtil.copy(_naturalDisasterProtected, ComPlayerDisasterProtectedSimpleVo.class));
+        map.put("beastProtected",CopyUtil.copy(_beastDisasterProtected, ComPlayerDisasterProtectedSimpleVo.class));
+        return Result.of(map);
+    }
 
     private void _InitFirstDisasterProfit(ComPlayerLandAndPlantVo comPlayerLandAndPlantVo, ComMallSeedVo comMallSeedVo) {
         //这里处理一次判断是否发生过第一次灾难
@@ -533,6 +547,9 @@ public class ComPlayerLandController extends CommonController<ComPlayerLandVo, C
                             comMallSeedVo, 2, _allLossProfit);
                     //多次执行需要加上当前操作的利润
                     _allLossProfit += naturalProfitVo.getStolen();
+
+                    //添加自然灾害灾难记录
+                    comPlayerDisasterLogService.addDisasterEnable(comPlayerLandAndPlantVo.getUserId(),-1L,2,_protectedDate);
                 }
             }
             if (!isBeastProfit) {
@@ -549,6 +566,10 @@ public class ComPlayerLandController extends CommonController<ComPlayerLandVo, C
                             comMallSeedVo, 3, _allLossProfit);
 //                    //多次执行需要加上当前操作的利润
 //                    _allLossProfit += beastProfitVo.getStolen();
+
+                    //添加野兽灾害灾难记录
+                    comPlayerDisasterLogService.addDisasterEnable(comPlayerLandAndPlantVo.getUserId(),-1L,3,_protectedDate);
+
                 }
             }
         }

+ 13 - 0
src/main/java/com/td/boss/game/complayerland/service/ComPlayerDisasterLogService.java

@@ -4,6 +4,7 @@ import com.td.boss.common.service.CommonService;
 import com.td.boss.game.complayerland.pojo.ComPlayerDisasterLog;
 import com.td.boss.game.complayerland.vo.ComPlayerDisasterLogVo;
 
+import java.util.Date;
 import java.util.List;
 
 public interface ComPlayerDisasterLogService extends CommonService<ComPlayerDisasterLogVo, ComPlayerDisasterLog, String> {
@@ -22,6 +23,16 @@ public interface ComPlayerDisasterLogService extends CommonService<ComPlayerDisa
      */
     List<ComPlayerDisasterLog> getTodayDisasterUnEnabledList();
 
+    /**
+     * 添加一个已触发的灾难记录
+     *
+     * @param userId
+     * @param disasterTableId
+     * @param disasterDay
+     * @return
+     */
+    ComPlayerDisasterLog addDisasterEnable(String userId, long disasterTableId, Integer disasterType, Date disasterDay);
+
     /**
      * 灾难模式天任务:触发所有用户今日灾难和保护机制
      */
@@ -34,4 +45,6 @@ public interface ComPlayerDisasterLogService extends CommonService<ComPlayerDisa
      * @return
      */
     List<ComPlayerDisasterLog> getHistory(String userId);
+
+
 }

+ 28 - 2
src/main/java/com/td/boss/game/complayerland/service/ComPlayerDisasterLogServiceImpl.java

@@ -246,8 +246,8 @@ public class ComPlayerDisasterLogServiceImpl extends CommonServiceImpl<ComPlayer
                 if (redisLock.lock(_disasterKey, String.valueOf(time))) {
                     //灾难发生时间
                     Date endDate = com.td.boss.util.DateUtil.getOldDateAddDay(_comPlayerLand.getPlantStart(), _comPlayerLand.getPlantMature());
-                    long randomDate = _comPlayerLand.getPlantStart().compareTo(endDate) == 0?
-                            endDate.getTime():
+                    long randomDate = _comPlayerLand.getPlantStart().compareTo(endDate) == 0 ?
+                            endDate.getTime() :
                             RandomUtil.randomLong(_comPlayerLand.getPlantStart().getTime(), endDate.getTime());
                     Date disasterDate = new Date(randomDate);
                     //获取损失的数据
@@ -279,6 +279,10 @@ public class ComPlayerDisasterLogServiceImpl extends CommonServiceImpl<ComPlayer
                                 comMallSeedVo, 2, _allLossProfit);
                         //多次执行需要加上当前操作的利润
                         _allLossProfit += naturalProfitVo.getStolen();
+
+                        //添加自然灾害灾难记录
+                        addDisasterEnable(_comPlayerLand.getUserId(),-1L,2,protectedDate);
+
                     }
                     if (!isBeastProfit && protectedDate != null && disasterDate.before(protectedDate)) {
                         //灾难的随机时间比防护包时间后,说明防护包到期
@@ -287,6 +291,9 @@ public class ComPlayerDisasterLogServiceImpl extends CommonServiceImpl<ComPlayer
                                 comMallSeedVo, 3, _allLossProfit);
                         //多次执行需要加上当前操作的利润
                         _allLossProfit += beastProfitVo.getStolen();
+
+                        //添加野兽灾害灾难记录
+                        addDisasterEnable(_comPlayerLand.getUserId(),-1L,3,protectedDate);
                     }
 
                     //todo 添加一条单独减产的数据 ,对应灾难
@@ -324,4 +331,23 @@ public class ComPlayerDisasterLogServiceImpl extends CommonServiceImpl<ComPlayer
         return disasterLogRepository.findAll(specification);
     }
     //endregion
+
+
+    @Override
+    public ComPlayerDisasterLog addDisasterEnable(String userId, long disasterTableId,Integer disasterType, Date disasterDay) {
+
+        ComPlayerDisasterEnum disasterEnum = EnumUtil.getEnumAt(ComPlayerDisasterEnum.class,disasterType);
+        ComPlayerDisasterLog disasterLog = new ComPlayerDisasterLog();
+        disasterLog.setDsasterId(disasterTableId);
+        disasterLog.setDsasterName(disasterEnum.getMsg());
+        disasterLog.setDsasterType(disasterEnum.getCode());
+        disasterLog.setUserId(userId);
+        disasterLog.setDamage(damage);
+        disasterLog.setDefend(defend);
+        disasterLog.setCreateTime(new Date());
+        disasterLog.setShow(false);
+        disasterLog.setEnabled(true);
+        disasterLog.setDisasterTime(disasterDay);
+        return disasterLog;
+    }
 }

+ 24 - 0
src/main/java/com/td/boss/game/complayerland/vo/ComPlayerDisasterProtectedSimpleVo.java

@@ -0,0 +1,24 @@
+package com.td.boss.game.complayerland.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 灾难防护
+ */
+@Data
+public class ComPlayerDisasterProtectedSimpleVo implements Serializable {
+    /**
+     * 灾难名称
+     */
+    private String dsasterName;
+    private Integer dsasterType;
+    /**
+     * 防护截止时间
+     */
+    private Date protectTime;
+
+    private Date createTime;
+}

+ 2 - 0
src/main/java/com/td/boss/game/complayerland/vo/ComPlayerLandAndPlantVo.java

@@ -60,4 +60,6 @@ public class ComPlayerLandAndPlantVo implements Serializable {
     private Date updateTime;
 
     private Integer canSteal; //这个是当前用户的偷取状态
+
+    private Integer landLevel;//土地级别
 }

+ 2 - 0
src/main/java/com/td/boss/game/complayerland/vo/ComPlayerLandSimpleVo.java

@@ -57,4 +57,6 @@ public class ComPlayerLandSimpleVo implements Serializable {
     private Date createTime;
 
     private Date updateTime;
+
+    private Integer landLevel;//土地级别
 }

+ 10 - 8
src/main/java/com/td/boss/game/complayerprofit/service/ComPlayerProfitServiceImpl.java

@@ -81,13 +81,14 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
         }
         //todo 拿出全部利润
         Double landLevelInCome = getLandLevelInCome(comPlayerLand, comMallSeedVo.getPriceSnb());
-        Double _profit = _otherAmount - comPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb()+landLevelInCome;
+        Integer _profitInt = _otherAmount - comPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb();
+        Double _profit =  DoubleUtil.add(_profitInt.doubleValue(),landLevelInCome);
         //todo 计算减产,第一次灾难按利润的 50% 减产,两次就是减到 0 了。
 
         //必然发生的灾难,减产50%
-        Double _reduceProfit = DoubleUtil.mul(_profit.doubleValue(), 0.5);
+        Double _reduceProfit = DoubleUtil.mul(_profit, 0.5);
         // 100 - 80 = 20
-        Double _residualProfit = DoubleUtil.sub(_profit.doubleValue(), allLossProfit);
+        Double _residualProfit = DoubleUtil.sub(_profit, allLossProfit);
         //剩余利润减去当前需要减产的利润值
         Double _tempProfit = DoubleUtil.sub(_residualProfit, _reduceProfit);
         if (DoubleUtil.compare(_tempProfit, 0.0).equals(1)) {
@@ -102,7 +103,7 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
         comPlayerProfit.setLeaseMultiple(comPlayerLand.getLeaseMultiple());
         comPlayerProfit.setLeaseDate(comPlayerLand.getLeaseDate());
         comPlayerProfit.setHarvest(_otherAmount); // todo
-        comPlayerProfit.setProfit(_profit.doubleValue());//todo 目标用户可偷的初始利润值
+        comPlayerProfit.setProfit(_profit);//todo 目标用户可偷的初始利润值
         comPlayerProfit.setStolen(_endReduceProfit);//todo 目标用户被灾害减产对应的数量
         comPlayerProfit.setFinalSteal(_endReduceProfit);//
         comPlayerProfit.setProfitAfter(DoubleUtil.add(allLossProfit, _endReduceProfit)); //当前损失的利润加上当前扣减的
@@ -137,7 +138,8 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
         }
         //todo 拿出全部利润
         Double landLevelInCome = getLandLevelInCome(comPlayerLand, comMallSeedVo.getPriceSnb());
-        Double _profit = _otherAmount - comPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb()+landLevelInCome;
+        Integer _profitInt = _otherAmount - comPlayerLand.getLeaseMultiple() * comMallSeedVo.getPriceSnb();
+        Double _profit =  DoubleUtil.add(_profitInt.doubleValue(),landLevelInCome);
         //todo 计算减产,第一次灾难按利润的 50% 减产,两次就是减到 0 了。
 
         //额外发生的灾难,按照次数计算减产 50% 发生已经发生1次计算后当次等于 25%,
@@ -145,9 +147,9 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
         for(int i = disasterCount;i>0;i--){
             _startRatio =  DoubleUtil.mul(_startRatio,0.5);
         }
-        Double _reduceProfit = DoubleUtil.mul(_profit.doubleValue(), _startRatio);
+        Double _reduceProfit = DoubleUtil.mul(_profit, _startRatio);
         // 100 - 80 = 20
-        Double _residualProfit = DoubleUtil.sub(_profit.doubleValue(), allLossProfit);
+        Double _residualProfit = DoubleUtil.sub(_profit, allLossProfit);
         //剩余利润减去当前需要减产的利润值
         Double _tempProfit = DoubleUtil.sub(_residualProfit, _reduceProfit);
         if (DoubleUtil.compare(_tempProfit, 0.0).equals(1)) {
@@ -162,7 +164,7 @@ public class ComPlayerProfitServiceImpl extends CommonServiceImpl<ComPlayerProfi
         comPlayerProfit.setLeaseMultiple(comPlayerLand.getLeaseMultiple());
         comPlayerProfit.setLeaseDate(comPlayerLand.getLeaseDate());
         comPlayerProfit.setHarvest(_otherAmount); // todo
-        comPlayerProfit.setProfit(_profit.doubleValue());//todo 目标用户可偷的初始利润值
+        comPlayerProfit.setProfit(_profit);//todo 目标用户可偷的初始利润值
         comPlayerProfit.setStolen(_endReduceProfit);//todo 目标用户被灾害减产对应的数量
         comPlayerProfit.setFinalSteal(_endReduceProfit);//
         comPlayerProfit.setProfitAfter(DoubleUtil.add(allLossProfit, _endReduceProfit)); //当前损失的利润加上当前扣减的

+ 3 - 2
src/main/java/com/td/boss/game/comsnbapply/scheduled/IPCondition.java

@@ -1,5 +1,6 @@
 package com.td.boss.game.comsnbapply.scheduled;
 
+import com.td.boss.util.IpUtil;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.annotation.Condition;
@@ -19,8 +20,8 @@ public class IPCondition implements Condition {
 
     @Override
     public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
-        String runTaskIP = conditionContext.getEnvironment().getProperty("applySNB.task.ip");
-        String localIP = this.getLocalIP();
+        String runTaskIP = conditionContext.getEnvironment().getProperty("apply.ip");
+        String localIP = IpUtil.getIpVo(null).getIp(); //this.getLocalIP();
 
         log.info("local ip: {} , run Task IP: {}" ,localIP , runTaskIP);
 

+ 41 - 0
src/main/java/com/td/boss/game/comsnbfreeze/controller/ComSnbFreezeController.java

@@ -9,6 +9,9 @@ import com.td.boss.game.comcntorder.vo.ComCntOrderVo;
 import com.td.boss.game.comconfigland.pojo.ComConfigLand;
 import com.td.boss.game.comconfigland.service.ComConfigLandService;
 import com.td.boss.game.comconfigland.vo.ComConfigLandVo;
+import com.td.boss.game.commallother.pojo.ComMallOther;
+import com.td.boss.game.commallother.service.ComMallOtherService;
+import com.td.boss.game.commallother.vo.ComMallOtherVo;
 import com.td.boss.game.commallseed.pojo.ComMallSeed;
 import com.td.boss.game.commallseed.service.ComMallSeedService;
 import com.td.boss.game.commallseed.vo.ComMallSeedVo;
@@ -85,6 +88,8 @@ public class ComSnbFreezeController extends CommonController<ComSnbFreezeVo, Com
     @Autowired
     private RedisLock redisLock;
 
+    @Autowired
+    private ComMallOtherService comMallOtherService;
 
 
     /**
@@ -367,6 +372,14 @@ public class ComSnbFreezeController extends CommonController<ComSnbFreezeVo, Com
             comCntOrderVo.setItemType(item_type);
             comCntOrderVo.setPayType(pay_type);
             comCntOrderVo.setTxHash(tx_hash);
+
+            if (Double.parseDouble(pay_amount) <= 0) {
+                comCntOrderVo.setCntDescribe("非法操作pay_amount CNT:" + pay_amount);
+                comCntOrderService.save(comCntOrderVo);
+                result.put("msg", "非法操作!");
+                 return Result.of(result);
+            }
+
             if (comCntOrderVo.getPayType().equals(1) //3个月
             ) {
                 comCntOrderVo.setCntDescribe("购买土地租凭");
@@ -480,6 +493,20 @@ public class ComSnbFreezeController extends CommonController<ComSnbFreezeVo, Com
                 result.put("leaseLand", CopyUtil.copy(comPlayerLand, ComPlayerLandSimpleVo.class));
 
             } else if (comCntOrderVo.getPayType().equals(2)) {
+                //获取当前防护包价格,判断
+                ComMallOther comMallOther = comMallOtherService.findByOtherType(2);
+                if(comMallOther == null){
+                    comCntOrderVo.setCntDescribe("非法操作 comMallOther is null");
+                    comCntOrderService.save(comCntOrderVo);
+                    result.put("msg", "商品不存在!");
+                    return Result.of(result);
+                }
+                if(!comMallOther.getPriceCnt().equals(pay_amount)){
+                    comCntOrderVo.setCntDescribe("非法操作 pay_amount !");
+                    comCntOrderService.save(comCntOrderVo);
+                    result.put("msg", "pay_amount error!");
+                    return Result.of(result);
+                }
                 comCntOrderVo.setCntDescribe("自然灾害防护");
                 // todo 每购买一次防护,插入一条记录 ?
                 ComPlayerDisasterProtectedVo comPlayerDisasterProtected = new ComPlayerDisasterProtectedVo();
@@ -491,6 +518,20 @@ public class ComSnbFreezeController extends CommonController<ComSnbFreezeVo, Com
                 comPlayerDisasterProtectedService.save(comPlayerDisasterProtected);
 
             } else if (comCntOrderVo.getPayType().equals(3)) {
+                //获取当前防护包价格,判断
+                ComMallOther comMallOther = comMallOtherService.findByOtherType(3);
+                if(comMallOther == null){
+                    comCntOrderVo.setCntDescribe("非法操作 comMallOther is null");
+                    comCntOrderService.save(comCntOrderVo);
+                    result.put("msg", "商品不存在!");
+                    return Result.of(result);
+                }
+                if(!comMallOther.getPriceCnt().equals(pay_amount)){
+                    comCntOrderVo.setCntDescribe("非法操作 pay_amount !");
+                    comCntOrderService.save(comCntOrderVo);
+                    result.put("msg", "pay_amount error!");
+                    return Result.of(result);
+                }
                 comCntOrderVo.setCntDescribe("野兽防护");
                 // todo 每购买一次防护,插入一条记录 ?
                 ComPlayerDisasterProtectedVo comPlayerDisasterProtected = new ComPlayerDisasterProtectedVo();

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

@@ -44,13 +44,15 @@ jwt:
 ---
 ##### local 配置 #######
 spring:
-  profiles: local
+  config:
+    activate:
+      on-profile: local
 
   #数据库配置
   datasource:
-    url: jdbc:mysql://123.57.252.53:6688/dragon_town?useSSL=false&serverTimezone=GMT%2B8&characterEncoding=utf-8
+    url: jdbc:mysql://42.192.165.168:3306/dragon_town?useSSL=false&serverTimezone=GMT%2B8&characterEncoding=utf-8
     username: root #dragon_town #root
-    password:  7a829d0ecde828 #zddeiBmp8c5T6TR6 #9ab8fad748dead93
+    password: 9ab8fad748dead93 #FzCebFq6Xy0CDTXJ #zddeiBmp8c5T6TR6
     driver-class-name: com.mysql.cj.jdbc.Driver
     hikari:
       minimum-idle: 5
@@ -62,9 +64,9 @@ spring:
       connection-test-query: SELECT 1
 
   redis:
-    host: 123.57.252.53
+    host: 42.192.165.168 #123.57.252.53
     port: 6379
-    password: heihei
+    password: abc123456abc-test
     data: #工程中只是把redis作为缓存,并未使用redis作为数据持久化存储源repository使用.
       redis:
         repositories:
@@ -74,10 +76,15 @@ spring:
 captcha:
   enable: false
 
+apply:
+  ip: 192.168.0.109
+
 ---
 ##### dev 配置 #######
 spring:
-  profiles: dev
+  config:
+    activate:
+      on-profile: dev
 
   #数据库配置
   datasource:
@@ -113,10 +120,14 @@ spring:
 captcha:
   enable: true
 
+apply:
+  ip: 81.69.16.183
 ---
 ##### prod 配置 #######
 spring:
-  profiles: prod
+  config:
+    activate:
+      on-profile: prod
 
   #数据库配置
   datasource:
@@ -144,4 +155,7 @@ spring:
 
 #是否需要输入验证码
 captcha:
-  enable: true
+  enable: true
+
+apply:
+  ip: ""