package com.crm.manager.controller;

import com.crm.manager.service.ib.AgentPcExcludeFeignService;
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.ib.exclude.AgentPcExcludeDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.ib.exclude.AgentPcExcludeAddEntity;
import com.crm.rely.backend.core.entity.ib.exclude.AgentPcExcludeListEntity;
import com.crm.rely.backend.core.entity.ib.exclude.AgentPcExcludeUpdateEntity;
import org.springframework.beans.factory.annotation.Autowired;
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("/agent/pc/exclude")
public class AgentPcExcludeController {

    @Autowired
    private AgentPcExcludeFeignService agentPcExcludeFeignService;

    @PostMapping("/add")
    public BaseResultDto<Object> add(@RequestBody AgentPcExcludeAddEntity entity) throws Exception {
        return agentPcExcludeFeignService.add(entity);
    }

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

    @PostMapping("/update")
    public BaseResultDto<Object> update(@RequestBody AgentPcExcludeUpdateEntity entity) throws Exception {
        return agentPcExcludeFeignService.update(entity);
    }

    @PostMapping("/search/list")
    public BaseResultWithPagerDto<List<AgentPcExcludeDto>> searchList(@RequestBody AgentPcExcludeListEntity entity) throws Exception {
        return agentPcExcludeFeignService.searchList(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto<AgentPcExcludeDto> searchSingle(@RequestBody SingleLongEntity entity) throws Exception {
        return agentPcExcludeFeignService.searchSinglet(entity);
    }

}
