From f4670e7dc139266f2dbd7b10030cc8ab18afc9b9 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 27 Sep 2021 22:25:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HighActivityController.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) 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); + } + } }