|
@@ -1,7 +1,9 @@
|
|
|
package com.uas.platform.b2c.common.lottery.controller;
|
|
package com.uas.platform.b2c.common.lottery.controller;
|
|
|
|
|
|
|
|
import com.uas.platform.b2c.common.lottery.service.ActivityItemService;
|
|
import com.uas.platform.b2c.common.lottery.service.ActivityItemService;
|
|
|
|
|
+import com.uas.platform.b2c.common.lottery.service.PrizeService;
|
|
|
import com.uas.platform.b2c.common.lottery.service.UserInfoService;
|
|
import com.uas.platform.b2c.common.lottery.service.UserInfoService;
|
|
|
|
|
+import com.uas.platform.b2c.common.lottery.service.WinningHistoryService;
|
|
|
import com.uas.platform.b2c.trade.support.ResultMap;
|
|
import com.uas.platform.b2c.trade.support.ResultMap;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -22,10 +24,16 @@ public class LotteryController {
|
|
|
|
|
|
|
|
private final ActivityItemService activityItemService;
|
|
private final ActivityItemService activityItemService;
|
|
|
|
|
|
|
|
|
|
+ private final PrizeService prizeService;
|
|
|
|
|
+
|
|
|
|
|
+ private final WinningHistoryService winningHistoryService;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- public LotteryController(UserInfoService userInfoService, ActivityItemService activityItemService) {
|
|
|
|
|
|
|
+ public LotteryController(UserInfoService userInfoService, ActivityItemService activityItemService, PrizeService prizeService, WinningHistoryService winningHistoryService) {
|
|
|
this.userInfoService = userInfoService;
|
|
this.userInfoService = userInfoService;
|
|
|
this.activityItemService = activityItemService;
|
|
this.activityItemService = activityItemService;
|
|
|
|
|
+ this.prizeService = prizeService;
|
|
|
|
|
+ this.winningHistoryService = winningHistoryService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -48,4 +56,25 @@ public class LotteryController {
|
|
|
return activityItemService.getActivityItems(activityCode);
|
|
return activityItemService.getActivityItems(activityCode);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取当前等级奖品
|
|
|
|
|
+ * @param activityCode 活动编号
|
|
|
|
|
+ * @param itemCode 等级编号
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/user/prizes", method = RequestMethod.GET, produces = "application/json")
|
|
|
|
|
+ public ResultMap getPrizesByUser(String activityCode, String itemCode) {
|
|
|
|
|
+ return prizeService.getPrizesByUser(activityCode, itemCode);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取获奖记录
|
|
|
|
|
+ * @param activityCode 活动编号
|
|
|
|
|
+ * @param size 条数
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/user/winninghistories", method = RequestMethod.GET, produces = "application/json")
|
|
|
|
|
+ public ResultMap getWinningHistories(String activityCode, Integer size) {
|
|
|
|
|
+ return winningHistoryService.getWinningHistories(activityCode, size);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|