From fd9096bb5b1c48e5b2ef67439d475fa6970ce8b9 Mon Sep 17 00:00:00 2001
From: herodotus
Date: Wed, 18 Aug 2021 18:42:40 +0800
Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20v2.5.4.55=201.=20=E6=95=B4?=
=?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=B0=86constant=E5=8C=85?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=95=B4=E5=90=88=E8=87=B3common=E5=8C=85?=
=?UTF-8?q?=E4=B8=AD=E3=80=82=E5=88=A0=E9=99=A4constant=E5=8C=85=E3=80=82?=
=?UTF-8?q?=202.=20=E5=AE=8C=E5=96=84Rest=E6=8E=A5=E5=8F=A3=E6=A0=A1?=
=?UTF-8?q?=E9=AA=8C=E6=9C=BA=E5=88=B6=EF=BC=8C=E4=BB=A5=E5=8F=8A=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E8=87=AA=E5=AE=9A=E4=B9=89=E9=94=99=E8=AF=AF=E7=A0=81?=
=?UTF-8?q?=203.=20=E7=BB=9F=E4=B8=80spring=20boot=20validation=E9=94=99?=
=?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=B0=86=E5=85=B6=E6=95=B4?=
=?UTF-8?q?=E5=90=88=E8=87=B3=E5=B9=B3=E5=8F=B0=E7=BB=9F=E4=B8=80=E5=93=8D?=
=?UTF-8?q?=E5=BA=94=E5=AE=9E=E4=BD=93Result=E4=B8=AD=E3=80=82=E6=97=A0?=
=?UTF-8?q?=E9=A1=BB=E5=9C=A8=E5=90=84=E4=B8=AARest=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E4=B8=AD=EF=BC=8C=E6=B7=BB=E5=8A=A0BindingResult=E5=8F=82?=
=?UTF-8?q?=E6=95=B0=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 2 +-
.../docker/docker-compose/herodotus/.env | 2 +-
dependencies/pom.xml | 7 +-
packages/eurynome-cloud-assistant/pom.xml | 8 +-
.../annotation/ConditionalOnKafkaEnabled.java | 2 +-
.../exception/HerodotusExceptionHandler.java} | 25 +--
.../platform}/IllegalArgumentException.java | 8 +-
.../platform}/PlatformException.java | 10 +-
.../assistant/utils/PropertyResolver.java | 4 +-
packages/eurynome-cloud-common/pom.xml | 44 ++++-
.../common}/constant/enums/AccountType.java | 2 +-
.../constant/enums/ApplicationType.java | 2 +-
.../common}/constant/enums/Architecture.java | 2 +-
.../common}/constant/enums/AuthorityType.java | 2 +-
.../constant/enums/DataAccessStrategy.java | 2 +-
.../common}/constant/enums/GrantType.java | 4 +-
.../constant/enums/OAuth2Expression.java | 2 +-
.../common}/constant/enums/ProtocolType.java | 2 +-
.../common}/constant/enums/ResultStatus.java | 3 +-
.../common}/constant/enums/StatusEnum.java | 2 +-
.../constant/enums/captcha/CaptchaFont.java | 2 +-
.../enums/captcha/CaptchaLetterType.java | 2 +-
.../constant/enums/captcha/CaptchaType.java | 2 +-
.../constant/magic/CacheConstants.java | 2 +-
.../constant/magic/PlatformConstants.java | 2 +-
.../constant/magic/PropertyConstants.java | 2 +-
.../constant/magic/SecurityConstants.java | 4 +-
.../constant/magic/SecurityExpression.java | 2 +-
.../constant/magic/ServiceConstants.java | 2 +-
.../constant/magic/SymbolConstants.java | 2 +-
.../eurynome/common/domain/Error.java | 93 ++++++++++
.../eurynome/common/domain/Result.java | 37 +++-
.../eurynome/common/domain/TreeNode.java | 93 ----------
.../deserializer/StatusEnumDeserializer.java | 2 +-
.../eurynome/common/utils/ConvertUtils.java | 4 +-
.../common/utils/JacksonYamlUtils.java | 2 +-
.../eurynome/common/utils/OkHttpUtils.java | 170 ------------------
.../eurynome/common/utils/TreeUtils.java | 79 --------
packages/eurynome-cloud-constant/pom.xml | 76 --------
packages/eurynome-cloud-crud/pom.xml | 4 +-
.../BaseReadableRestController.java | 12 +-
.../crud/service/AbstractCacheService.java | 2 +-
packages/eurynome-cloud-data/pom.xml | 4 +-
.../data/base/entity/BaseAppEntity.java | 2 +-
.../data/base/entity/BaseSysEntity.java | 2 +-
.../data/cache/query/AbstractCache.java | 4 +-
.../data/properties/CacheProperties.java | 2 +-
.../data/properties/QueueProperties.java | 2 +-
packages/eurynome-cloud-kernel/pom.xml | 4 +-
.../properties/ManagementProperties.java | 2 +-
packages/eurynome-cloud-oauth-starter/pom.xml | 4 +-
.../HerodotusOauthClientDetailsService.java | 2 +-
packages/eurynome-cloud-oauth/pom.xml | 4 +-
.../VerificationCodeController.java | 2 +-
.../eurynome/oauth/utils/SymmetricUtils.java | 2 +-
.../src/main/resources/templates/error.html | 2 +-
packages/eurynome-cloud-rest/pom.xml | 6 +-
.../eurynome/rest/base/business/Pager.java | 71 ++++++++
.../configuration/SwaggerConfiguration.java | 4 +-
.../rest/properties/PlatformProperties.java | 12 +-
.../rest/properties/RestProperties.java | 3 +-
.../rest/properties/ServiceProperties.java | 4 +-
packages/eurynome-cloud-security/pom.xml | 4 +-
.../access/RequestMappingScanner.java | 8 +-
.../token/HerodotusJwtTokenEnhancer.java | 2 +-
.../SecurityAutoConfiguration.java | 2 +
.../definition/domain/RequestMapping.java | 2 +-
.../properties/SecurityProperties.java | 10 +-
.../SecurityGlobalExceptionHandler.java | 48 ++++-
.../service/RequestMappingGatherService.java | 2 +-
.../eurynome/security/utils/WebUtils.java | 2 +-
packages/eurynome-cloud-starter/pom.xml | 4 +-
packages/pom.xml | 3 +-
platform/eurynome-cloud-gateway/pom.xml | 4 +-
.../GatewayGlobalExceptionHandler.java | 6 +-
.../filter/GlobalCertificationFilter.java | 4 +-
platform/eurynome-cloud-management/pom.xml | 4 +-
platform/eurynome-cloud-uaa/pom.xml | 4 +-
platform/pom.xml | 2 +-
pom.xml | 4 +-
services/eurynome-cloud-bpmn-ability/pom.xml | 4 +-
services/eurynome-cloud-bpmn-rest/pom.xml | 4 +-
services/eurynome-cloud-upms-ability/pom.xml | 4 +-
services/eurynome-cloud-upms-api/pom.xml | 4 +-
.../upms/api/constants/UpmsConstants.java | 10 +-
.../api/entity/oauth/OauthClientDetails.java | 2 +-
.../upms/api/entity/system/SysAuthority.java | 2 +-
.../api/entity/system/SysDefaultRole.java | 2 +-
.../eurynome/upms/api/helper/UpmsHelper.java | 4 +-
services/eurynome-cloud-upms-logic/pom.xml | 4 +-
.../system/SysAuthorityRepository.java | 2 +-
.../system/SysDefaultRoleRepository.java | 2 +-
.../service/system/SysAuthorityService.java | 2 +-
.../service/system/SysDefaultRoleService.java | 2 +-
services/eurynome-cloud-upms-rest/pom.xml | 4 +-
.../system/SysAuthorityController.java | 18 +-
services/pom.xml | 2 +-
97 files changed, 440 insertions(+), 616 deletions(-)
rename packages/{eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/GlobalExceptionHandler.java => eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/HerodotusExceptionHandler.java} (94%)
rename packages/{eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception => eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/platform}/IllegalArgumentException.java (87%)
rename packages/{eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception => eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/platform}/PlatformException.java (85%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/AccountType.java (99%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/ApplicationType.java (98%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/Architecture.java (95%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/AuthorityType.java (98%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/DataAccessStrategy.java (95%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/GrantType.java (95%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/OAuth2Expression.java (98%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/ProtocolType.java (96%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/ResultStatus.java (98%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/StatusEnum.java (98%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/captcha/CaptchaFont.java (96%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/captcha/CaptchaLetterType.java (95%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/enums/captcha/CaptchaType.java (94%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/magic/CacheConstants.java (97%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/magic/PlatformConstants.java (95%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/magic/PropertyConstants.java (98%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/magic/SecurityConstants.java (95%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/magic/SecurityExpression.java (95%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/magic/ServiceConstants.java (95%)
rename packages/{eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome => eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common}/constant/magic/SymbolConstants.java (98%)
create mode 100644 packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/Error.java
delete mode 100644 packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/TreeNode.java
delete mode 100644 packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/OkHttpUtils.java
delete mode 100644 packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/TreeUtils.java
delete mode 100644 packages/eurynome-cloud-constant/pom.xml
create mode 100644 packages/eurynome-cloud-rest/src/main/java/cn/herodotus/eurynome/rest/base/business/Pager.java
diff --git a/README.md b/README.md
index 7992f852e..0f8dbc7a5 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@
-
+
diff --git a/configurations/docker/docker-compose/herodotus/.env b/configurations/docker/docker-compose/herodotus/.env
index 9c6a7af0d..04702d7d4 100644
--- a/configurations/docker/docker-compose/herodotus/.env
+++ b/configurations/docker/docker-compose/herodotus/.env
@@ -1,4 +1,4 @@
-VERSION=2.5.4.50
+VERSION=2.5.4.55
GATEWAY_SERVICE_NAME=eurynome-cloud-gateway
GATEWAY_SERVICE_PORT=8847
UAA_SERVICE_NAME=eurynome-cloud-uaa
diff --git a/dependencies/pom.xml b/dependencies/pom.xml
index e1f7db388..9aacc209f 100644
--- a/dependencies/pom.xml
+++ b/dependencies/pom.xml
@@ -35,7 +35,7 @@
cn.herodotus.eurynome
dependencies
- 2.5.4.50
+ 2.5.4.55
pom
eurynome-cloud-dependencies
@@ -124,11 +124,6 @@
${spring-boot-admin.version}
-
- ${project.groupId}
- eurynome-cloud-constant
- ${project.version}
-
${project.groupId}
eurynome-cloud-common
diff --git a/packages/eurynome-cloud-assistant/pom.xml b/packages/eurynome-cloud-assistant/pom.xml
index 35fff5220..ee30e63f3 100644
--- a/packages/eurynome-cloud-assistant/pom.xml
+++ b/packages/eurynome-cloud-assistant/pom.xml
@@ -27,7 +27,7 @@
packages
cn.herodotus.eurynome
- 2.5.4.50
+ 2.5.4.55
4.0.0
@@ -47,7 +47,7 @@
org.springframework.boot
- spring-boot-starter
+ spring-boot-starter-validation
@@ -55,9 +55,5 @@
spring-cloud-starter-bus-kafka
-
- org.springframework.cloud
- spring-cloud-stream-binder-kafka
-
\ No newline at end of file
diff --git a/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/annotation/ConditionalOnKafkaEnabled.java b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/annotation/ConditionalOnKafkaEnabled.java
index 4f27d9d32..767dff272 100644
--- a/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/annotation/ConditionalOnKafkaEnabled.java
+++ b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/annotation/ConditionalOnKafkaEnabled.java
@@ -22,7 +22,7 @@
package cn.herodotus.eurynome.assistant.annotation;
-import cn.herodotus.eurynome.constant.magic.PropertyConstants;
+import cn.herodotus.eurynome.common.constant.magic.PropertyConstants;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import java.lang.annotation.*;
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/GlobalExceptionHandler.java b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/HerodotusExceptionHandler.java
similarity index 94%
rename from packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/GlobalExceptionHandler.java
rename to packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/HerodotusExceptionHandler.java
index fc814e97f..c3f8005e6 100644
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/GlobalExceptionHandler.java
+++ b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/HerodotusExceptionHandler.java
@@ -20,13 +20,14 @@
* Date: 2021/05/07 11:28:07
*/
-package cn.herodotus.eurynome.common.exception;
+package cn.herodotus.eurynome.assistant.exception;
+import cn.herodotus.eurynome.common.constant.enums.ResultStatus;
import cn.herodotus.eurynome.common.domain.Result;
-import cn.herodotus.eurynome.constant.enums.ResultStatus;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
@@ -36,8 +37,9 @@
*
* @author gengwei.zheng
*/
-@Slf4j
-public class GlobalExceptionHandler {
+public class HerodotusExceptionHandler {
+
+ private static final Logger log = LoggerFactory.getLogger(HerodotusExceptionHandler.class);
private static final Map> EXCEPTION_DICTIONARY = new HashMap<>();
@@ -112,6 +114,8 @@ public class GlobalExceptionHandler {
// 6*.** 对应错误
EXCEPTION_DICTIONARY.put("BadSqlGrammarException", getResult(ResultStatus.BAD_SQL_GRAMMAR));
EXCEPTION_DICTIONARY.put("DataIntegrityViolationException", getResult(ResultStatus.DATA_INTEGRITY_VIOLATION));
+ EXCEPTION_DICTIONARY.put("BindException", getValidationResult(ResultStatus.METHOD_ARGUMENT_NOT_VALID));
+ EXCEPTION_DICTIONARY.put("MethodArgumentNotValidException", getValidationResult(ResultStatus.METHOD_ARGUMENT_NOT_VALID));
// 7*.** 对应错误
EXCEPTION_DICTIONARY.put("RedisPipelineException", getResult(ResultStatus.PIPELINE_INVALID_COMMANDS, HttpStatus.SC_INTERNAL_SERVER_ERROR));
// 以下是没有重新梳理过的错误。
@@ -136,9 +140,6 @@ public class GlobalExceptionHandler {
EXCEPTION_DICTIONARY.put("HttpMediaTypeNotAcceptableException", getBadRequestResult(ResultStatus.MEDIA_TYPE_NOT_ACCEPTABLE));
EXCEPTION_DICTIONARY.put("IllegalArgumentException", getBadRequestResult(ResultStatus.WARNING));
-
-
- EXCEPTION_DICTIONARY.put("MethodArgumentNotValidException", getResult(ResultStatus.WARNING));
}
@@ -150,6 +151,10 @@ private static Result getUnauthorizedResult(ResultStatus resultCode) {
return getResult(resultCode, HttpStatus.SC_UNAUTHORIZED);
}
+ private static Result getValidationResult(ResultStatus resultCode) {
+ return getResult(resultCode, HttpStatus.SC_NOT_ACCEPTABLE);
+ }
+
private static Result getResult(ResultStatus resultCode) {
return getResult(resultCode, HttpStatus.SC_INTERNAL_SERVER_ERROR);
}
@@ -174,8 +179,8 @@ public static Result resolveException(Exception ex, String path) {
}
result.path(path);
- result.error(ex);
- result.data(ex.getMessage());
+ result.stackTrace(new StackTraceElement[]{});
+ result.detail(ex.getMessage());
log.debug("[Eurynome] |- Global Exception Handler, Error is : {}", result);
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/IllegalArgumentException.java b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/platform/IllegalArgumentException.java
similarity index 87%
rename from packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/IllegalArgumentException.java
rename to packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/platform/IllegalArgumentException.java
index 1d8d3739f..fccfaf00c 100644
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/IllegalArgumentException.java
+++ b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/platform/IllegalArgumentException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2021 Gengwei Zheng(herodotus@aliyun.com)
+ * Copyright (c) 2019-2021 Gengwei Zheng (herodotus@aliyun.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,13 +14,13 @@
* limitations under the License.
*
* Project Name: eurynome-cloud
- * Module Name: eurynome-cloud-common
+ * Module Name: eurynome-cloud-assistant
* File Name: IllegalArgumentException.java
* Author: gengwei.zheng
- * Date: 2021/05/07 11:28:07
+ * Date: 2021/08/18 17:52:18
*/
-package cn.herodotus.eurynome.common.exception;
+package cn.herodotus.eurynome.assistant.exception.platform;
/**
* Description : 非法参数错误
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/PlatformException.java b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/platform/PlatformException.java
similarity index 85%
rename from packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/PlatformException.java
rename to packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/platform/PlatformException.java
index fed9cf7cd..aeadc5a52 100644
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/exception/PlatformException.java
+++ b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/exception/platform/PlatformException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2021 Gengwei Zheng(herodotus@aliyun.com)
+ * Copyright (c) 2019-2021 Gengwei Zheng (herodotus@aliyun.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,15 +14,15 @@
* limitations under the License.
*
* Project Name: eurynome-cloud
- * Module Name: eurynome-cloud-common
+ * Module Name: eurynome-cloud-assistant
* File Name: PlatformException.java
* Author: gengwei.zheng
- * Date: 2021/05/07 11:28:07
+ * Date: 2021/08/18 17:52:18
*/
-package cn.herodotus.eurynome.common.exception;
+package cn.herodotus.eurynome.assistant.exception.platform;
-import cn.herodotus.eurynome.constant.enums.ResultStatus;
+import cn.herodotus.eurynome.common.constant.enums.ResultStatus;
/**
* Description: 平台基础Exception
diff --git a/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/utils/PropertyResolver.java b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/utils/PropertyResolver.java
index aa36caf37..299bad7ff 100644
--- a/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/utils/PropertyResolver.java
+++ b/packages/eurynome-cloud-assistant/src/main/java/cn/herodotus/eurynome/assistant/utils/PropertyResolver.java
@@ -22,8 +22,8 @@
package cn.herodotus.eurynome.assistant.utils;
-import cn.herodotus.eurynome.constant.magic.PlatformConstants;
-import cn.herodotus.eurynome.constant.magic.PropertyConstants;
+import cn.herodotus.eurynome.common.constant.magic.PlatformConstants;
+import cn.herodotus.eurynome.common.constant.magic.PropertyConstants;
import org.springframework.core.env.Environment;
/**
diff --git a/packages/eurynome-cloud-common/pom.xml b/packages/eurynome-cloud-common/pom.xml
index e5fbb222f..b41efb368 100644
--- a/packages/eurynome-cloud-common/pom.xml
+++ b/packages/eurynome-cloud-common/pom.xml
@@ -29,20 +29,16 @@
packages
cn.herodotus.eurynome
- 2.5.4.50
+ 2.5.4.55
eurynome-cloud-common
- 2.5.4.50
+ 2.5.4.55
jar
结对基础通用的工具类包,此包的定位是放在任何工程中都可以使用,而且尽可能依赖少的存在上下文组件
-
- ${project.groupId}
- eurynome-cloud-constant
-
commons-beanutils
commons-beanutils
@@ -85,7 +81,43 @@
guava
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+
+ io.springfox
+ springfox-swagger2
+
+
+ io.swagger
+ swagger-annotations
+
+
+ io.swagger
+ swagger-models
+
+
+
+
+ io.swagger
+ swagger-annotations
+
+
+ io.swagger
+ swagger-models
+
+
+
+ com.github.whvcse
+ easy-captcha
+
+
+ me.zhyd.oauth
+ JustAuth
+
\ No newline at end of file
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/AccountType.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/AccountType.java
similarity index 99%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/AccountType.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/AccountType.java
index e2e6fc46d..3d81a7fe2 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/AccountType.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/AccountType.java
@@ -20,7 +20,7 @@
* Date: 2021/08/05 18:32:05
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
/**
* Description: TODO
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ApplicationType.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ApplicationType.java
similarity index 98%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ApplicationType.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ApplicationType.java
index f0bf381a7..2323ea679 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ApplicationType.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ApplicationType.java
@@ -20,7 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
import com.fasterxml.jackson.annotation.JsonValue;
import com.google.common.collect.ImmutableMap;
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/Architecture.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/Architecture.java
similarity index 95%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/Architecture.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/Architecture.java
index 5c02c688c..6bdb848f3 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/Architecture.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/Architecture.java
@@ -20,7 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
/**
* Description : 用于区分是单体应用还是微服务应用
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/AuthorityType.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/AuthorityType.java
similarity index 98%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/AuthorityType.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/AuthorityType.java
index 0e6da484b..43e0f0c42 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/AuthorityType.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/AuthorityType.java
@@ -20,7 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/DataAccessStrategy.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/DataAccessStrategy.java
similarity index 95%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/DataAccessStrategy.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/DataAccessStrategy.java
index dc6ad63f6..c3c426a62 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/DataAccessStrategy.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/DataAccessStrategy.java
@@ -20,7 +20,7 @@
* Date: 2021/07/28 19:07:28
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
/**
* Description: 数据访问策略枚举类型
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/GrantType.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/GrantType.java
similarity index 95%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/GrantType.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/GrantType.java
index d57255a51..e4adb953a 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/GrantType.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/GrantType.java
@@ -20,9 +20,9 @@
* Date: 2021/08/07 20:07:07
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
-import cn.herodotus.eurynome.constant.magic.SecurityConstants;
+import cn.herodotus.eurynome.common.constant.magic.SecurityConstants;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/OAuth2Expression.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/OAuth2Expression.java
similarity index 98%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/OAuth2Expression.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/OAuth2Expression.java
index 60bf0e51f..fcf8374a7 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/OAuth2Expression.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/OAuth2Expression.java
@@ -20,7 +20,7 @@
* Date: 2021/08/14 06:50:14
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
import com.google.common.collect.ImmutableMap;
import io.swagger.annotations.ApiModelProperty;
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ProtocolType.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ProtocolType.java
similarity index 96%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ProtocolType.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ProtocolType.java
index bb4a84d59..ebed80be0 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ProtocolType.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ProtocolType.java
@@ -20,7 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
/**
* Description: Protocol枚举
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ResultStatus.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ResultStatus.java
similarity index 98%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ResultStatus.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ResultStatus.java
index 0865f695b..2ec3fa869 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/ResultStatus.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/ResultStatus.java
@@ -20,7 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -81,6 +81,7 @@ public enum ResultStatus {
*/
BAD_SQL_GRAMMAR(6000, "低级SQL语法错误,检查SQL能否正常运行或者字段名称是否正确"),
DATA_INTEGRITY_VIOLATION(6200, "该数据正在被其它数据引用,请先删除引用关系,再进行数据删除操作"),
+ METHOD_ARGUMENT_NOT_VALID(6300, "接口参数校验错误"),
/**
* 7*.* 基础设施交互错误
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/StatusEnum.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/StatusEnum.java
similarity index 98%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/StatusEnum.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/StatusEnum.java
index 197e28dae..cad1acabd 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/StatusEnum.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/StatusEnum.java
@@ -20,7 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.enums;
+package cn.herodotus.eurynome.common.constant.enums;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaFont.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaFont.java
similarity index 96%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaFont.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaFont.java
index c8ce3eae1..a4a517842 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaFont.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaFont.java
@@ -20,7 +20,7 @@
* Date: 2021/05/07 11:28:07
*/
-package cn.herodotus.eurynome.constant.enums.captcha;
+package cn.herodotus.eurynome.common.constant.enums.captcha;
import com.wf.captcha.base.Captcha;
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaLetterType.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaLetterType.java
similarity index 95%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaLetterType.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaLetterType.java
index 07eb749df..972f58256 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaLetterType.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaLetterType.java
@@ -20,7 +20,7 @@
* Date: 2021/05/07 11:28:07
*/
-package cn.herodotus.eurynome.constant.enums.captcha;
+package cn.herodotus.eurynome.common.constant.enums.captcha;
import com.wf.captcha.base.Captcha;
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaType.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaType.java
similarity index 94%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaType.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaType.java
index f0a596543..87dec38ab 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/enums/captcha/CaptchaType.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/enums/captcha/CaptchaType.java
@@ -20,7 +20,7 @@
* Date: 2021/05/07 11:28:07
*/
-package cn.herodotus.eurynome.constant.enums.captcha;
+package cn.herodotus.eurynome.common.constant.enums.captcha;
/**
* Description : CaptchaType
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/CacheConstants.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/CacheConstants.java
similarity index 97%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/CacheConstants.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/CacheConstants.java
index f944a1329..33d3a31c4 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/CacheConstants.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/CacheConstants.java
@@ -20,7 +20,7 @@
* Date: 2021/08/07 20:09:07
*/
-package cn.herodotus.eurynome.constant.magic;
+package cn.herodotus.eurynome.common.constant.magic;
/**
* Description: 缓存相关常量
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/PlatformConstants.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/PlatformConstants.java
similarity index 95%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/PlatformConstants.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/PlatformConstants.java
index 66842f986..89c006c5a 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/PlatformConstants.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/PlatformConstants.java
@@ -20,7 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.magic;
+package cn.herodotus.eurynome.common.constant.magic;
/**
* Description: 系统常量
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/PropertyConstants.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/PropertyConstants.java
similarity index 98%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/PropertyConstants.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/PropertyConstants.java
index 1d97b40e2..4ac68c001 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/PropertyConstants.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/PropertyConstants.java
@@ -20,7 +20,7 @@
* Date: 2021/08/07 20:09:07
*/
-package cn.herodotus.eurynome.constant.magic;
+package cn.herodotus.eurynome.common.constant.magic;
/**
* Description: 平台涉及的各种Property值
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SecurityConstants.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SecurityConstants.java
similarity index 95%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SecurityConstants.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SecurityConstants.java
index b21d424cf..88541a82f 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SecurityConstants.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SecurityConstants.java
@@ -20,9 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.magic;
-
-import cn.herodotus.eurynome.constant.magic.SymbolConstants;
+package cn.herodotus.eurynome.common.constant.magic;
/**
* Description: 认证授权等安全相关常量值
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SecurityExpression.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SecurityExpression.java
similarity index 95%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SecurityExpression.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SecurityExpression.java
index 3fe1931ef..17d0822c2 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SecurityExpression.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SecurityExpression.java
@@ -20,7 +20,7 @@
* Date: 2021/08/05 18:32:05
*/
-package cn.herodotus.eurynome.constant.magic;
+package cn.herodotus.eurynome.common.constant.magic;
/**
* Description: 静态权限表达式
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/ServiceConstants.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/ServiceConstants.java
similarity index 95%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/ServiceConstants.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/ServiceConstants.java
index a317cb70c..fbbebf028 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/ServiceConstants.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/ServiceConstants.java
@@ -20,7 +20,7 @@
* Date: 2021/08/07 20:06:07
*/
-package cn.herodotus.eurynome.constant.magic;
+package cn.herodotus.eurynome.common.constant.magic;
/**
* Description: 服务相关常量
diff --git a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SymbolConstants.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SymbolConstants.java
similarity index 98%
rename from packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SymbolConstants.java
rename to packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SymbolConstants.java
index 91593379f..b35b012db 100644
--- a/packages/eurynome-cloud-constant/src/main/java/cn/herodotus/eurynome/constant/magic/SymbolConstants.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/constant/magic/SymbolConstants.java
@@ -20,7 +20,7 @@
* Date: 2021/06/29 15:58:29
*/
-package cn.herodotus.eurynome.constant.magic;
+package cn.herodotus.eurynome.common.constant.magic;
/**
* @author gengwei.zheng
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/Error.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/Error.java
new file mode 100644
index 000000000..79e4a34de
--- /dev/null
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/Error.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2019-2021 Gengwei Zheng (herodotus@aliyun.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Project Name: eurynome-cloud
+ * Module Name: eurynome-cloud-common
+ * File Name: Error.java
+ * Author: gengwei.zheng
+ * Date: 2021/08/18 18:12:18
+ */
+
+package cn.herodotus.eurynome.common.domain;
+
+import com.google.common.base.MoreObjects;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * Description: 错误详情
+ *
+ * @author : gengwei.zheng
+ * @date : 2021/8/18 18:12
+ */
+@ApiModel(description = "响应错误详情")
+public class Error implements Serializable {
+
+ @ApiModelProperty(value = "Exception完整信息")
+ private String detail;
+
+ @ApiModelProperty(value = "额外的错误信息,目前主要是Validation的Message")
+ private String message;
+
+ @ApiModelProperty(value = "额外的错误代码,目前主要是Validation的Code")
+ private String code;
+
+ @ApiModelProperty(value = "额外的错误字段,目前主要是Validation的Field")
+ private String field;
+
+ public String getDetail() {
+ return detail;
+ }
+
+ public void setDetail(String detail) {
+ this.detail = detail;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public String getField() {
+ return field;
+ }
+
+ public void setField(String field) {
+ this.field = field;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("detail", detail)
+ .add("message", message)
+ .add("code", code)
+ .add("field", field)
+ .toString();
+ }
+}
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/Result.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/Result.java
index 55d140068..eac2e31f9 100644
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/Result.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/Result.java
@@ -23,7 +23,7 @@
package cn.herodotus.eurynome.common.domain;
-import cn.herodotus.eurynome.constant.enums.ResultStatus;
+import cn.herodotus.eurynome.common.constant.enums.ResultStatus;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.base.MoreObjects;
import io.swagger.annotations.ApiModel;
@@ -60,12 +60,15 @@ public class Result implements Serializable {
private int status;
@ApiModelProperty(value = "错误堆栈信息")
- private Throwable error;
+ private StackTraceElement[] stackTrace;
@ApiModelProperty(value = "响应时间戳")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date timestamp = new Date();
+ @ApiModelProperty(value = "校验错误信息")
+ private Error error = new Error();
+
public Result() {
super();
}
@@ -90,12 +93,16 @@ public int getStatus() {
return status;
}
+ public StackTraceElement[] getStackTrace() {
+ return stackTrace;
+ }
+
public Date getTimestamp() {
return timestamp;
}
- public void setTimestamp(Date timestamp) {
- this.timestamp = timestamp;
+ public Error getError() {
+ return error;
}
public Result ok() {
@@ -143,8 +150,20 @@ public Result status(int httpStatus) {
return this;
}
- public Result error(Throwable error) {
- this.error = error;
+ public Result stackTrace(StackTraceElement[] stackTrace) {
+ this.stackTrace = stackTrace;
+ return this;
+ }
+
+ public Result detail(String detail) {
+ this.error.setDetail(detail);
+ return this;
+ }
+
+ public Result validation(String message, String code, String field) {
+ this.error.setMessage(message);
+ this.error.setCode(code);
+ this.error.setField(field);
return this;
}
@@ -156,8 +175,9 @@ public String toString() {
.add("path", path)
.add("data", data)
.add("status", status)
- .add("error", error)
+ .add("stackTrace", stackTrace)
.add("timestamp", timestamp)
+ .add("error", error)
.toString();
}
@@ -168,8 +188,9 @@ public Map toModel() {
result.put("path", path);
result.put("data", data);
result.put("status", status);
- result.put("error", error);
+ result.put("stackTrace", stackTrace);
result.put("timestamp", timestamp);
+ result.put("error", error);
return result;
}
}
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/TreeNode.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/TreeNode.java
deleted file mode 100644
index a8c6cb11c..000000000
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/domain/TreeNode.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2019-2021 Gengwei Zheng(herodotus@aliyun.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project Name: eurynome-cloud
- * Module Name: eurynome-cloud-common
- * File Name: TreeNode.java
- * Author: gengwei.zheng
- * Date: 2021/05/07 11:28:07
- */
-
-package cn.herodotus.eurynome.common.domain;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 属性结构定义
- *
- * @author gengwei.zheng
- */
-public class TreeNode implements Serializable {
-
- /**
- * 本节点id
- */
- private String id;
- /**
- * 本节点名称
- */
- private String name;
-
- /**
- * 本节点的父节点
- */
- private String parentId;
- private List children;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getParentId() {
- return parentId;
- }
-
- public void setParentId(String parentId) {
- this.parentId = parentId;
- }
-
- public List getChildren() {
- return children;
- }
-
- public void setChildren(List children) {
- this.children = children;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this)
- .append("id", id)
- .append("name", name)
- .append("parentId", parentId)
- .append("children", children)
- .toString();
- }
-}
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/jackson/deserializer/StatusEnumDeserializer.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/jackson/deserializer/StatusEnumDeserializer.java
index 07a89d012..e1c40c4d6 100644
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/jackson/deserializer/StatusEnumDeserializer.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/jackson/deserializer/StatusEnumDeserializer.java
@@ -22,7 +22,7 @@
package cn.herodotus.eurynome.common.jackson.deserializer;
-import cn.herodotus.eurynome.constant.enums.StatusEnum;
+import cn.herodotus.eurynome.common.constant.enums.StatusEnum;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/ConvertUtils.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/ConvertUtils.java
index ed04815a3..a8c77e6cd 100644
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/ConvertUtils.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/ConvertUtils.java
@@ -22,8 +22,8 @@
package cn.herodotus.eurynome.common.utils;
-import cn.herodotus.eurynome.constant.magic.SymbolConstants;
-import cn.herodotus.eurynome.constant.enums.ProtocolType;
+import cn.herodotus.eurynome.common.constant.magic.SymbolConstants;
+import cn.herodotus.eurynome.common.constant.enums.ProtocolType;
import org.apache.commons.lang3.StringUtils;
/**
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/JacksonYamlUtils.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/JacksonYamlUtils.java
index 03c07d405..3e97f95d3 100644
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/JacksonYamlUtils.java
+++ b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/JacksonYamlUtils.java
@@ -22,7 +22,7 @@
package cn.herodotus.eurynome.common.utils;
-import cn.herodotus.eurynome.constant.magic.SymbolConstants;
+import cn.herodotus.eurynome.common.constant.magic.SymbolConstants;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/OkHttpUtils.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/OkHttpUtils.java
deleted file mode 100644
index 735fd7343..000000000
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/OkHttpUtils.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2019-2021 Gengwei Zheng(herodotus@aliyun.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project Name: eurynome-cloud
- * Module Name: eurynome-cloud-common
- * File Name: OkHttpUtils.java
- * Author: gengwei.zheng
- * Date: 2021/05/07 11:28:07
- */
-
-package cn.herodotus.eurynome.common.utils;
-
-import com.alibaba.fastjson.JSON;
-import lombok.extern.slf4j.Slf4j;
-import okhttp3.*;
-import org.apache.commons.collections.MapUtils;
-import org.apache.commons.lang3.StringUtils;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Description: OkHttpUtils
- *
- * @author : gengwei.zheng
- * @date : 2020/2/29 17:06
- */
-@Slf4j
-public class OkHttpUtils {
-
- public static final String AMPERSAND = "&";
- public static final String EQUAL = "=";
- public static final String QUESTION = "?";
-
- /**
- * 懒汉 安全 加同步
- * 私有的静态成员变量 只声明不创建
- * 私有的构造方法
- * 提供返回实例的静态方法
- */
- private static OkHttpClient okHttpClient = null;
-
-
- private OkHttpUtils() {
- }
-
- public static OkHttpClient getInstance() {
- if (okHttpClient == null) {
- //加同步安全
- synchronized (OkHttpUtils.class) {
- if (okHttpClient == null) {
- okHttpClient = new OkHttpClient.Builder()
- .connectTimeout(15, TimeUnit.SECONDS)
- .writeTimeout(20, TimeUnit.SECONDS)
- .readTimeout(20, TimeUnit.SECONDS)
- .build();
- }
- }
-
- }
-
- return okHttpClient;
- }
-
- private static String addParamsToGetReqeust(String url, Map params) {
- StringBuilder sb = new StringBuilder(url);
- if (MapUtils.isNotEmpty(params)) {
- sb.append(QUESTION);
-
- for (Map.Entry entry : params.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
- sb.append(key);
- sb.append(EQUAL);
- sb.append(value);
- sb.append(AMPERSAND);
- }
-
- return StringUtils.removeEnd(sb.toString(), AMPERSAND);
- }
-
- return url;
- }
-
- public static String get(String url, Map params){
- return get(url, new HashMap<>(8), params);
- }
-
- /**
- * Get请求
- *
- * @param url URL地址
- * @return 返回结果
- */
- public static String get(String url, Map headers, Map params){
-
- String urlWithParams = addParamsToGetReqeust(url, params);
-
- Request.Builder requestBuilder = new Request.Builder();
- if(MapUtils.isNotEmpty(headers)) {
- for (String key : headers.keySet()) {
- requestBuilder.addHeader(key, headers.get(key));
- }
- }
-
- Request request = requestBuilder.url(urlWithParams).build();
-
- try {
- Response response = getInstance().newCall(request).execute();
- String result = response.body().toString();
- log.debug("[OkHttp] |- OkHttp Get Request returned value is : [{}]", result);
- return result;
- } catch (IOException e) {
- log.error("[OkHttp] |- OkHttp Post Request Catch the Error!", e);
- return null;
- }
- }
-
- /**
- * Post请求
- *
- * @param url URL地址
- * @param params 参数
- * @return 返回结果
- */
- public static String post(String url, Map params) {
- if (MapUtils.isEmpty(params)) {
- params = new HashMap<>(8);
- }
-
- FormBody.Builder formBodyBuilder = new FormBody.Builder();
- for (Map.Entry map : params.entrySet()) {
- String key = map.getKey();
- String value;
- if (map.getValue() == null) {
- value = "";
- } else {
- value = map.getValue();
- }
- formBodyBuilder.add(key, value);
- }
- FormBody formBody = formBodyBuilder.build();
- log.debug("[OkHttp] |- OkHttp Post Request add params : [{}]", JSON.toJSONString(params));
-
- try {
- Request request = new Request.Builder().url(url).post(formBody).build();
- Response response = getInstance().newCall(request).execute();
- String result = response.body().string();
- log.debug("[OkHttp] |- OkHttp Post Request returned value is : [{}]", result);
- return result;
- } catch (Exception e) {
- log.error("[OkHttp] |- OkHttp Post Request Catch the Error!", e);
- return null;
- }
- }
-}
diff --git a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/TreeUtils.java b/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/TreeUtils.java
deleted file mode 100644
index 20e473cea..000000000
--- a/packages/eurynome-cloud-common/src/main/java/cn/herodotus/eurynome/common/utils/TreeUtils.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2019-2021 Gengwei Zheng(herodotus@aliyun.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Project Name: eurynome-cloud
- * Module Name: eurynome-cloud-common
- * File Name: TreeUtils.java
- * Author: gengwei.zheng
- * Date: 2021/05/07 11:28:07
- */
-
-package cn.herodotus.eurynome.common.utils;
-
-import cn.herodotus.eurynome.common.domain.TreeNode;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 树形对象构造工具类
- *
- * @author gengwei.zheng
- */
-public class TreeUtils {
-
- public final static String DEFAULT_ROOT_ID = "0";
-
- public static List build(List treeNodes) {
- return build(treeNodes, DEFAULT_ROOT_ID);
- }
-
- /**
- * 使用递归方法建树
- * @param treeNodes
- * @return
- */
- public static List build(List treeNodes, String root) {
- if (StringUtils.isEmpty(root)) {
- root = DEFAULT_ROOT_ID;
- }
-
- List trees = new ArrayList<>();
- for (N treeNode : treeNodes) {
- if (root.equals(treeNode.getParentId())) {
- trees.add(findChildren(treeNode,treeNodes));
- }
- }
- return trees;
- }
-
- /**
- * 递归查找子节点
- * @param treeNodes
- * @return
- */
- public static N findChildren(N parentTreeNode,List treeNodes) {
- for (N treeNode : treeNodes) {
- if(parentTreeNode.getId().equals(treeNode.getParentId())) {
- if (parentTreeNode.getChildren() == null) {
- parentTreeNode.setChildren(new ArrayList<>());
- }
- parentTreeNode.getChildren().add(findChildren(treeNode,treeNodes));
- }
- }
- return parentTreeNode;
- }
-}
diff --git a/packages/eurynome-cloud-constant/pom.xml b/packages/eurynome-cloud-constant/pom.xml
deleted file mode 100644
index fabacfe0b..000000000
--- a/packages/eurynome-cloud-constant/pom.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- packages
- cn.herodotus.eurynome
- 2.5.4.50
-
- 4.0.0
-
- eurynome-cloud-constant
-
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-yaml
-
-
-
- io.springfox
- springfox-swagger2
-
-
- io.swagger
- swagger-annotations
-
-
- io.swagger
- swagger-models
-
-
-
-
- io.swagger
- swagger-annotations
-
-
- io.swagger
- swagger-models
-
-
-
- com.github.whvcse
- easy-captcha
-
-
-
- me.zhyd.oauth
- JustAuth
-
-
-
-
\ No newline at end of file
diff --git a/packages/eurynome-cloud-crud/pom.xml b/packages/eurynome-cloud-crud/pom.xml
index 01300c40f..79d1691b7 100644
--- a/packages/eurynome-cloud-crud/pom.xml
+++ b/packages/eurynome-cloud-crud/pom.xml
@@ -29,11 +29,11 @@
packages
cn.herodotus.eurynome
- 2.5.4.50
+ 2.5.4.55
eurynome-cloud-crud
- 2.5.4.50
+ 2.5.4.55
jar
diff --git a/packages/eurynome-cloud-crud/src/main/java/cn/herodotus/eurynome/crud/controller/BaseReadableRestController.java b/packages/eurynome-cloud-crud/src/main/java/cn/herodotus/eurynome/crud/controller/BaseReadableRestController.java
index 10eacef0c..97aa6cc99 100644
--- a/packages/eurynome-cloud-crud/src/main/java/cn/herodotus/eurynome/crud/controller/BaseReadableRestController.java
+++ b/packages/eurynome-cloud-crud/src/main/java/cn/herodotus/eurynome/crud/controller/BaseReadableRestController.java
@@ -24,11 +24,11 @@
import cn.herodotus.eurynome.common.definition.entity.AbstractEntity;
import cn.herodotus.eurynome.common.domain.Result;
+import cn.herodotus.eurynome.rest.base.business.Pager;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
import java.io.Serializable;
import java.util.Map;
@@ -43,14 +43,10 @@ public abstract class BaseReadableRestController> findByPage(
- @RequestParam("pageNumber") Integer pageNumber,
- @RequestParam("pageSize") Integer pageSize) {
- return ReadableController.super.findByPage(pageNumber, pageSize);
+ public Result