提交代码

dev-discount
胡锐 3 years ago
parent d993484392
commit f4670e7dc1
  1. 24
      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<String, Object> 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<String,Object> 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);
}
}
}

Loading…
Cancel
Save