package com.crm.manager.controller;

import com.crm.manager.service.follow.FollowCptSignFeignService;
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.follow.cpt.FollowCptSignDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.follow.cpt.FollowCptSignSearchEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/follow/cpt/sign")
public class FollowCptSignController {

    @Autowired
    private FollowCptSignFeignService followCptSignFeignService;

    @PostMapping("/search/list")
    public BaseResultWithPagerDto<List<FollowCptSignDto>> searchList(@RequestBody FollowCptSignSearchEntity entity) throws Exception {
        return followCptSignFeignService.searchList(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto<FollowCptSignDto> searchSingle(@RequestBody @Validated SingleLongEntity entity) throws Exception {
        return followCptSignFeignService.searchSingle(entity);
    }

    @PostMapping("/kickout")
    public BaseResultDto<Object> kickout(@RequestBody @Validated SingleLongEntity entity) throws Exception {
        return followCptSignFeignService.kickout(entity);
    }

}
