package com.sptg.estate.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.ApplyPayRefundDto;
import com.sptg.estate.api.entity.ApplyPayRefund;
import com.sptg.estate.api.feigns.fallback.ApplyPayRefundFeignFallbackFactory;
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.io.FileNotFoundException;


/**
 * title: ApplyPayRefundFeign
 * package: com.sptg.estate.api.feigns
 * description: 住户 服务接口
 */
@FeignClient(value = "smart-house-estate", fallbackFactory = ApplyPayRefundFeignFallbackFactory.class)
public interface ApplyPayRefundFeign {

    /**
     * 功能描述:支付退款申请列表
     *
     * @param applyPayRefundDto 支付退款申请业务对象（含分页及查询条件）
     * @return ResultBean<Page < ApplyPayRefund>>
     */
    @PostMapping(value = "/applyPayRefund/showApplyPayRefundPage")
    ResultBean<Page<ApplyPayRefund>> showApplyPayRefundPage(@RequestBody ApplyPayRefundDto applyPayRefundDto);

    /**
     * 功能描述:新增支付退款申请
     *
     * @param applyPayRefundDto 支付退款申请业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/applyPayRefund/addApplyPayRefund")
    ResultBean<Boolean> addApplyPayRefund(@RequestBody ApplyPayRefundDto applyPayRefundDto);

    /**
     * 根据Id 查找支付退款申请记录
     *
     * @param id 必填
     * @return ApplyPayRefund
     */
    @GetMapping(value = "/applyPayRefund/findApplyPayRefundById/{id}")
    ApplyPayRefund findApplyPayRefundById(@PathVariable(value = "id") Long id);

    /**
     * 功能描述:审核支付退款申请记录
     *
     * @param applyPayRefundDto 支付退款申请业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/applyPayRefund/auditApplyPayRefund")
    ResultBean<Boolean> auditApplyPayRefund(@RequestBody ApplyPayRefundDto applyPayRefundDto) throws FileNotFoundException;

    /**
     * 功能描述:根据条件查询支付退款申请记录
     *
     * @param applyPayRefundDto 支付退款申请业务对象
     * @return ApplyPayRefund
     */
    @PostMapping(value = "/applyPayRefund/findApplyPayRefundByCondition")
    ApplyPayRefund findApplyPayRefundByCondition(@RequestBody ApplyPayRefundDto applyPayRefundDto);

    /**
     * 更新退款回调数据
     * @param applyPayRefund
     * @return
     */
    @PostMapping(value = "/applyPayRefund/updateApplyPayRefundByRefundNo")
    Boolean updateApplyPayRefundByRefundNo(@RequestBody ApplyPayRefund applyPayRefund);

}
