|
|
@@ -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));
|
|
|
+ }
|
|
|
}
|