package com.crm.manager.controller;

import com.crm.login.rely.backend.controller.BaseLoginController;
import com.crm.manager.service.agent.AgentActivityCustomLoginFeignService;
import com.crm.rely.backend.core.dto.agent.activity.custom.login.AgentActivityCustomLoginDto;
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.custom.login.AgentActivityCustomLoginAddEntity;
import com.crm.rely.backend.core.entity.agent.activity.custom.login.AgentActivityCustomLoginDeleteEntity;
import com.crm.rely.backend.core.entity.agent.activity.custom.login.AgentActivityCustomLoginSearchEntity;
import com.crm.rely.backend.core.entity.agent.activity.custom.login.AgentActivityCustomLoginUpdateEntity;
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/custom/login")
public class AgentActivityCustomLoginController extends BaseLoginController {

    @Autowired
    private AgentActivityCustomLoginFeignService service;
    
    @PostMapping("/add")
    public BaseResultDto addManager(@RequestBody @Validated AgentActivityCustomLoginAddEntity entity) throws Exception {

        return service.addManager(entity);
    }

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

        return service.deleteManager(entity);
    }

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

        return service.updateManager(entity);
    }

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

        return service.searchListManager(entity);
    }

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

        return service.searchSingleManager(entity);
    }

}
