package com.eactive.eai.rms.onl.adapter.http.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.eactive.eai.rms.common.spring.BaseController;
import com.eactive.eai.rms.onl.adapter.common.vo.ErrorContentForm;

@Controller
public class HttpErrorContentsController extends BaseController {

	private static final String AGENT_PAGE = "adapter_log_agent.jsp";

	@RequestMapping("/adapter/http/errorContents.do")
	public ResponseEntity<Void> handleRequest(HttpServletRequest request, HttpServletResponse response) {
		ErrorContentForm form = new ErrorContentForm();

		// parameter 설정
		form.setEaiSvrInstNm(request.getParameter("eaiSvrInstNm"));
		form.setEaiSvrIp(request.getParameter("eaiSvrIp"));
		form.setEaiSvrLsnPort(request.getParameter("eaiSvrLsnPort"));
		form.setAgentPage(AGENT_PAGE);
		form.setSearchText(request.getParameter("searchText")); // 검색안
		form.setLogLevel(request.getParameter("logLevel"));

		return ResponseEntity.ok().build();
	}

}
