Эх сурвалжийг харах

1.getChildrenBuyLandCount
2.添加端口兑换积分

slambb 3 жил өмнө
parent
commit
7ef6613730

+ 1 - 1
src/main/java/com/td/boss/game/complayercultivate/serivce/ComPlayerCultivateSerivceImpl.java

@@ -129,7 +129,7 @@ public class ComPlayerCultivateSerivceImpl implements ComPlayerCultivateSerivce
      */
     @Override
     public Integer getTimes(String userId) {
-        Integer totalcount = DappUtil.getChildrenBuyLandAmount(userId);
+        Integer totalcount = DappUtil.getChildrenBuyLandCount(userId);
         long nowcount = comPlayerLandService.findAllByUserId(userId).stream()
                 .filter(a -> a.getMallType() != null && a.getMallType() > 0).count();
         ComExplainLandVo comExplainLandVo = new ComExplainLandVo();

+ 28 - 0
src/main/java/com/td/boss/game/complayerscore/controller/ComPlayerScoreController.java

@@ -2,14 +2,20 @@ package com.td.boss.game.complayerscore.controller;
 
 import com.td.boss.common.controller.*;
 import com.td.boss.common.pojo.Result;
+import com.td.boss.game.commallseed.pojo.ComMallSeed;
+import com.td.boss.game.commallseed.service.ComMallSeedService;
+import com.td.boss.game.commallseed.vo.ComMallSeedVo;
 import com.td.boss.game.complayerscore.pojo.ComPlayerScore;
 import com.td.boss.game.complayerscore.vo.ComPlayerScoreVo;
 import com.td.boss.game.complayerscore.service.ComPlayerScoreService;
+import com.td.boss.util.CopyUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/game/comPlayerScore/")
@@ -17,6 +23,9 @@ public class ComPlayerScoreController extends CommonController<ComPlayerScoreVo,
     @Autowired
     private ComPlayerScoreService comPlayerScoreService;
 
+    @Autowired
+    private ComMallSeedService comMallSeedService;
+
     /**
      * 积分兑换种子
      *
@@ -34,4 +43,23 @@ public class ComPlayerScoreController extends CommonController<ComPlayerScoreVo,
     ) {
         return comPlayerScoreService.exchange(userId, amount, seedId);
     }
+
+
+    /**
+     * 返回十天期的当前种子
+     * @param userId
+     * @return
+     */
+    @GetMapping("getSeeds")
+    @ResponseBody
+    public Result<List<ComMallSeedVo>> getSeeds(
+            @RequestParam(value = "userId") String userId
+    ) {
+
+        Integer _limitDay = 10;
+        List<ComMallSeed> comMallSeedList = comMallSeedService.findMallSeedAll().stream().
+                filter(e->e.getMaturity().equals(_limitDay)).collect(Collectors.toList());
+
+        return Result.of( CopyUtil.copyList(comMallSeedList,ComMallSeedVo.class));
+    }
 }