Search in sources :

Example 16 with ResponseResult

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;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult)

Example 17 with ResponseResult

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);
}
Also used : ObjectError(org.springframework.validation.ObjectError) ResponseResult(com.vartech.common.app.beans.ResponseResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 18 with ResponseResult

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;
}
Also used : ObjectError(org.springframework.validation.ObjectError) ResponseResult(com.vartech.common.app.beans.ResponseResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 19 with ResponseResult

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;
}
Also used : ObjectError(org.springframework.validation.ObjectError) ResponseResult(com.vartech.common.app.beans.ResponseResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 20 with ResponseResult

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;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ResponseResult (com.vartech.common.app.beans.ResponseResult)75 ExceptionHandler (org.springframework.web.bind.annotation.ExceptionHandler)15 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)14 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)13 Transactional (org.springframework.transaction.annotation.Transactional)12 MetaControlBean (com.varsql.core.db.MetaControlBean)10 DBTypeDriverProviderEntity (com.varsql.web.model.entity.db.DBTypeDriverProviderEntity)8 HashMap (java.util.HashMap)8 DBConnectionEntity (com.varsql.web.model.entity.db.DBConnectionEntity)6 EncryptDecryptException (com.vartech.common.crypto.EncryptDecryptException)6 IOException (java.io.IOException)6 ArrayList (java.util.ArrayList)6 Map (java.util.Map)6 ObjectError (org.springframework.validation.ObjectError)6 FileInfoEntity (com.varsql.web.model.entity.app.FileInfoEntity)5 SQLException (java.sql.SQLException)5 FileInfo (com.varsql.core.common.beans.FileInfo)4 JDBCDriverInfo (com.varsql.core.connection.beans.JDBCDriverInfo)4 DBMetadataException (com.varsql.core.exception.DBMetadataException)4 DBTypeDriverEntity (com.varsql.web.model.entity.db.DBTypeDriverEntity)4