diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/ctrl/BladeController.java b/blade-core-boot/src/main/java/org/springblade/core/boot/ctrl/BladeController.java index 48cea25..0b5b122 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/ctrl/BladeController.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/ctrl/BladeController.java @@ -133,8 +133,8 @@ public class BladeController { * @param msg 消息 * @return R */ - public R failure(String msg) { - return R.failure(msg); + public R fail(String msg) { + return R.fail(msg); } /** diff --git a/blade-core-boot/src/main/resources/META-INF/spring-devtools.properties b/blade-core-boot/src/main/resources/META-INF/spring-devtools.properties deleted file mode 100644 index 785b4fb..0000000 --- a/blade-core-boot/src/main/resources/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.blade-core-boot=/blade-core-boot[\\w-]+\.jar diff --git a/blade-core-boot/src/main/resources/META-INF/spring.factories b/blade-core-boot/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 40192f5..0000000 --- a/blade-core-boot/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,7 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.core.boot.config.MybatisPlusConfiguration,\ - org.springblade.core.boot.logger.RequestLogAspect,\ - org.springblade.core.boot.config.RetryConfiguration,\ - org.springblade.core.boot.config.BladeWebMvcConfiguration,\ - org.springblade.core.boot.config.BladeBootAutoConfiguration,\ - org.springblade.core.boot.config.RedisTemplateConfiguration diff --git a/blade-core-launch/src/main/resources/META-INF/spring-devtools.properties b/blade-core-launch/src/main/resources/META-INF/spring-devtools.properties deleted file mode 100644 index 83627c5..0000000 --- a/blade-core-launch/src/main/resources/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.blade-core-launch=/blade-core-launch[\\w-]+\.jar diff --git a/blade-core-launch/src/main/resources/META-INF/spring.factories b/blade-core-launch/src/main/resources/META-INF/spring.factories deleted file mode 100644 index a7c7070..0000000 --- a/blade-core-launch/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,4 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.core.launch.config.BladeLaunchConfiguration,\ - org.springblade.core.launch.StartEventListener,\ - org.springblade.core.launch.config.BladeConsulServiceRegistryConfiguration diff --git a/blade-core-log/src/main/java/org/springblade/core/log/error/BladeErrorAttributes.java b/blade-core-log/src/main/java/org/springblade/core/log/error/BladeErrorAttributes.java index 49c8550..261869a 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/error/BladeErrorAttributes.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/error/BladeErrorAttributes.java @@ -43,10 +43,10 @@ public class BladeErrorAttributes extends DefaultErrorAttributes { R result; if (error == null) { log.error("URL:{} error status:{}", requestUri, status); - result = R.failure(ResultCode.FAILURE, "系统未知异常[HttpStatus]:" + status); + result = R.fail(ResultCode.FAILURE, "系统未知异常[HttpStatus]:" + status); } else { log.error(String.format("URL:%s error status:%d", requestUri, status), error); - result = R.failure(status, error.getMessage()); + result = R.fail(status, error.getMessage()); } //发送服务异常事件 ErrorLogPublisher.publishEvent(error, requestUri); diff --git a/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java b/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java index cbd3066..bc551be 100644 --- a/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java +++ b/blade-core-log/src/main/java/org/springblade/core/log/error/BladeRestExceptionTranslator.java @@ -66,7 +66,7 @@ public class BladeRestExceptionTranslator { public R handleError(MissingServletRequestParameterException e) { log.warn("缺少请求参数", e.getMessage()); String message = String.format("缺少必要的请求参数: %s", e.getParameterName()); - return R.failure(ResultCode.PARAM_MISS, message); + return R.fail(ResultCode.PARAM_MISS, message); } @ExceptionHandler(MethodArgumentTypeMismatchException.class) @@ -74,7 +74,7 @@ public class BladeRestExceptionTranslator { public R handleError(MethodArgumentTypeMismatchException e) { log.warn("请求参数格式错误", e.getMessage()); String message = String.format("请求参数格式错误: %s", e.getName()); - return R.failure(ResultCode.PARAM_TYPE_ERROR, message); + return R.fail(ResultCode.PARAM_TYPE_ERROR, message); } @ExceptionHandler(MethodArgumentNotValidException.class) @@ -94,7 +94,7 @@ public class BladeRestExceptionTranslator { private R handleError(BindingResult result) { FieldError error = result.getFieldError(); String message = String.format("%s:%s", error.getField(), error.getDefaultMessage()); - return R.failure(ResultCode.PARAM_BIND_ERROR, message); + return R.fail(ResultCode.PARAM_BIND_ERROR, message); } @ExceptionHandler(ConstraintViolationException.class) @@ -105,49 +105,49 @@ public class BladeRestExceptionTranslator { ConstraintViolation violation = violations.iterator().next(); String path = ((PathImpl) violation.getPropertyPath()).getLeafNode().getName(); String message = String.format("%s:%s", path, violation.getMessage()); - return R.failure(ResultCode.PARAM_VALID_ERROR, message); + return R.fail(ResultCode.PARAM_VALID_ERROR, message); } @ExceptionHandler(NoHandlerFoundException.class) @ResponseStatus(HttpStatus.NOT_FOUND) public R handleError(NoHandlerFoundException e) { log.error("404没找到请求:{}", e.getMessage()); - return R.failure(ResultCode.NOT_FOUND, e.getMessage()); + return R.fail(ResultCode.NOT_FOUND, e.getMessage()); } @ExceptionHandler(HttpMessageNotReadableException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) public R handleError(HttpMessageNotReadableException e) { log.error("消息不能读取:{}", e.getMessage()); - return R.failure(ResultCode.MSG_NOT_READABLE, e.getMessage()); + return R.fail(ResultCode.MSG_NOT_READABLE, e.getMessage()); } @ExceptionHandler(HttpRequestMethodNotSupportedException.class) @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) public R handleError(HttpRequestMethodNotSupportedException e) { log.error("不支持当前请求方法:{}", e.getMessage()); - return R.failure(ResultCode.METHOD_NOT_SUPPORTED, e.getMessage()); + return R.fail(ResultCode.METHOD_NOT_SUPPORTED, e.getMessage()); } @ExceptionHandler(HttpMediaTypeNotSupportedException.class) @ResponseStatus(HttpStatus.UNSUPPORTED_MEDIA_TYPE) public R handleError(HttpMediaTypeNotSupportedException e) { log.error("不支持当前媒体类型:{}", e.getMessage()); - return R.failure(ResultCode.MEDIA_TYPE_NOT_SUPPORTED, e.getMessage()); + return R.fail(ResultCode.MEDIA_TYPE_NOT_SUPPORTED, e.getMessage()); } @ExceptionHandler(ServiceException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) public R handleError(ServiceException e) { log.error("业务异常", e); - return R.failure(e.getResultCode(), e.getMessage()); + return R.fail(e.getResultCode(), e.getMessage()); } @ExceptionHandler(SecureException.class) @ResponseStatus(HttpStatus.UNAUTHORIZED) public R handleError(SecureException e) { log.error("认证异常", e); - return R.failure(e.getResultCode(), e.getMessage()); + return R.fail(e.getResultCode(), e.getMessage()); } @ExceptionHandler(Throwable.class) @@ -156,7 +156,7 @@ public class BladeRestExceptionTranslator { log.error("服务器异常", e); //发送服务异常事件 ErrorLogPublisher.publishEvent(e, UrlUtil.getPath(WebUtil.getRequest().getRequestURI())); - return R.failure(ResultCode.INTERNAL_SERVER_ERROR, (Func.isEmpty(e.getMessage()) ? ResultCode.INTERNAL_SERVER_ERROR.getMessage() : e.getMessage())); + return R.fail(ResultCode.INTERNAL_SERVER_ERROR, (Func.isEmpty(e.getMessage()) ? ResultCode.INTERNAL_SERVER_ERROR.getMessage() : e.getMessage())); } } diff --git a/blade-core-log/src/main/resources/META-INF/spring-devtools.properties b/blade-core-log/src/main/resources/META-INF/spring-devtools.properties deleted file mode 100644 index dff854a..0000000 --- a/blade-core-log/src/main/resources/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.blade-core-log=/blade-core-log[\\w-]+\.jar diff --git a/blade-core-log/src/main/resources/META-INF/spring.factories b/blade-core-log/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 3097701..0000000 --- a/blade-core-log/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,4 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.core.log.config.BladeLogToolAutoConfiguration,\ - org.springblade.core.log.config.BladeErrorMvcAutoConfiguration,\ - org.springblade.core.log.error.BladeRestExceptionTranslator diff --git a/blade-core-secure/src/main/java/org/springblade/core/secure/interceptor/SecureInterceptor.java b/blade-core-secure/src/main/java/org/springblade/core/secure/interceptor/SecureInterceptor.java index 9046384..0834571 100644 --- a/blade-core-secure/src/main/java/org/springblade/core/secure/interceptor/SecureInterceptor.java +++ b/blade-core-secure/src/main/java/org/springblade/core/secure/interceptor/SecureInterceptor.java @@ -44,7 +44,7 @@ public class SecureInterceptor extends HandlerInterceptorAdapter { return true; } else { log.warn("签名认证失败,请求接口:{},请求IP:{},请求参数:{}", request.getRequestURI(), WebUtil.getIP(request), JsonUtil.toJson(request.getParameterMap())); - R result = R.failure(ResultCode.UN_AUTHORIZED); + R result = R.fail(ResultCode.UN_AUTHORIZED); response.setCharacterEncoding(StringPool.UTF_8); response.setHeader("Content-type", MediaType.APPLICATION_JSON_UTF8_VALUE); response.setStatus(HttpServletResponse.SC_OK); diff --git a/blade-core-secure/src/main/resources/META-INF/spring-devtools.properties b/blade-core-secure/src/main/resources/META-INF/spring-devtools.properties deleted file mode 100644 index 9773f18..0000000 --- a/blade-core-secure/src/main/resources/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.blade-core-secure=/blade-core-secure[\\w-]+\.jar diff --git a/blade-core-secure/src/main/resources/META-INF/spring.factories b/blade-core-secure/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 4cf6dfd..0000000 --- a/blade-core-secure/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,3 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.core.secure.config.RegistryConfiguration,\ - org.springblade.core.secure.config.SecureConfiguration diff --git a/blade-core-swagger/src/main/resources/META-INF/spring.factories b/blade-core-swagger/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 7af0f77..0000000 --- a/blade-core-swagger/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.core.swagger.SwaggerAutoConfiguration diff --git a/blade-core-tool/src/main/java/org/springblade/core/tool/api/R.java b/blade-core-tool/src/main/java/org/springblade/core/tool/api/R.java index a042a51..06b4474 100644 --- a/blade-core-tool/src/main/java/org/springblade/core/tool/api/R.java +++ b/blade-core-tool/src/main/java/org/springblade/core/tool/api/R.java @@ -171,7 +171,7 @@ public class R implements Serializable { * @param T 泛型标记 * @return R */ - public static R failure(String msg) { + public static R fail(String msg) { return new R<>(ResultCode.FAILURE, msg); } @@ -184,7 +184,7 @@ public class R implements Serializable { * @param T 泛型标记 * @return R */ - public static R failure(int code, String msg) { + public static R fail(int code, String msg) { return new R<>(code, null, msg); } @@ -195,7 +195,7 @@ public class R implements Serializable { * @param T 泛型标记 * @return R */ - public static R failure(IResultCode resultCode) { + public static R fail(IResultCode resultCode) { return new R<>(resultCode); } @@ -207,7 +207,7 @@ public class R implements Serializable { * @param T 泛型标记 * @return R */ - public static R failure(IResultCode resultCode, String msg) { + public static R fail(IResultCode resultCode, String msg) { return new R<>(resultCode, msg); } @@ -218,7 +218,7 @@ public class R implements Serializable { * @return R */ public static R status(boolean flag) { - return flag ? success(BladeConstant.DEFAULT_SUCCESS_MESSAGE) : failure(BladeConstant.DEFAULT_FAILURE_MESSAGE); + return flag ? success(BladeConstant.DEFAULT_SUCCESS_MESSAGE) : fail(BladeConstant.DEFAULT_FAILURE_MESSAGE); } } diff --git a/blade-core-tool/src/main/resources/META-INF/spring-devtools.properties b/blade-core-tool/src/main/resources/META-INF/spring-devtools.properties deleted file mode 100644 index b252d0a..0000000 --- a/blade-core-tool/src/main/resources/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.blade-core-tool=/blade-core-tool[\\w-]+\.jar diff --git a/blade-core-tool/src/main/resources/META-INF/spring.factories b/blade-core-tool/src/main/resources/META-INF/spring.factories deleted file mode 100644 index e9d7490..0000000 --- a/blade-core-tool/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,4 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.core.tool.config.ToolConfiguration,\ - org.springblade.core.tool.config.JacksonConfiguration,\ - org.springblade.core.tool.config.MessageConfiguration diff --git a/pom.xml b/pom.xml index d406e50..f41f258 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ - 1.0.0-RC3 + 1.0.0-RC4 1.8 3.8.0 @@ -143,6 +143,11 @@ spring-boot-devtools true + + net.dreamlu + mica-auto + 0.0.1 +