Selaa lähdekoodia

1. 添加ip限制功能
2. 修改操作幸运币部分

slambb 3 vuotta sitten
vanhempi
sitoutus
e37af77936

+ 14 - 0
src/main/java/com/td/boss/BossApplication.java

@@ -4,6 +4,8 @@ import com.td.boss.game.comusers.service.ComUsersService;
 import com.td.boss.sys.sysmenu.vo.SysMenuVo;
 import com.td.boss.sys.syssetting.service.SysSettingService;
 import com.td.boss.sys.syssetting.vo.SysSettingVo;
+import com.td.boss.sys.syssettinglimit.service.SysSettingLimitService;
+import com.td.boss.sys.syssettinglimit.vo.SysSettingLimitVo;
 import com.td.boss.sys.syssettingtask.service.SysSettingTaskService;
 import com.td.boss.sys.syssettingtask.vo.SysSettingTaskVo;
 import com.td.boss.sys.sysshortcutmenu.service.SysShortcutMenuService;
@@ -74,6 +76,9 @@ class IndexController {
     @Autowired
     private SysSettingTaskService sysSettingTaskService;
 
+    @Autowired
+    private SysSettingLimitService sysSettingLimitService;
+
     @Autowired
     private SysUserMenuService sysUserMenuService;
 
@@ -108,6 +113,10 @@ class IndexController {
                 SysSettingTaskVo sysSettingTaskVo = sysSettingTaskService.get("1").getData();
                 SysSettingTaskUtil.setSysSettingTaskMap(sysSettingTaskVo);
 
+                //限制登录ip
+                SysSettingLimitVo sysSettingLimitVo = sysSettingLimitService.get("1").getData();
+                SysSettingLimitUtil.setSysSettingLimitMap(sysSettingLimitVo);
+
                 //获取本机内网IP
                 log.info("启动成功:" + "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + port + contextPath);
             } catch (UnknownHostException e) {
@@ -130,6 +139,9 @@ class IndexController {
         //系统审查信息
         modelAndView.addObject("sysSettingTask", SysSettingTaskUtil.getSysSettingTask());
 
+        //系统限制信息
+        modelAndView.addObject("sysSettingLimit", SysSettingLimitUtil.getSysSettingLimit());
+
 
         //后端公钥
         String publicKey = RsaUtil.getPublicKey();
@@ -162,6 +174,8 @@ class IndexController {
         //系统审查信息
         modelAndView.addObject("sysSettingTask", SysSettingTaskUtil.getSysSettingTask());
 
+        //系统限制信息
+        modelAndView.addObject("sysSettingLimit", SysSettingLimitUtil.getSysSettingLimit());
 
         //登录用户
         SysUserVo sysUserVo = sysUserService.findByLoginName(SecurityUtil.getLoginUser().getUsername()).getData();

+ 3 - 0
src/main/java/com/td/boss/config/enums/ResultEnum.java

@@ -22,6 +22,9 @@ public enum ResultEnum {
     //redis部分
     REDIS_IS_LOCK(307,"操作过于频繁,稍后再试!"),
     REDIS_IS_LOCK_ERROR(308,"操作失败,稍后再试!"),
+
+    //特定接口访问部分限制
+    LOGIN_IP_IS_ERROR(309,"IP异常?!"),
     //用户数据
     USER_DOES_NOT_EXIST(400,"不能存在用户信息!"),
     USER_ENERGY_IS_INSUFFICIENT(401,"用户能量不足!"),

+ 42 - 17
src/main/java/com/td/boss/filter/gameFilter.java

@@ -1,11 +1,10 @@
 package com.td.boss.filter;
 
 
+import com.td.boss.common.pojo.IpVo;
 import com.td.boss.common.pojo.Result;
 import com.td.boss.config.enums.ResultEnum;
-import com.td.boss.util.JsonUtils;
-import com.td.boss.util.JwtTokenUtil;
-import com.td.boss.util.TokenRequestWrapper;
+import com.td.boss.util.*;
 import io.jsonwebtoken.ExpiredJwtException;
 import io.jsonwebtoken.SignatureException;
 import lombok.extern.slf4j.Slf4j;
@@ -17,6 +16,7 @@ import javax.servlet.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.Arrays;
 
 /**
  * @author:slambb
@@ -33,9 +33,11 @@ public class gameFilter implements Filter {
     @Override
     public void init(FilterConfig filterConfig) throws ServletException {
     }
+
     @Override
     public void destroy() {
     }
+
     @Override
     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
         //处理跨域请求
@@ -59,22 +61,45 @@ public class gameFilter implements Filter {
         //登录,获取验证码,不用登录的接口
         if (!(path.indexOf("game") > -1) // 存在game字段,需要检验token
                 || path.indexOf("loginToken") > -1
-               // || path.indexOf("publicKeyAndSys") > -1
-               // || path.indexOf("playback")>-1
-                || path.indexOf("game_websocket") > -1 // todo 暂时放行
-                //这里三个接口给DApp后台调用
-                || path.indexOf("getSNBAndFreeze") >-1
-                || path.indexOf("setSNBAndUnfreeze") >-1
-                || path.indexOf("cntPlayback") >-1
-           ) {
+            // || path.indexOf("publicKeyAndSys") > -1
+            // || path.indexOf("playback")>-1
+            // || path.indexOf("game_websocket") > -1 // todo 暂时放行
+            //这里三个接口给DApp后台调用
+            //|| path.indexOf("getSNBAndFreeze") >-1
+            //|| path.indexOf("setSNBAndUnfreeze") >-1
+            //|| path.indexOf("cntPlayback") >-1
+        ) {
             //登录情况直接放行
             filterChain.doFilter(servletRequest, response);
             return;
         }
+
+        //这里三个接口给DApp后台调用,需要指定ip访问
+        if (
+                path.indexOf("getSNBAndFreeze") > -1
+                        || path.indexOf("setSNBAndUnfreeze") > -1
+                        || path.indexOf("cntPlayback") > -1) {
+            //登陆IP不在白名单
+            String ipAddr = IpUtil.getIpAddr(req);
+            log.info("ipAddr:"+ipAddr);
+            //IpVo ipVo = IpUtil.getIpVoByRequest(req);
+            //log.info("ip2Addr:"+ ipVo.toString());
+            String limitedIp = SysSettingLimitUtil.getSysSettingLimit().getLimitedIp();
+            if (StringUtils.hasText(limitedIp) && !Arrays.asList(limitedIp.split(",")).contains(ipAddr)) {
+                response.setCharacterEncoding("utf-8");
+                response.getWriter().print(JsonUtils.toJson(Result.of(null, false, ResultEnum.LOGIN_IP_IS_ERROR.getMessage(), ResultEnum.LOGIN_IP_IS_ERROR.getCode())));
+                return;
+            }
+
+            filterChain.doFilter(servletRequest, response);
+            return;
+        }
+
+
         if (null == token || token.isEmpty() || !token.startsWith("Bearer ")) {
             //没有token信息
             response.setCharacterEncoding("utf-8");
-            response.getWriter().print( JsonUtils.toJson (Result.of(null,false,ResultEnum.TOKEN_DOES_NOT_EXIST.getMessage(),ResultEnum.TOKEN_DOES_NOT_EXIST.getCode())));
+            response.getWriter().print(JsonUtils.toJson(Result.of(null, false, ResultEnum.TOKEN_DOES_NOT_EXIST.getMessage(), ResultEnum.TOKEN_DOES_NOT_EXIST.getCode())));
             return;
         } else {
             String authToken = token.substring(7);
@@ -84,7 +109,7 @@ public class gameFilter implements Filter {
                 //todo 后面需要校验时间,加入可切换 secret 校验
                 log.info("validateToken:{}", jwtTokenUtil.validateToken(authToken, userId));
                 // 加入secret校验
-                if(!jwtTokenUtil.validateToken(authToken, userId)){
+                if (!jwtTokenUtil.validateToken(authToken, userId)) {
                     log.info("secret 不可靠,validateToken:{}", jwtTokenUtil.validateToken(authToken, userId));
                 }
                 if (!StringUtils.isEmpty(userId)) {
@@ -92,16 +117,16 @@ public class gameFilter implements Filter {
                 } else {
                     //不存在用户信息
                     response.setCharacterEncoding("utf-8");
-                    response.getWriter().print(JsonUtils.toJson(Result.of(authToken,false,ResultEnum.TOKEN_DOES_NOT_HAVE_USER_ID.getMessage(),ResultEnum.TOKEN_DOES_NOT_HAVE_USER_ID.getCode())));
+                    response.getWriter().print(JsonUtils.toJson(Result.of(authToken, false, ResultEnum.TOKEN_DOES_NOT_HAVE_USER_ID.getMessage(), ResultEnum.TOKEN_DOES_NOT_HAVE_USER_ID.getCode())));
                 }
             } catch (ExpiredJwtException e) {
                 //token过期
                 response.setCharacterEncoding("utf-8");
-                response.getWriter().print(JsonUtils.toJson(Result.of(null,false,ResultEnum.TOKEN_OUT_OF_DATE.getMessage(), ResultEnum.TOKEN_OUT_OF_DATE.getCode())));
-            } catch (SignatureException e){
+                response.getWriter().print(JsonUtils.toJson(Result.of(null, false, ResultEnum.TOKEN_OUT_OF_DATE.getMessage(), ResultEnum.TOKEN_OUT_OF_DATE.getCode())));
+            } catch (SignatureException e) {
                 //secret校验密钥不对
                 response.setCharacterEncoding("utf-8");
-                response.getWriter().print(JsonUtils.toJson(Result.of(authToken,false,ResultEnum.TOKEN_IS_ILLEGAL.getMessage(),ResultEnum.TOKEN_IS_ILLEGAL.getCode())));
+                response.getWriter().print(JsonUtils.toJson(Result.of(authToken, false, ResultEnum.TOKEN_IS_ILLEGAL.getMessage(), ResultEnum.TOKEN_IS_ILLEGAL.getCode())));
             }
 
         }

+ 4 - 6
src/main/java/com/td/boss/game/complayersattri/controller/ComPlayersLuckyController.java

@@ -55,15 +55,13 @@ public class ComPlayersLuckyController {
      * 土地升级
      *
      * @param userId
-     * @param level
-     * @param landId
+     * @param configLandId
      * @return
      */
     @PostMapping("/level")
     public Result<?> landLevelUp(@RequestParam(value = "userId") String userId,
-                                 @RequestParam(value = "level") Integer level,
-                                 @RequestParam(value = "landId") Integer landId) {
-        return service.landLevelUp(userId, level, landId);
+                                 @RequestParam(value = "configLandId") Integer configLandId) {
+        return service.landLevelUp(userId, configLandId);
     }
 
     /**
@@ -73,7 +71,7 @@ public class ComPlayersLuckyController {
      * @param luckNum
      * @return
      */
-    @GetMapping("/snb")
+    @PostMapping("/snb")
     public Result<?> toSNB(@RequestParam(value = "userId") String userId,
                            @RequestParam(value = "luckNum") Integer luckNum) {
         return service.toSNB(userId, luckNum);

+ 2 - 3
src/main/java/com/td/boss/game/complayersattri/service/ComPlayersLuckyService.java

@@ -24,11 +24,10 @@ public interface ComPlayersLuckyService extends CommonService<ComPlayersLuckyVo,
      * 土地升级
      *
      * @param userId
-     * @param levelId
-     * @param landId
+     * @param configLandId
      * @return
      */
-    Result<?> landLevelUp(String userId, Integer levelId, Integer landId);
+    Result<?> landLevelUp(String userId , Integer configLandId);
 
     /**
      * 兑换snb

+ 25 - 18
src/main/java/com/td/boss/game/complayersattri/service/ComPlayersLuckyServiceImpl.java

@@ -34,9 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
+import java.util.*;
 
 @Slf4j
 @Service
@@ -122,38 +120,47 @@ public class ComPlayersLuckyServiceImpl extends CommonServiceImpl<ComPlayersLuck
         //更新幸运值
         playersAttri.setLucky(afterLucky);
         comPlayersAttriRepository.save(playersAttri);
-        return Result.of(null, true, "使用工具成功");
+        Map map = new HashMap();
+        map.put("playerAttribute", playersAttri);
+
+        return Result.of(map, true, "使用工具成功");
     }
 
     /**
      * 土地升级
      *
      * @param userId
-     * @param levelId
-     * @param landId
+     * @param configLandId
      * @return
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Result<?> landLevelUp(String userId, Integer levelId, Integer landId) {
+    public Result<?> landLevelUp(String userId, Integer configLandId) {
         //验证土地级别是否存在
-        ComPlayersLuckyLandLevelUpVo landLevelUpVo = getLandLevelUp().stream().filter(a -> a.getId().equals(levelId)).findFirst().orElse(null);
-        if (landLevelUpVo == null) {
-            return Result.of(null, false, "升级失败,无效升级!");
-        }
+        //ComPlayersLuckyLandLevelUpVo landLevelUpVo = getLandLevelUp().stream().filter(a -> a.getId().equals(levelId)).findFirst().orElse(null);
+        //if (landLevelUpVo == null) {
+        //    return Result.of(null, false, "升级失败,无效升级!");
+        //}
         //验证土地是否存在
-        ComPlayerLand comPlayerLand = comPlayerLandRepository.findById(landId).orElse(null);
+        ComPlayerLand comPlayerLand = comPlayerLandRepository.findByUserIdAndConfigLandId(userId, configLandId).orElse(null);
         if (comPlayerLand == null || comPlayerLand.getUserId().equals(userId) == false) {
             return Result.of(null, false, "升级失败,无效土地!");
         }
-        //验证 将要升级的土地级别是否大于当前土地级别
-        if (comPlayerLand.getLandLevel() >= levelId) {
-            return Result.of(null, false, "升级失败,无效级别!");
-        }
         //土地租赁到期了,不能升级
         if (comPlayerLand.getLeaseTime().before(new Date())) {
             return Result.of(null, false, "升级失败,土地已到期!");
         }
+        //Slambb added code
+        //直接获取升级的 levelId
+        Integer levelId = comPlayerLand.getLandLevel() == null ? 1 : comPlayerLand.getLandLevel() + 1;
+        ComPlayersLuckyLandLevelUpVo landLevelUpVo = getLandLevelUp().stream().filter(a -> a.getId().equals(levelId)).findFirst().orElse(null);
+        if (landLevelUpVo == null) {
+            return Result.of(null, false, "升级失败,无效升级!");
+        }
+        //验证 将要升级的土地级别是否大于当前土地级别
+        //if (comPlayerLand.getLandLevel() >= levelId) {
+        //    return Result.of(null, false, "升级失败,无效级别!");
+        //}
 
         long time = System.currentTimeMillis() + RedisData.getPlayerLandLevelupTimeout();
         String _redisKey = "LOCK:COM_PLAYER_LAND_LEVELUP:" + userId;
@@ -178,7 +185,7 @@ public class ComPlayersLuckyServiceImpl extends CommonServiceImpl<ComPlayersLuck
         comPlayersLucky.setLuckyType(ComPlayerLuckyLogEnum.level.getCode());
         comPlayersLucky.setLuckyName(landLevelUpVo.getName());
         comPlayersLucky.setLevelId(levelId);
-        comPlayersLucky.setLandId(landId);
+        comPlayersLucky.setLandId(configLandId);
         comPlayersLucky.setUserId(userId);
         comPlayersLucky.setCreateTime(new Date());
         repository.save(comPlayersLucky);
@@ -190,7 +197,7 @@ public class ComPlayersLuckyServiceImpl extends CommonServiceImpl<ComPlayersLuck
         //更新土地级别
         comPlayerLand.setLandLevel(levelId);
         comPlayerLandRepository.save(comPlayerLand);
-        return Result.of(null, true, "升级成功");
+        return Result.of(landLevelUpVo, true, "升级成功");
     }
 
     /**

+ 2 - 1
src/main/java/com/td/boss/game/comusers/controller/ComUsersController.java

@@ -185,7 +185,8 @@ public class ComUsersController extends CommonController<ComUsersVo, ComUsers, S
         form.add("timestamp", timestamp);
         form.add("sign", sign);
         //验证地址
-        String DAppOnlineUrl = "https://yt.landownership.live/api/account/loginValidate";
+        //String DAppOnlineUrl = "https://yt.landownership.live/api/account/loginValidate";
+        String DAppOnlineUrl = "http://192.168.20.251/api/account/loginValidate";
         String DAppTestUrl = "https://wp.landownership.live/api/account/loginValidate";
 
         String DAppUrl = active.equals("prod") ? DAppOnlineUrl : DAppTestUrl;

+ 17 - 0
src/main/java/com/td/boss/sys/syssettinglimit/controller/SysSettingLimitController.java

@@ -0,0 +1,17 @@
+package com.td.boss.sys.syssettinglimit.controller;
+
+import com.td.boss.common.controller.*;
+import com.td.boss.sys.syssettinglimit.pojo.SysSettingLimit;
+import com.td.boss.sys.syssettinglimit.vo.SysSettingLimitVo;
+import com.td.boss.sys.syssettinglimit.service.SysSettingLimitService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/game/sysSettingLimit/")
+public class SysSettingLimitController extends CommonController<SysSettingLimitVo, SysSettingLimit, String> {
+    @Autowired
+    private SysSettingLimitService sysSettingLimitService;
+
+
+}

+ 23 - 0
src/main/java/com/td/boss/sys/syssettinglimit/pojo/SysSettingLimit.java

@@ -0,0 +1,23 @@
+package com.td.boss.sys.syssettinglimit.pojo;
+
+import lombok.Data;
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+@Entity
+@Table(name = "sys_setting_limit")
+@Data
+public class SysSettingLimit implements Serializable {
+    @Id
+    private String userId;//用户id
+
+    private String limitedIp;//限制允许登录的IP集合
+
+    private String ipDescrite;//
+
+    private Date createTime;//创建时间
+
+    private Date updateTime;//修改时间
+
+}

+ 9 - 0
src/main/java/com/td/boss/sys/syssettinglimit/repository/SysSettingLimitRepository.java

@@ -0,0 +1,9 @@
+package com.td.boss.sys.syssettinglimit.repository;
+
+import com.td.boss.common.repository.*;
+import com.td.boss.sys.syssettinglimit.pojo.SysSettingLimit;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface SysSettingLimitRepository extends CommonRepository<SysSettingLimit, String> {
+}

+ 8 - 0
src/main/java/com/td/boss/sys/syssettinglimit/service/SysSettingLimitService.java

@@ -0,0 +1,8 @@
+package com.td.boss.sys.syssettinglimit.service;
+
+import com.td.boss.common.service.*;
+import com.td.boss.sys.syssettinglimit.pojo.SysSettingLimit;
+import com.td.boss.sys.syssettinglimit.vo.SysSettingLimitVo;
+
+public interface SysSettingLimitService extends CommonService<SysSettingLimitVo, SysSettingLimit, String> {
+}

+ 34 - 0
src/main/java/com/td/boss/sys/syssettinglimit/service/SysSettingLimitServiceImpl.java

@@ -0,0 +1,34 @@
+package com.td.boss.sys.syssettinglimit.service;
+
+import com.td.boss.common.pojo.Result;
+import com.td.boss.common.service.*;
+import com.td.boss.sys.syssettinglimit.pojo.SysSettingLimit;
+import com.td.boss.sys.syssettinglimit.vo.SysSettingLimitVo;
+import com.td.boss.sys.syssettinglimit.repository.SysSettingLimitRepository;
+import com.td.boss.util.SysSettingLimitUtil;
+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 SysSettingLimitServiceImpl extends CommonServiceImpl<SysSettingLimitVo, SysSettingLimit, String> implements SysSettingLimitService{
+
+    @PersistenceContext
+    private EntityManager em;
+    @Autowired
+    private SysSettingLimitRepository sysSettingLimitRepository;
+
+    @Override
+    public Result<SysSettingLimitVo> save(SysSettingLimitVo entityVo) {
+        //调用父类
+        Result<SysSettingLimitVo> result = super.save(entityVo);
+
+        //更新系统设置时同步更新公用静态集合sysSettingTaskMap
+        SysSettingLimitUtil.setSysSettingLimitMap(result.getData());
+
+        return result;
+    }
+}

+ 19 - 0
src/main/java/com/td/boss/sys/syssettinglimit/vo/SysSettingLimitVo.java

@@ -0,0 +1,19 @@
+package com.td.boss.sys.syssettinglimit.vo;
+
+import com.td.boss. common.pojo.PageCondition;import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class SysSettingLimitVo extends PageCondition implements Serializable {
+    private String userId;//用户id
+
+    private String limitedIp;//限制允许登录的IP集合
+
+    private String ipDescrite;//
+
+    private Date createTime;//创建时间
+
+    private Date updateTime;//修改时间
+
+}

+ 4 - 2
src/main/java/com/td/boss/util/DappUtil.java

@@ -59,7 +59,8 @@ public class DappUtil {
         MultiValueMap<String, Object> form = new LinkedMultiValueMap<>();
         form.add("id", userId);
         //验证地址
-        String DAppChildrenCountOnlineUrl = "https://yt.landownership.live/api/game/childrenCount";
+        //String DAppChildrenCountOnlineUrl = "https://yt.landownership.live/api/game/childrenCount";
+        String DAppChildrenCountOnlineUrl = "http://192.168.20.251/api/game/childrenCount";
         String DAppChildrenCountTestUrl = "https://wp.landownership.live/api/game/childrenCount";
         String DAppUrl = DappUtil.getEnv().equals("prod") ? DAppChildrenCountOnlineUrl : DAppChildrenCountTestUrl;
         log.info("用户直推数量地址:" + DAppUrl);
@@ -97,7 +98,8 @@ public class DappUtil {
         MultiValueMap<String, Object> form = new LinkedMultiValueMap<>();
         form.add("id", userId);
         //验证地址
-        String onlineUrl = "https://yt.landownership.live/api/game/cntPayAndSwapAmount";
+        //String onlineUrl = "https://yt.landownership.live/api/game/cntPayAndSwapAmount";
+        String onlineUrl = "http://192.168.20.251/api/game/cntPayAndSwapAmount";
         String testUrl = "https://wp.landownership.live/api/game/cntPayAndSwapAmount";
         String DAppUrl = DappUtil.getEnv().equals("prod") ? onlineUrl : testUrl;
         log.info("根据村民ID找到所属村的cnt总支付和总兑换数量:" + DAppUrl);

+ 31 - 0
src/main/java/com/td/boss/util/SysSettingLimitUtil.java

@@ -0,0 +1,31 @@
+package com.td.boss.util;
+
+import com.td.boss.sys.syssettinglimit.vo.SysSettingLimitVo;
+import com.td.boss.sys.syssettingtask.vo.SysSettingTaskVo;
+
+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);
+        }
+    }
+}

+ 6 - 6
src/test/java/com/td/boss/ComPlayerLuckyTests.java

@@ -61,23 +61,23 @@ public class ComPlayerLuckyTests {
      */
     @Test
     public void landLevelUp() {
-        Result<?> result_user = comPlayersLuckyController.landLevelUp("9999999", levelId, landId);
+        Result<?> result_user = comPlayersLuckyController.landLevelUp("9999999", landId);
         Assert.assertFalse(result_user.isFlag());
-        Result<?> result_level = comPlayersLuckyController.landLevelUp(userId, 9999999, landId);
+        Result<?> result_level = comPlayersLuckyController.landLevelUp(userId,  landId);
         Assert.assertFalse(result_level.isFlag());
-        Result<?> result_land = comPlayersLuckyController.landLevelUp(userId, levelId, 9999999);
+        Result<?> result_land = comPlayersLuckyController.landLevelUp(userId,  9999999);
         Assert.assertFalse(result_land.isFlag());
         //幸运值不够
-        Result<?> result_no = comPlayersLuckyController.landLevelUp("1024", levelId, 3);
+        Result<?> result_no = comPlayersLuckyController.landLevelUp("1024",  3);
         Assert.assertFalse(result_no.isFlag());
         //测试到期
         Result<?> result_endDate = comPlayersLuckyController.useLuckyTools(userId, 2, 170);
         Assert.assertFalse(result_endDate.isFlag());
         //测试正常升级
-        Result<?> result = comPlayersLuckyController.landLevelUp(userId, levelId, landId);
+        Result<?> result = comPlayersLuckyController.landLevelUp(userId,  landId);
         Assert.assertTrue(result.isFlag());
         //重复升级
-        Result<?> result2 = comPlayersLuckyController.landLevelUp(userId, levelId, landId);
+        Result<?> result2 = comPlayersLuckyController.landLevelUp(userId,  landId);
         Assert.assertFalse(result2.isFlag());
     }