package com.crm.manager.service.golden;

import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.exception.ServiceException;
import com.crm.rely.backend.model.dto.golden.goods.GoldenGoodsListDto;
import com.crm.rely.backend.model.entity.golden.goods.GoldenGoodsAddEntity;
import com.crm.rely.backend.model.entity.golden.goods.GoldenGoodsDeleteEntitys;
import com.crm.rely.backend.model.entity.golden.goods.GoldenGoodsSearchEntity;
import com.crm.rely.backend.model.entity.golden.goods.GoldenGoodsUpdateEntity;
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.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(name = "GOLDEN-CUSTOM-SERVICE", path = "/goods/manager")
public interface GoldenGoodsFeignService {

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

    @PostMapping("/delete")
    BaseResultDto delete(GoldenGoodsDeleteEntitys entitys) throws ServiceException;

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

    @PostMapping("/search/list")
    ResultWithPagerDto<GoldenGoodsListDto> searchPageList(GoldenGoodsSearchEntity entity) throws ServiceException;

    @PostMapping("/search/single")
    BaseResultDto searchSingle(SingleLongEntity entity) throws ServiceException;

    @PostMapping(value = "/upload",  consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    BaseResultDto managerUpload(@RequestPart(value = "file") MultipartFile file) throws Exception;
    
}
