use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.
the class UserMgmtServiceImpl method userDetail.
/**
* @Method Name : userDetail
* @Method 설명 : 사용자 정보 상세.
* @작성자 : ytkim
* @작성일 : 2018. 11. 29.
* @변경이력 :
* @param viewid
* @return
*/
public ResponseResult userDetail(String viewid) {
ResponseResult result = new ResponseResult();
result.setItemOne(UserMapper.INSTANCE.toDto(userMgmtRepository.findByViewid(viewid)));
result.setItemList(userDBConnectionEntityRepository.userConnInfo(viewid));
result.addCustoms("dbGroup", dbGroupEntityRepository.findAll(DBGroupSpec.userGroupList(viewid)));
return result;
}
use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.
the class BoardController method commentSave.
@RequestMapping(value = "{" + VarsqlParamConstants.BOARD_CODE + "}/commentSave", method = RequestMethod.POST)
@ResponseBody
public ResponseResult commentSave(@PathVariable(required = true, name = VarsqlParamConstants.BOARD_CODE) String boardCode, @RequestParam(value = "articleId", required = true) long articleId, @Valid BoardCommentRequestDTO boardCommentRequestDTO, BindingResult result, HttpServletRequest req, HttpServletResponse res) throws Exception {
boardCode = VarsqlUtils.getVonnid(req);
ResponseResult resultObject = new ResponseResult();
if (result.hasErrors()) {
for (ObjectError errorVal : result.getAllErrors()) {
logger.warn("### comment save validation check {}", errorVal.toString());
}
return VarsqlUtils.getResponseResultValidItem(resultObject, result);
}
boardCommentRequestDTO.setBoardCode(boardCode);
boardCommentRequestDTO.setArticleId(articleId);
return boardService.commentSave(articleId, boardCommentRequestDTO);
}
use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.
the class JoinController method insertUserInfo.
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ResponseBody
public ResponseResult insertUserInfo(@Valid UserReqeustDTO joinForm, BindingResult result, ModelAndView mav, HttpServletRequest req) throws EncryptDecryptException {
ResponseResult resultObject = new ResponseResult();
if (result.hasErrors()) {
for (ObjectError errorVal : result.getAllErrors()) {
logger.warn("### insertUserInfo validation check {}", errorVal.toString());
}
return VarsqlUtils.getResponseResultValidItem(resultObject, result);
}
Long idCheck = joinServiceImpl.idCheck(joinForm.getUid()).getItem();
if (idCheck > 0) {
resultObject.setResultCode(RequestResultCode.DUPLICATES);
}
resultObject.setItemOne(joinServiceImpl.saveUser(joinForm));
return resultObject;
}
use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.
the class UserMainController method sendNote.
/**
* @Method Name : sendNote
* @Method 설명 : 쪽지 보내기
* @작성자 : ytkim
* @작성일 : 2019. 5. 2.
* @변경이력 :
* @param noteInfo
* @param result
* @param req
* @return
* @throws Exception
*/
@RequestMapping(value = { "/sendNote", "/resendNote" }, method = RequestMethod.POST)
@ResponseBody
public ResponseResult sendNote(@Valid NoteRequestDTO noteInfo, BindingResult result, HttpServletRequest req) throws Exception {
ResponseResult resultObject = new ResponseResult();
if (result.hasErrors()) {
for (ObjectError errorVal : result.getAllErrors()) {
logger.warn("### UserMainController sendNote check {}", errorVal.toString());
}
resultObject = VarsqlUtils.getResponseResultValidItem(resultObject, result);
} else {
String requestURI = req.getRequestURI();
resultObject = userMainServiceImpl.insertSendNoteInfo(noteInfo, requestURI.indexOf("resendNote") > -1 ? true : false);
}
return resultObject;
}
use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.
the class ErrorController method invalidDatabase.
/**
* @Method Name : invalidDatabase
* @Method 설명 : 유효하지않은 database ajax
* @작성자 : ytkim
* @작성일 : 2019. 11. 1.
* @변경이력 :
* @param req
* @param res
* @param mav
* @return
* @throws Exception
*/
@RequestMapping(value = "/invalidDatabase", method = { RequestMethod.GET, RequestMethod.POST })
@ResponseBody
public ResponseResult invalidDatabase(HttpServletRequest req, HttpServletResponse res, ModelAndView mav) throws Exception {
ResponseResult result = new ResponseResult();
result.setStatus(RequestResultCode.ERROR.getCode());
result.setResultCode(VarsqlAppCode.INVALID_DATABASE);
result.setMessage("invalidDatabase");
return result;
}
Aggregations