Search in sources :

Example 26 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class VarsqlUtils method getResponseResultItemOne.

/**
 * @method  : getResponseResultItemOne
 * @desc : item 1개 return
 * @author   : ytkim
 * @date   : 2020. 4. 20.
 * @param obj
 * @return
 */
public static ResponseResult getResponseResultItemOne(Object obj) {
    ResponseResult responseResult = new ResponseResult();
    responseResult.setItemOne(obj);
    return responseResult;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult)

Example 27 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class VarsqlUtils method getResponseResult.

public static ResponseResult getResponseResult(List<?> result, GenericMapper instance) {
    ResponseResult responseResult = new ResponseResult();
    responseResult.setItemList(result.stream().map(item -> instance.toDto(item)).collect(Collectors.toList()));
    return responseResult;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult)

Example 28 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class VarsqlUtils method getResponseResult.

public static ResponseResult getResponseResult(Page<?> result, SearchParameter searchParameter) {
    ResponseResult responseResult = new ResponseResult();
    responseResult.setItemList(result.getContent());
    responseResult.setPage(PagingUtil.getPageObject(result.getTotalElements(), searchParameter));
    return responseResult;
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult)

Example 29 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class GlobalExceptionHandler method varsqlAccessDeniedExceptionHandler.

/**
 * @method  : varsqlAccessDeniedExceptionHandler
 * @desc : 접근 체한
 * @author   : ytkim
 * @date   : 2021. 8. 19.
 * @param ex
 * @param request
 * @param response
 */
@ExceptionHandler(value = VarsqlAccessDeniedException.class)
public void varsqlAccessDeniedExceptionHandler(VarsqlAccessDeniedException ex, HttpServletRequest request, HttpServletResponse response) {
    ResponseResult result = new ResponseResult();
    exceptionRequestHandle(ex, request, response, result, "error403");
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) ExceptionHandler(org.springframework.web.bind.annotation.ExceptionHandler)

Example 30 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class GlobalExceptionHandler method multipartexceptionHandler.

/**
 * @Method Name  : multipartexceptionHandler
 * @Method 설명 : upload error
 * @작성자   : ytkim
 * @작성일   : 2019. 11. 29.
 * @변경이력  :
 * @param request
 * @param ex
 * @return
 */
@ExceptionHandler(MultipartException.class)
@ResponseBody
public ResponseResult multipartexceptionHandler(HttpServletRequest request, Throwable ex) {
    HttpStatus status = getStatus(request);
    ResponseResult result = new ResponseResult();
    result.setResultCode(RequestResultCode.valueOf(status.value()));
    result.setMessage(ex.getMessage());
    return result;
}
Also used : HttpStatus(org.springframework.http.HttpStatus) ResponseResult(com.vartech.common.app.beans.ResponseResult) ExceptionHandler(org.springframework.web.bind.annotation.ExceptionHandler) 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