package com.crm.manager.service.follow;

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.follow.deal.subscribe.FollowDealSubscribeSearchDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.follow.deal.subscribe.FollowDealSubscribeAddEntity;
import com.crm.rely.backend.core.entity.follow.deal.subscribe.FollowDealSubscribeDeleteEntity;
import com.crm.rely.backend.core.entity.follow.deal.subscribe.FollowDealSubscribeSearchListEntity;
import com.crm.rely.backend.core.entity.follow.deal.subscribe.FollowDealSubscribeUpdateEntity;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "FOLLOW-SERVICE", path = "/follow/deal/subscribe/manager")
public interface FollowDealSubscribeFeignService {

    /**
     * 订阅
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/subscribe")
    BaseResultDto subscribe(@RequestBody @Validated FollowDealSubscribeAddEntity entity) throws Exception;

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

    /**
     * 修改
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/update")
    BaseResultDto managerUpdate(@RequestBody @Validated FollowDealSubscribeUpdateEntity entity) throws Exception;

    @PostMapping("/unsubscribe")
    BaseResultDto unsubscribe(@RequestBody @Validated FollowDealSubscribeUpdateEntity entity) throws Exception;

    /**
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/list")
    ResultWithPagerDto<FollowDealSubscribeSearchDto> pageSearchList(@RequestBody @Validated FollowDealSubscribeSearchListEntity entity) throws Exception;

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

    @PostMapping("/export")
    BaseResultDto<List<FollowDealSubscribeSearchDto>> export(FollowDealSubscribeSearchListEntity entity) throws Exception;

}
