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.GetMapping;
|
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);
|
|
/**
|
* 获取指定门店的核销订单
|
*/
|
@GetMapping("/order/getRedeemedOrdersByShop")
|
R<List<Order>> getRedeemedOrdersByShop(@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);
|
|
|
/**
|
* 查询给定用户在给定门店核销的订单
|
* @param shopId
|
* @param appUserId
|
* @return
|
*/
|
@PostMapping("/order/getOrderByAppUserIdsAndWriteOffShop")
|
R<List<Order>> getOrderByAppUserIdsAndWriteOffShop(@RequestParam("shopId") Integer shopId, @RequestParam("appUserId") Set<Long> appUserId);
|
}
|