package com.pj.api.client.level_two_server;

import com.pj.api.FeignInterceptor;
import com.pj.api.consts.FeignConsts;
import com.pj.api.dto.PurchaserDto;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author Mechrevo
 * @Date 2023 08 01 10 38
 **/
@FeignClient(
        name = FeignConsts.LEVEL_TWO_SERVER, 				// 服务名称
        configuration = FeignInterceptor.class,		// 请求拦截器
        fallbackFactory = LevelTwoServerInterfaceFallback.class	// 服务降级
)
public interface LevelTwoServerInterface {

    @RequestMapping("/app/TbPurchaser/rpc/getByPurchaserId")
    public PurchaserDto getByPurchaserId(@RequestParam("id") Long id);

    /** 收购商保存银行卡信息 */
    @RequestMapping("/app/TbPurchaser/rpc/saveBankInfo")
    public boolean saveBankByPurchaser(@RequestParam("id")Long id, @RequestParam("bankName")String bankName, @RequestParam("bankAccount")String bankAccount);

    /** 添加国内收购商信息 */
    @RequestMapping("/TbPurchaser/purchaserDto")
    public boolean purchaserDto(@RequestBody PurchaserDto purchaserDto);

    /** 查 - 根据一级市场订单id查二级市场的转售金额 */
    @RequestMapping("/app/TbOrders/rpc/getResalePriceByLevelOneOrderId")
    public Double getResalePriceByLevelOneOrderId(@RequestParam("orderId") Long orderId);

    /** 采购商支付成功 ——> 边民缴税以及各服务费 */
    @PostMapping("/app/TbOrders/rpc/payTax")
    public boolean payTax(@RequestParam("orderNo") String orderNo, @RequestParam("MKT008Status")Integer MKT008Status);

    /** 收到边民缴税以及各服务费回执 */
    @PostMapping("/app/TbOrders/rpc/payTaxFromBank")
    public boolean payTaxFromBank(@RequestParam("orderNo") String orderNo, @RequestParam("MKT008Status")Integer MKT008Status);

    @RequestMapping("/TbOrders/rpc/removeOnSaleOrderByLevelOneOrderId")
    boolean removeOnSaleOrderByLevelOneOrderId(@RequestParam("levelOneOrderId") Long levelOneOrderId);
    @RequestMapping("/TbOrders/rpc/removeOnSaleOrderByLevelOneOrderIds")
    boolean removeOnSaleOrderByLevelOneOrderIds(@RequestParam("levelOneOrderIds")String levelOneOrderIds);
}
