package com.pj.api.client.async_server;

import com.pj.api.FeignInterceptor;
import com.pj.api.consts.FeignConsts;
import com.pj.api.dto.ImportDeclarePeopleDto;
import com.pj.api.dto.OrderDto;
import com.pj.api.dto.OrdersDto;
import com.pj.api.dto.PeopleConfirmDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 异步通信
 * @Author Mechrevo
 * @Date 2023 08 29 13 02
 **/
@FeignClient(
        name = FeignConsts.ASYNC_SERVER,                // 服务名称
        configuration = FeignInterceptor.class,        // 请求拦截器
        fallbackFactory = AsyncServerInterfaceFallback.class    // 服务降级
)
public interface AsyncServerInterface {

    /**
     * 发送一级市场订单对象至航通
     * @param
     * @param
     */
    @RequestMapping("/async/rpc/sendLevelOneOrderDto")
    public  void sendLevelOneOrderDto(@RequestBody OrderDto tbOrderDto, @RequestParam("dataType")String dataType);


    /**
     * 发送二级市场订单对象至航通
     * @param t
     * @param dataType
     */
    @RequestMapping("/async/rpc/sendLevelTwoOrdersDto")
    public void sendLevelTwoOrdersDto(@RequestBody OrdersDto t, @RequestParam("dataType")String dataType);

    /**
     * 发送边民确认信息
     */
    @RequestMapping("/async/rpc/sendConfirm")
    void sendConfirm(@RequestBody PeopleConfirmDTO confirmDTO);

    /** 远程调用: 根据便民身份证号 和 进出口结算单号查询[进口申报单边民确认] 将该对象返还航通 */
    @RequestMapping("/HtImportDeclarePeople/rpc/getByIdNoAndPreleportNo")
    public ImportDeclarePeopleDto getByIdNoAndPreleportNo(@RequestParam("idNo")String idNo, @RequestParam("preleportNo")String preleportNo);

}
