package com.viettel.campaign.web.rest;

import com.viettel.campaign.service.AgentsService;
import com.viettel.campaign.web.dto.ResultDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/ipcc/agents")
@CrossOrigin
public class AgentsController {

    private static final Logger logger = LoggerFactory.getLogger(CampaignController.class);

    @Autowired
    AgentsService agentsService;

    @GetMapping("/getAgentsById")
    @ResponseBody
    public ResponseEntity<ResultDTO> getAgentsById(@RequestParam("agentId") String agentId) {
        ResultDTO result = agentsService.getAgentsByAgentId(agentId);
        return new ResponseEntity<>(result, HttpStatus.OK);
    }
}
