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.activity.WebActivityDropdownDto;
import com.crm.rely.backend.core.dto.web.activity.WebActivitySearchDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.web.activity.*;
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;

import java.util.List;

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

    /**
     * 添加活动
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/add")
    BaseResultDto add(WebActivityAddEntity entity) throws Exception;

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

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

    /**
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/list")
    ResultWithPagerDto<WebActivitySearchDto> list(WebActivitySearchListEntity entity) throws Exception;

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

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

    @PostMapping("/dropdown")
    BaseResultDto<List<WebActivityDropdownDto>> dropdown(WebActivityDropdownEntity entity) throws Exception;
}
