类的使用
cn.jrack.springboot.web.core.response.Result
使用Result的程序包
程序包
说明
-
cn.jrack.springboot.web.core.handler中Result的使用
修饰符和类型方法说明Result<?>GlobalExceptionHandler.allExceptionHandler(javax.servlet.http.HttpServletRequest request, Throwable ex) Result<?>GlobalExceptionHandler.bindExceptionHandler(org.springframework.validation.BindException ex) 处理 SpringMVC 参数绑定不正确,本质上也是通过 Validator 校验Result<?>GlobalExceptionHandler.constraintViolationExceptionHandler(javax.validation.ConstraintViolationException ex) 处理 Validator 校验不通过产生的异常Result<?>GlobalExceptionHandler.defaultExceptionHandler(javax.servlet.http.HttpServletRequest req, Throwable ex) 处理系统异常,兜底处理所有的一切Result<?>GlobalExceptionHandler.httpRequestMethodNotSupportedExceptionHandler(org.springframework.web.HttpRequestMethodNotSupportedException ex) 处理 SpringMVC 请求方法不正确Result<?>GlobalExceptionHandler.methodArgumentNotValidExceptionExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException ex) 处理 SpringMVC 参数校验不正确Result<?>GlobalExceptionHandler.methodArgumentTypeMismatchExceptionHandler(org.springframework.web.method.annotation.MethodArgumentTypeMismatchException ex) 处理 SpringMVC 请求参数类型错误Result<?>GlobalExceptionHandler.missingServletRequestParameterExceptionHandler(org.springframework.web.bind.MissingServletRequestParameterException ex) 处理 SpringMVC 请求参数缺失Result<?>GlobalExceptionHandler.noHandlerFoundExceptionHandler(org.springframework.web.servlet.NoHandlerFoundException ex) 处理 SpringMVC 请求地址不存在Result<?>GlobalExceptionHandler.notLoginExceptionHandler(cn.dev33.satoken.exception.NotLoginException ex) 处理系统异常,兜底处理所有的一切Result<?>GlobalExceptionHandler.saTokenExceptionHandler(cn.dev33.satoken.exception.SaTokenException ex) 处理 SaToken 权限不足的异常Result<?>GlobalExceptionHandler.serviceExceptionHandler(ServiceException ex) 处理业务异常 ServiceException -
cn.jrack.springboot.web.core.response中Result的使用
修饰符和类型方法说明RestController.decide(int result) 选择返回选择返回选择返回选择返回static <T> Result<T>Result.decide(boolean b) Boolean 返 回 操 作, 携 带 默 认 返 回 值static <T> Result<T>Boolean 返 回 操 作, 携 带 自 定 义 消 息ResultController.decide(int result) 选择返回选择返回选择返回选择返回RestController.fail()失败操作失败操作失败操作失败操作ResultController.fail()失败操作失败操作失败操作失败操作static <T> Result<T>Result.failure()失 败 操 作, 默 认 数 据static <T> Result<T>失 败 操 作, 携 带 自 定 义 状 态 码 和 自 定 义 消 息static <T> Result<T>失 败 操 作, 携 带 自 定 义 状 态 码 , 消 息 和 数 据static <T> Result<T>static <T> Result<T>失 败 操 作, 携 带 自 定 义 消 息static <T> Result<T>失 败 操 作, 携 带 自 定 义 消 息 和 数 据protected static ResultDescribe: 返回数据表格数据 分页 Param data Return 表格分页数据protected static ResultDescribe: 返回数据表格数据 分页 Param data Return 表格分页数据protected static ResultDescribe: 返回数据表格数据 分页 Param data Return 表格分页数据protected static ResultDescribe: 返回数据表格数据 分页 Param data Return 表格分页数据Result.setCode(int code) Result.setSuccess(Boolean success) RestController.success()成功操作成功操作成功操作成功操作成功操作static <T> Result<T>Result.success()成 功 操 作static <T> Result<T>成 功 操 作, 携 带 自 定 义 状 态 码 和 消 息static <T> Result<T>成 功 操 作, 携 带 自 定义 状 态 码, 消 息 和 数 据static <T> Result<T>成 功 操 作, 携 带 消 息static <T> Result<T>成 功 操 作, 携 带 消 息 和 携 带 数 据static <T> Result<T>Result.success(T data) 成 功 操 作 , 携 带 数 据ResultController.success()成功操作成功操作成功操作成功操作成功操作 -
cn.jrack.springboot.web.core.response.module中Result的使用
-
cn.jrack.springboot.web.core.util中Result的使用
修饰符和类型方法说明static Result<?>WebFrameworkUtils.getCommonResult(javax.servlet.ServletRequest request) 参数类型为Result的cn.jrack.springboot.web.core.util中的方法修饰符和类型方法说明static voidWebFrameworkUtils.setCommonResult(javax.servlet.ServletRequest request, Result<?> result)