package com.crm.manager.service.activity;

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.web.video.WebVideoSearchDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.web.video.WebVideoAddEntity;
import com.crm.rely.backend.core.entity.web.video.WebVideoDeleteEntity;
import com.crm.rely.backend.core.entity.web.video.WebVideoSearchListEntity;
import com.crm.rely.backend.core.entity.web.video.WebVideoUpdateEntity;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(name = "ACTIVITY-SERVICE", configuration = FeignMultipartSupportConfig.class, path = "/web/video/manager")
public interface WebVideoFeignService {

    @PostMapping("/add")
    BaseResultDto add(WebVideoAddEntity entity) throws Exception;

    /**
     * 删除
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/delete")
    BaseResultDto delete(WebVideoDeleteEntity entity) throws Exception;

    /**
     * 修改
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/update")
    BaseResultDto update(WebVideoUpdateEntity entity) throws Exception;

    /**
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/list")
    ResultWithPagerDto<WebVideoSearchDto> pageSearchList(WebVideoSearchListEntity entity) throws Exception;

    @PostMapping("/search/single")
    BaseResultDto<WebVideoSearchDto> single(SingleLongEntity entity) throws Exception;

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

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

}
