puzhibing
2024-08-28 fe2e226da5a7505b343517e828f0d8c3a496fb7a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.ruoyi.other.api.feignClient;
 
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TCoupon;
import com.ruoyi.other.api.factory.CouponFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
 
import java.util.List;
 
/**
 * @author zhibing.pu
 * @Date 2024/8/16 14:00
 */
@FeignClient(contextId = "CouponClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = CouponFallbackFactory.class)
public interface CouponClient {
    
    
    /**
     * 根据id获取优惠券信息
     * @param id
     * @return
     */
    @PostMapping("/t-coupon/getCouponById1/{id}")
    R<TCoupon> getCouponById1(@PathVariable("id") Integer id);
    @PostMapping("/t-coupon/getCouponIdsByName/{name}")
     R<List<Integer>> getCouponIdsByName(@PathVariable("name")String name);
    
    
    /**
     * 修改优惠券
     * @param coupon
     * @return
     */
    @PostMapping("/t-coupon/updateCoupon")
    R updateCoupon(@RequestBody TCoupon coupon);
}