package com.pj.api.client.payment_server;

import com.pj.api.FeignInterceptor;
import com.pj.api.consts.FeignConsts;
import com.pj.api.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(
        name = FeignConsts.PAYMENT_SERVER,                // 服务名称
        configuration = FeignInterceptor.class,        // 请求拦截器
        fallbackFactory = PaymentServerInterfaceFallback.class    // 服务降级
)
public interface PaymentServerInterface {

    /**
     * 结关报文接口
     */
    @PostMapping("/payment/rpc/sendCXB001")
    void sendCXB001(@RequestBody PaymentDto paymentDto);

    /**
     * 调用银行扣款接口
     */
    @PostMapping("/payment/rpc/sendSXB010")
    void sendSXB010(@RequestBody PaymentDto paymentDto);

    /**
     * 调用银行退款接口
     */
    @PostMapping("/payment/rpc/sendSXB013")
    void sendSXB013(@RequestBody PaymentDto paymentDto);

    /**
     * 调用通关车批信息同步接口(车出一级市场时)
     */
    @PostMapping("/payment/rpc/sendSXB023")
    void sendSXB023(@RequestBody PaymentDto paymentDto);

    /**
     * 订单扣款（无手续费）
     */
    @PostMapping("/payment/rpc/sendMKT006_NoCommission")
    void sendMKT006_NoCommission(@RequestBody PaymentTwoDto paymentTwoDto);

    /**
     * 订单扣款（+手续费）
     */
    @PostMapping("/payment/rpc/sendMKT006")
    void sendMKT006(@RequestBody PaymentTwoDto paymentTwoDto);

    @PostMapping("/BankInfo/rpc/getListBySource")
    public List<BankInfoDto> getListBySource(@RequestParam("source") String source);
}
