package com.sptg.pay.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.pay.api.dto.PayCertificateDto;
import com.sptg.pay.api.entity.PayCertificate;
import com.sptg.pay.api.feigns.fallback.PayCertificateFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author zwx
 * @create 2020/5/25 9:54
 */
@FeignClient(value = "smart-house-pay", fallbackFactory = PayCertificateFallbackFactory.class)
public interface PayCertificateFeign {

    /**
     * 功能描述:支付凭证列表查询（含分页）
     * @param payCertificateDto 支付凭证业务对象（含分页及查询条件）
     * @return  ResultBean<Page<PayCertificate>>
     *
     *
     */
    @PostMapping(value = "/payCertificate/showPayCertificatePage")
    ResultBean<Page<PayCertificate>> showPayCertificatePage(@RequestBody PayCertificateDto payCertificateDto);

    /**
     * 功能描述:新增支付凭证
     * @param payCertificateDto
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/payCertificate/addPayCertificate")
    ResultBean<Boolean> addPayCertificate(@RequestBody PayCertificateDto payCertificateDto);

    /**
     * 功能描述：新增支付凭证模板导入
     * @param payCertificateDto
     * @return
     */
    @PostMapping(value = "/payCertificate/addPayCertificateByImport")
    PayCertificate addPayCertificateByImport(@RequestBody PayCertificateDto payCertificateDto);

    /**
     * 功能描述:更新支付凭证
     * @param payCertificate
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/payCertificate/updatePayCertificate")
    ResultBean<Boolean> updatePayCertificate(@RequestBody PayCertificate payCertificate);

    /**
     * 功能描述:根据Id查找支付凭证
     * @param id 必填
     * @return Room
     *
     *
     */
    @GetMapping(value = "/payCertificate/findPayCertificateById/{id}")
    PayCertificate findPayCertificateById(@PathVariable(value = "id")Long id);

    /**
     * 功能描述:根据条件查询支付凭证
     * @param payCertificateDto 单元业务对象
     * @return PayCertificate 支付凭证对象
     *
     *
     */
    @PostMapping(value = "/payCertificate/findPayCertificateByCondition")
    PayCertificate findPayCertificateByCondition(@RequestBody PayCertificateDto payCertificateDto);

    /**
     * 功能描述:根据条件查询支付凭证
     * @param payCertificateDto 单元业务对象
     * @return PayCertificate 支付凭证对象
     *
     *
     */
    @PostMapping(value = "/payCertificate/findPayCertificateListByCondition")
    List<PayCertificate> findPayCertificateListByCondition(@RequestBody PayCertificateDto payCertificateDto);
}
