/**
 * date : 2022. 4. 25.
 * auth : ckr
 * desc : 서비스 관리
 */
package kr.co.uplus.ez.api.servMgt;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import kr.co.uplus.ez.api.servMgt.dto.RejectRecvListReqDto;
import kr.co.uplus.ez.api.servMgt.dto.RejectRecvListResDto;
import kr.co.uplus.ez.common.components.ValidComponents;
import kr.co.uplus.ez.common.data.ApiResponseCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;


@RestController
@RequestMapping(value = "api/v1/bo/servMgt")
public class ServMgtController {
	@Autowired
	ServMgtService servMgtService;

	@Autowired
	ValidComponents validComponents;


	/**
	 * date : 2022. 4. 25.
	 * auth : ckr
	 * desc : 080수신거부 목록 조회
	 * @param rejectRecvListReqDto
	 * @return
	 * @
	 */
	@ApiOperation(value = "rejectRecvList", notes = "080수신거부 목록 조회")
	@ApiResponses({ @ApiResponse(code = HttpServletResponse.SC_OK, message = "SUCESS") })
	@RequestMapping(value = "rejectRecvList", method = { RequestMethod.POST })
	@ResponseBody
	public RejectRecvListResDto rejectRecvList(@RequestBody @Valid RejectRecvListReqDto rejectRecvListReqDto, BindingResult bindingResult) {

		if (validComponents.validParameter(bindingResult)) {
			return new RejectRecvListResDto(ApiResponseCode.CM_PARAMETER_ERROR);
		}

		return servMgtService.rejectRecvList(rejectRecvListReqDto);
	}



}
