You've already forked FrameTour-BE
feat(coupon): 添加景区ID过滤功能以查询用户可用优惠券
- 在getUserCoupons接口中添加scenicId参数支持 - 修改couponService实现以按景区ID过滤优惠券 - 添加空值检查跳过无效配置的优惠券 - 更新接口文档添加scenicId参数说明
This commit is contained in:
@@ -58,13 +58,13 @@ public class PriceCalculationController {
|
||||
* 查询用户可用优惠券(包含领取记录信息)
|
||||
*/
|
||||
@GetMapping("/coupons/my-coupons")
|
||||
public ApiResponse<List<UserCouponResp>> getUserCoupons() {
|
||||
public ApiResponse<List<UserCouponResp>> getUserCoupons(@RequestParam(required = false) String scenicId) {
|
||||
Long userId = getUserId();
|
||||
if (userId == null) {
|
||||
return ApiResponse.fail("用户未登录");
|
||||
}
|
||||
|
||||
List<UserCouponResp> coupons = couponService.getUserAvailableCoupons(userId);
|
||||
List<UserCouponResp> coupons = couponService.getUserAvailableCoupons(userId, scenicId);
|
||||
|
||||
return ApiResponse.success(coupons);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user