| 程序包 | 说明 |
|---|---|
| ai.yue.library.base.config.handler |
全局统一异常处理
|
| ai.yue.library.base.exception |
异常定义
|
| ai.yue.library.base.view |
Restful风格的最外层对象
|
| 限定符和类型 | 方法和说明 |
|---|---|
Result<?> |
ExceptionHandlerConfig.attackExceptionHandler(AttackException e)
非法请求异常拦截
|
Result<?> |
ExceptionHandlerConfig.bindExceptionHandler(org.springframework.validation.BindException e)
Valid 验证异常统一处理
|
Result<?> |
ExceptionHandlerConfig.clientFallbackExceptionHandler(ClientFallbackException e)
服务降级
|
Result<?> |
ExceptionHandlerConfig.convertExceptionHandler(cn.hutool.core.convert.ConvertException e)
类型转换异常统一处理
|
Result<?> |
ExceptionHandlerConfig.dbExceptionHandler(DBException e)
DB异常统一处理
|
Result<?> |
ExceptionHandlerConfig.exceptionHandler(Exception e)
拦截所有未处理异常
|
Result<?> |
ExceptionHandlerConfig.forbiddenExceptionHandler(ForbiddenException e)
无权限异常访问处理
|
Result<?> |
ExceptionHandlerConfig.loginExceptionHandler(LoginException e)
拦截登录异常(User)
|
Result<?> |
ExceptionHandlerConfig.paramDecryptExceptionHandler(ParamDecryptException e)
解密异常统一处理
|
Result<?> |
ExceptionHandlerConfig.paramExceptionHandler(ParamException e)
参数效验未通过统一处理
|
Result<?> |
ExceptionHandlerConfig.paramVoidExceptionHandler()
参数效验为空统一处理
|
Result<?> |
ExceptionHandlerConfig.resultExceptionHandler(ResultException e)
异常结果处理
|
Result<?> |
ExceptionHandlerConfig.validateExceptionHandler(cn.hutool.core.exceptions.ValidateException e)
验证异常统一处理
|
| 构造器和说明 |
|---|
ResultException(Result<T> result) |
| 限定符和类型 | 方法和说明 |
|---|---|
static Result<?> |
ResultInfo.attack()
非法访问-100
|
static <T> Result<T> |
ResultInfo.attack(T data)
非法访问-100
|
static Result<?> |
ResultInfo.client_fallback_error()
哎哟喂!
|
static Result<?> |
ResultInfo.client_fallback()
哎哟喂!
|
static Result<?> |
ResultInfo.data_structure()
数据结构异常-501
|
static Result<?> |
ResultInfo.data_structure(int expected,
int actual)
数据结构异常-501
不正确的结果大小
|
static Result<?> |
ResultInfo.db_error()
数据结构异常,请检查相应数据结构一致性-502
|
static Result<?> |
ResultInfo.dev_defined(String msg)
自定义类型提示-msg
|
static Result<?> |
ResultInfo.error()
请求错误-500
|
static <T> Result<T> |
ResultInfo.error(T data)
请求错误-500
|
static Result<?> |
ResultInfo.file_empty()
文件上传请求错误,获得文件信息为空,同时文件必须有明确的匹配类型(如文本类型:.txt)-301
|
static Result<?> |
ResultInfo.forbidden()
无权限-103
|
static Result<?> |
ResultInfo.frequent_access_restriction()
频繁访问限制,请稍后重试-104
|
static Result<?> |
ResultInfo.logged_in()
会话未注销,无需登录-102
|
static Result<?> |
ResultInfo.param_check_not_pass()
参数校验未通过,请参照API核对后重试-401
|
static Result<String> |
ResultInfo.param_check_not_pass(String data)
参数校验未通过,请参照API核对后重试-401
|
static Result<?> |
ResultInfo.param_decrypt_error()
参数解密错误-403
|
static Result<?> |
ResultInfo.param_value_invalid()
参数校验未通过,无效的value-402
|
static Result<String> |
ResultInfo.param_value_invalid(String data)
参数校验未通过,无效的value-402
|
static Result<?> |
ResultInfo.param_void()
参数为空-400
|
static Result<?> |
ResultInfo.resource_already_invalid()
资源已失效-300
|
static Result<?> |
ResultInfo.success()
成功后调用,返回的data为null
|
static <T> Result<T> |
ResultInfo.success(Integer code,
T data,
Long count)
成功后调用,分页查询
|
static <T> Result<T> |
ResultInfo.success(T data)
成功后调用,返回的data为一个对象
|
static <T> Result<T> |
ResultInfo.success(T data,
Long count)
成功后调用,分页查询
|
static Result<?> |
ResultInfo.type_convert_error(String data)
类型转换错误-302
|
static Result<?> |
ResultInfo.unauthorized()
未登录或登录已失效-101
|
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.