| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | | @RequestMapping("api/client/activity") |
| | | public class ActivityController { |
| | | |
| | | @Reference(version = "1.0.0") |
| | | @Reference(version = "1.0.0", check = false) |
| | | private LuckyActivityService luckyActivityService; |
| | | |
| | | @Reference(version = "1.0.0") |
| | | @Reference(version = "1.0.0", check = false) |
| | | private LuckyActivityJoinAssistService luckyActivityJoinAssistService; |
| | | |
| | | @Resource |
| | |
| | | @ResponseBody |
| | | @RequestMapping("getActivityDetail") |
| | | public String getActivityDetail(AcceptData acceptData, Long activityId) { |
| | | ActivityDetailInfoDTO dto = activityService.getActivityDetail(activityId, acceptData.getApp().getId(), acceptData.getUid(), true, 20, false); |
| | | ActivityDetailInfoDTO dto = activityService.getActivityDetail(activityId, acceptData.getApp().getId(), acceptData.getUid(), true, 8, false); |
| | | if (dto == null) { |
| | | return JsonUtil.loadFalseResult("活动不存在"); |
| | | } |
| | |
| | | |
| | | //已经加入活动就需要返回助力分享图 |
| | | if (vo.isJoined()) { |
| | | |
| | | SimpleUser user = userInfoService.getSimpleUser(acceptData.getUid()); |
| | | if (user != null) { |
| | | String assistShareImage = null; |
| | |
| | | } |
| | | List<ActivityDetailInfoDTO> dtoList = activityService.getActivityDetail(activityIds, acceptData.getApp().getId(), acceptData.getUid(), false); |
| | | |
| | | //TODO 测试 |
| | | for (int i = 0; i < 20; i++) { |
| | | dtoList.add(dtoList.get(0)); |
| | | } |
| | | // //TODO 测试 |
| | | // for (int i = 0; i < 20; i++) { |
| | | // dtoList.add(dtoList.get(0)); |
| | | // } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("data", JsonUtil.getSimpleGson().toJson(ActivityListItemInfoVOFactory.create(dtoList))); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("getSponsorActivity") |
| | | public String getSponsorActivity(AcceptData acceptData, Long sponsorId, int page) { |
| | | public String getSponsorActivity(AcceptData acceptData, Long sponsorId, Long activityId, int page) { |
| | | |
| | | List<LuckyActivity> list = luckyActivityService.getActivityList(acceptData.getApp().getId(), sponsorId, getCanShowStateList(), null, page, Constant.CLIENT_ACTIVITY_LIST_PAGE_SIZE); |
| | | long count = luckyActivityService.countActivity(acceptData.getApp().getId(), sponsorId, getCanShowStateList(), null); |
| | | List<LuckyActivity> list = luckyActivityService.getActivityList(acceptData.getApp().getId(), sponsorId, getCanShowStateList(), Arrays.asList(new Long[]{activityId}), |
| | | null, page, Constant.CLIENT_ACTIVITY_LIST_PAGE_SIZE); |
| | | long count = luckyActivityService.countActivity(acceptData.getApp().getId(), sponsorId, getCanShowStateList(), null, Arrays.asList(new Long[]{activityId})); |
| | | |
| | | List<Long> activityIds = new ArrayList<>(); |
| | | if (list != null && list.size() > 0) { |