package com.crm.manager.service.follow;

import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.BaseResultWithPagerDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.follow.FollowDealSearchDto;
import com.crm.rely.backend.core.dto.follow.daily.FollowDealScoreDailyDto;
import com.crm.rely.backend.core.dto.follow.score.FollowDealScorePeriodTypesDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.follow.deal.*;
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/manager")
public interface FollowDealFeignService {
    /**
     * 添加
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/add")
    BaseResultDto managerAdd(@RequestBody @Validated FollowDealAddEntity entity) throws Exception;

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

    @PostMapping("/approve")
    BaseResultDto approve(@RequestBody @Validated FollowDealApproveEntity entity) throws Exception;

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

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

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

    @PostMapping("/export")
    BaseResultDto<List<FollowDealSearchDto>> export(FollowDealSearchListEntity entity) throws Exception;

    @PostMapping("/clear/all/recommend")
    BaseResultDto clearAllRecommend() throws Exception;

    @PostMapping("/recommend/update")
    BaseResultDto recommendUpdate(FollowDealRecommendUpdateEntity entity) throws Exception;

    @PostMapping("/search/period")
    BaseResultDto<List<FollowDealScorePeriodTypesDto>> managerSearchPeriod() throws Exception;

    @PostMapping("/search/periodRanking")
    BaseResultWithPagerDto<List<FollowDealScoreDailyDto>> searchPeriodRanking(FollowDealSearchListEntity entity) throws Exception;
}
