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.PayChannelConfigDto;
import com.sptg.pay.api.entity.PayChannelConfig;
import com.sptg.pay.api.feigns.fallback.PayChannelConfigFallbackFactory;
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;

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

    /**
     * 功能描述:支付配置列表查询（含分页）
     * @param payChannelConfigDto 支付配置业务对象（含分页及查询条件）
     * @return  ResultBean<Page<PayChannelConfig>>
     *
     *
     */
    @PostMapping(value = "/payChannelConfig/showPayChannelConfigPage")
    ResultBean<Page<PayChannelConfig>> showPayChannelConfigPage(@RequestBody PayChannelConfigDto payChannelConfigDto);

    /**
     * 功能描述:新增支付配置
     * @param payChannelConfigDto
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/payChannelConfig/addPayChannelConfig")
    ResultBean<Boolean> addPayChannelConfig(@RequestBody PayChannelConfigDto payChannelConfigDto);

    /**
     * 功能描述:更新支付配置
     * @param payChannelConfig
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/payChannelConfig/updatePayChannelConfig")
    ResultBean<Boolean> updatePayChannelConfig(@RequestBody PayChannelConfig payChannelConfig);

    /**
     * 功能描述:根据Id查找支付配置
     * @param id 必填
     * @return Room
     *
     *
     */
    @GetMapping(value = "/payChannelConfig/findPayChannelConfigById/{id}")
    PayChannelConfig findPayChannelConfigById(@PathVariable(value = "id") Long id);

    /**
     * 功能描述:根据条件查询支付配置
     * @param payChannelConfigDto 单元业务对象
     * @return PayChannelConfig 支付配置对象
     *
     *
     */
    @PostMapping(value = "/unit/findUnitByCondition")
    PayChannelConfig findUnitByCondition(@RequestBody PayChannelConfigDto payChannelConfigDto);
}
