헬스체크 수정
parent
6106fb5472
commit
c691e6b72c
@ -0,0 +1,84 @@
|
||||
package cfs.trsmrcv.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import cfs.common.util.Result;
|
||||
import cfs.common.util.ResultSmartPlatform;
|
||||
import cfs.trsmrcv.service.CommCollectServerService;
|
||||
|
||||
@Controller
|
||||
public class CommHealthCheckController {
|
||||
|
||||
protected Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Resource(name="commCollectServerService")
|
||||
private CommCollectServerService commCollectServerService;
|
||||
|
||||
/**
|
||||
* 서버 상태정보 주기적 저장
|
||||
* <pre></pre>
|
||||
*/
|
||||
@RequestMapping(value="/cfs/trsmrcv/insertServerStatus.do", method=RequestMethod.POST)
|
||||
public @ResponseBody Map<String, Object> insertServerStatus(
|
||||
@RequestBody Map<String, String> param,
|
||||
HttpServletRequest request) throws Exception {
|
||||
ResultSmartPlatform result = new ResultSmartPlatform();
|
||||
|
||||
|
||||
try {
|
||||
|
||||
Map<String, String> mapOrg = new HashMap<String, String>();
|
||||
|
||||
String sysTyCode = "";
|
||||
if(param != null){
|
||||
if(param.get("sysTyCode") != null){
|
||||
sysTyCode = param.get("sysTyCode");
|
||||
}
|
||||
}
|
||||
|
||||
boolean isOk = false;
|
||||
if(!sysTyCode.equals("")) {
|
||||
mapOrg.put("sysTyCode", sysTyCode);
|
||||
mapOrg.put("sysSttusCode", param.get("sysSttusCode"));
|
||||
|
||||
if(commCollectServerService.insertServerStauts(mapOrg) < 0) {
|
||||
// 실패
|
||||
result.setErrorMsg(null, null);
|
||||
} else {
|
||||
isOk = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(isOk == true) {
|
||||
result.setData(ResultSmartPlatform.RESULT_KEY_DEFAULT, "");
|
||||
result.setMsg(ResultSmartPlatform.STATUS_SUCESS, "정상적으로 처리되었습니다.");
|
||||
} else {
|
||||
result.setErrorMsg(null, null);
|
||||
}
|
||||
}catch(RuntimeException e) {
|
||||
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
|
||||
} catch (Exception e) {
|
||||
result.setErrorMsg(Result.STATUS_ERROR, Result.STATUS_ERROR_MESSAGE);
|
||||
}
|
||||
finally {
|
||||
logger.info(result.getResult().get("resultMessage").toString());
|
||||
}
|
||||
|
||||
return result.getResult();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue