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;
}
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;
}
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;
}
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");
}
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;
}
Aggregations