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.GoldenGoodsVideoListDto;
import com.crm.rely.backend.model.entity.golden.goods.GoldenGoodsVideoAddEntity;
import com.crm.rely.backend.model.entity.golden.goods.GoldenGoodsVideoDeleteEntitys;
import com.crm.rely.backend.model.entity.golden.goods.GoldenGoodsVideoSearchEntity;
import com.crm.rely.backend.model.entity.golden.goods.GoldenGoodsVideoUpdateEntity;
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/video/manager")
public interface GoldenGoodsVideoFeignService {

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

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

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

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

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

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