| | |
| | | package com.ruoyi.account.api.feignClient; |
| | | |
| | | import com.ruoyi.account.api.dto.GrantCouponDto; |
| | | import com.ruoyi.account.api.factory.AppCouponFallbackFactory; |
| | | import com.ruoyi.account.api.factory.AppUserFallbackFactory; |
| | | import com.ruoyi.account.api.model.TAppCoupon; |
| | | import com.ruoyi.account.api.query.ExchangeRecordGoodsQuery; |
| | | import com.ruoyi.account.api.vo.ExchangeRecordVO; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * 用户服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "AppCouponClient", value = ServiceNameConstants.CONTRACT_ACCOUNT, fallbackFactory = AppCouponFallbackFactory.class) |
| | | @FeignClient(contextId = "AppCouponClient", value = ServiceNameConstants.ACCOUNT_SERVICE, fallbackFactory = AppCouponFallbackFactory.class) |
| | | public interface AppCouponClient { |
| | | |
| | | /** |
| | | * 管理后台远程调用 根据优惠券ids 查询对应的发放数量 |
| | | * @return 优惠券ids 查询每个优惠券的发放数量 |
| | | */ |
| | | @PostMapping("/t-app-coupon/getCountByCouponIds") |
| | | public R<List<Integer>> getCountByCouponIds(String couponIds); |
| | | @PostMapping("/t-app-coupon/getCountByCouponIds/{couponIds}") |
| | | public R<List<Integer>> getCountByCouponIds(@PathVariable("couponIds") String couponIds); |
| | | /** |
| | | * 管理后台远程调用 根据优惠券id 查询对应的使用数量 |
| | | * @param couponId |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-app-coupon/getUseCountByCouponId") |
| | | public R<Integer> getUseCountByCouponId(Integer couponId); |
| | | @PostMapping("/t-app-coupon/getUseCountByCouponId/{couponId}") |
| | | public R<Integer> getUseCountByCouponId(@PathVariable("couponId")Integer couponId); |
| | | /** |
| | | * 后台远程调用 根据优惠券id 查询领取记录 |
| | | * @param couponId |
| | | * @return |
| | | */ |
| | | @PostMapping("/t-app-coupon/getExchangeRecordByCouponId") |
| | | R<List<ExchangeRecordVO>> getExchangeRecordByCouponId(@RequestBody ExchangeRecordGoodsQuery couponId); |
| | | /** |
| | | * 后台远程调用 给用户发放优惠券 |
| | | */ |
| | | @PostMapping("/t-app-coupon/grantCoupon") |
| | | R grantCoupon(@RequestBody GrantCouponDto dto); |
| | | |
| | | |
| | | @PostMapping(value = "/t-app-coupon/refund/{id}") |
| | | R refund(@PathVariable("id") String id); |
| | | |
| | | |
| | | /** |
| | | * 根据id获取优惠券领取记录 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/t-app-coupon/getAppCouponById") |
| | | R<TAppCoupon> getAppCouponById(@RequestParam("id") Long id); |
| | | |
| | | |
| | | /** |
| | | * 修改用户优惠券 |
| | | * @param appCoupon |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/t-app-coupon/updateAppCoupon") |
| | | R updateAppCoupon(@RequestBody TAppCoupon appCoupon); |
| | | } |