diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighActivityController.java b/hai-cweb/src/main/java/com/cweb/controller/HighActivityController.java index ba4e2b14..b568d8e1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighActivityController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighActivityController.java @@ -24,9 +24,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; -import java.math.BigDecimal; import java.util.*; -import java.util.stream.Collectors; /** * @@ -50,7 +48,6 @@ public class HighActivityController { @ApiOperation(value = "根据卡券查询活动信息") public ResponseData getActivityByCoupon(@RequestParam(name = "couponId", required = true) Long couponId) { try { - // 查询活动 Map activity = highActivityInfoService.getNewActivityByCouponId(couponId); if (activity != null) { @@ -59,7 +56,6 @@ public class HighActivityController { map.put("activityAward", highActivityAwardService.getListByActivityId(MapUtils.getLong(activity, "id"))); return ResponseMsgUtil.success(map); } - return ResponseMsgUtil.success(null); } catch (Exception e) { @@ -67,4 +63,24 @@ public class HighActivityController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value="/getDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询活动详情") + public ResponseData getDetail(@RequestParam(name = "activityId", required = true) Long activityId) { + try { + // 查询活动 + HighActivityInfo detail = highActivityInfoService.getDetailById(activityId); + if (detail != null) { + Map map = new HashMap<>(); + map.put("activityInfo", detail); + map.put("activityAward", highActivityAwardService.getListByActivityId(detail.getId())); + return ResponseMsgUtil.success(map); + } + return ResponseMsgUtil.success(null); + } catch (Exception e) { + log.error("HighActivityController -> getDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } }