luofl
2025-02-20 e4eaabefaaa2ca95f809c47a11712c3bee56e1b5
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.ruoyi.order.feignClient;
 
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.order.factory.OrderClientFallbackFactory;
import com.ruoyi.order.model.Order;
import com.ruoyi.order.vo.OrderSaleNum;
import org.springframework.cloud.openfeign.FeignClient;
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;
import java.util.Set;
 
/**
 * @author zhibing.pu
 * @date 2025/1/7 14:37
 */
@FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = OrderClientFallbackFactory.class)
public interface OrderClient {
 
 
    /**
     * 获取商品销售数量
     * @param goodsId
     * @param type 购买类型(1=普通商品,2=秒杀商品)
     * @return
     */
    @PostMapping("/order/getGoodsSaleNum")
    R<Integer> getGoodsSaleNum(@RequestParam("goodsId") Integer goodsId, @RequestParam("type") Integer type);
 
 
    /**
     * 获取门店销售订单数量
     * @param shopId    门店id
     * @param type      1:服务订单,2:单品订单
     * @return
     */
    @PostMapping("/order/getShopSaleNum")
    R<Integer> getShopSaleNum(@RequestParam("shopId") Integer shopId, @RequestParam("type") Integer type);
 
    @PostMapping("/order/getShopSaleNumByShopIds")
    R<Integer> getShopSaleNumByShopIds(@RequestBody OrderSaleNum orderSaleNum);
 
 
    /**
     * 获取所有在指定门店消费的用户id
     * @param shopId
     * @return
     */
    @PostMapping("/order/getAppUserByShoppingShop")
    R<Set<Long>> getAppUserByShoppingShop(@RequestParam("shopId") Integer shopId);
 
 
    /**
     * 根据id获取订单详情
     * @param id
     * @return
     */
    @PostMapping("/order/getOrderById")
    R<Order> getOrderById(@RequestParam("id") Long id);
 
 
    /**
     * 编辑订单详情
     * @param order
     * @return
     */
    @PostMapping("/order/editOrder")
    R editOrder(@RequestBody Order order);
    
    
    /**
     * 获取用户订单数量
     * @param appUserId
     * @return
     */
    @PostMapping("/order/getOrderCountByAppUserId")
    R<Long> getOrderCountByAppUserId(@RequestParam("id") Long appUserId);
}