package com.crm.manager.controller;

import com.crm.login.rely.backend.controller.BaseLoginController;
import com.crm.manager.service.activity.AgentActivityEnrollFeignService;
import com.crm.rely.backend.core.dto.agent.activity.enroll.AgentActivityEnrollDto;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.entity.agent.activity.enroll.AgentActivityEnrollAddEntity;
import com.crm.rely.backend.core.entity.agent.activity.enroll.AgentActivityEnrollDeleteEntity;
import com.crm.rely.backend.core.entity.agent.activity.enroll.AgentActivityEnrollSearchEntity;
import com.crm.rely.backend.core.entity.agent.activity.enroll.AgentActivityEnrollUpdateEntity;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
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;

/**
 * @author: houn
 */
@RestController
@RequestMapping("/agent/activity/enroll")
public class AgentActivityEnrollController extends BaseLoginController {

    @Autowired
    private AgentActivityEnrollFeignService service;

    @PostMapping("/add")
    public BaseResultDto addManager(@RequestBody @Validated AgentActivityEnrollAddEntity entity) throws Exception {

        return service.addManager(entity);
    }

    @PostMapping("/delete")
    public BaseResultDto deleteManager(@RequestBody @Validated AgentActivityEnrollDeleteEntity entity) throws Exception {

        return service.deleteManager(entity);
    }

    @PostMapping("/update")
    public BaseResultDto updateManager(@RequestBody @Validated AgentActivityEnrollUpdateEntity entity) throws Exception {

        return service.updateManager(entity);
    }

    @PostMapping("/search/list")
    public ResultWithPagerDto<AgentActivityEnrollDto> searchListManager(@RequestBody @Validated AgentActivityEnrollSearchEntity entity) throws Exception {

        return service.searchListManager(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto searchSingleManager(@RequestBody @Validated SingleLongEntity entity) throws Exception {

        return service.searchSingleManager(entity);
    }


}
