package com.crm.manager.service.finance;

import com.crm.manager.configuration.FeignMultipartSupportConfig;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.system.remittance.SysRemittanceChannelDto;
import com.crm.rely.backend.core.dto.system.remittance.SysRemittanceChannelGetCodeDto;
import com.crm.rely.backend.core.dto.system.remittance.SysRemittanceChannelSearchDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.system.remittance.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @description:
 * @author: houn
 * @create: 2021-1-13 16:25
 **/
@FeignClient(name = "PAY-SERVICE", path = "/remittance/channel/manager", configuration = FeignMultipartSupportConfig.class)
public interface SysRemittanceChannelFeignService {
    /**
     * 获取入金通道列表
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/list")
    BaseResultDto<List<SysRemittanceChannelDto>> selectList(SysRemittanceChannelListEntity entity) throws Exception;

    /**
     * 根据code 获取通道信息
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/code")
    BaseResultDto<SysRemittanceChannelDto> getByCode(SysRemittanceChannelByCodeEntity entity) throws Exception;

    /**
     * 添加入金通道
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/add")
    BaseResultDto add(SysRemittanceChannelAddEntity entity) throws Exception;

    /**
     * 删除入金通道
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/delete")
    BaseResultDto delete(SysRemittanceChannelDeleteEntity entity) throws Exception;

    /**
     * 修改入金通道
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/update")
    BaseResultDto update(SysRemittanceChannelUpdateEntity entity) throws Exception;

    @PostMapping("/batch/update")
    BaseResultDto updateBatch(SysRemittanceChannelBatchUpdateEntity entity) throws Exception;

    /**
     * 列表入金通道
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/list")
    ResultWithPagerDto<SysRemittanceChannelSearchDto> searchList(SysRemittanceChannelSearchEntity entity) throws Exception;

    @PostMapping("/list")
    BaseResultDto list() throws Exception;

    @PostMapping("/get/code")
    BaseResultDto<List<SysRemittanceChannelGetCodeDto>> getCodeList() throws Exception;

    /**
     * 单个查询
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/single")
    BaseResultDto single(SingleLongEntity entity) throws Exception;

    @PostMapping(value = "/{method}/upload", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE}, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    BaseResultDto upload(@PathVariable("method") String method, @RequestPart(value = "file", required = false) MultipartFile file) throws Exception;

    @PostMapping("/add/send/code")
    BaseResultDto addChannelSendEmailCode() throws Exception;

    @PostMapping("/batch/update/send/code")
    BaseResultDto updateChannelBatchSendEmailCode() throws Exception;

    @PostMapping("/update/send/code")
    BaseResultDto updateChannelSendEmailCode() throws Exception;

    @PostMapping("/delete/send/code")
    BaseResultDto deleteChannelSendEmailCode() throws Exception;

    @PostMapping("/get/custom/remittance/tick")
    BaseResultDto getCustomRemittanceTick(@RequestBody SysRemittanceChannelByCIdEntity entity);

    @PostMapping("/update/custom/remittance/tick")
    BaseResultDto updateCustomRemittanceTick(@RequestBody SysRemittanceChannelUpdateCustomByCIdEntity entity);

}
