package com.crm.manager.service.custom;

import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.custom.bank.CustomBankListDto;
import com.crm.rely.backend.core.entity.custom.bank.CustomBankAddEntity;
import com.crm.rely.backend.core.entity.custom.bank.CustomBankAllEntity;
import com.crm.rely.backend.core.entity.custom.bank.CustomBankDeleteEntity;
import com.crm.rely.backend.core.entity.custom.bank.CustomBankUpdateEntity;
import com.crm.rely.backend.exception.ServiceException;
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.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @description:
 * @author: houn
 * @create: 2020-07-19 16:25
 **/
@FeignClient(name = "CUSTOM-SERVICE", path = "/custom/bank/manager")
public interface CustomBankFeignService {

    @PostMapping("/search/list")
    BaseResultDto searchCustomList(CustomBankAllEntity entity) throws ServiceException;

    @PostMapping("/add")
    BaseResultDto add(CustomBankAddEntity entity) throws ServiceException;

    @PostMapping("/update")
    BaseResultDto update(CustomBankUpdateEntity entity) throws ServiceException;

    @PostMapping("/delete")
    BaseResultDto delete(CustomBankDeleteEntity entity) throws ServiceException;

    @PostMapping(value = "/upload/{customId}", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE}, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    BaseResultDto managerUpload(@RequestPart(value = "file") MultipartFile file,  @PathVariable("customId") Long customId) throws Exception;

    @PostMapping("/verify")
    BaseResultDto verify(CustomBankUpdateEntity entity) throws Exception;
}
