From 1931ad4fe02d9cf0d7e73715d767700f515487cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Tue, 25 Jun 2019 12:06:07 +0800 Subject: [PATCH] =?UTF-8?q?:bookmark:=20Releasing=20/=20Version=20tags.=20?= =?UTF-8?q?=202.3.0=20=E4=BD=A0=E6=B2=A1=E7=8E=A9=E8=BF=87=E7=9A=84?= =?UTF-8?q?=E5=85=A8=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 +++---- pig-auth/pom.xml | 6 +-- pig-common/pig-common-core/pom.xml | 7 ++- ...isConfig.java => RedisTemplateConfig.java} | 5 +- .../{datascope => mybatis}/DataScope.java | 2 +- .../DataScopeInterceptor.java | 2 +- .../main/resources/META-INF/spring.factories | 2 +- pig-common/pig-common-log/pom.xml | 6 +-- .../pig/common/log/LogAutoConfiguration.java | 2 - .../init/ApplicationLoggerInitializer.java | 42 +++++++++++++++++ .../main/resources/META-INF/spring.factories | 2 + pig-common/pig-common-security/pom.xml | 6 +-- pig-common/pom.xml | 2 +- pig-config/pom.xml | 2 +- pig-eureka/pom.xml | 2 +- pig-gateway/pom.xml | 4 +- pig-upms/pig-upms-api/pom.xml | 4 +- .../pig/admin/api/feign/RemoteLogService.java | 2 +- .../admin/api/feign/RemoteTokenService.java | 2 +- .../admin/api/feign/RemoteUserService.java | 2 +- pig-upms/pig-upms-biz/pom.xml | 8 ++-- .../admin/config/MybatisPlusConfigurer.java | 2 +- pig-upms/pom.xml | 2 +- pig-visual/pig-codegen/pom.xml | 6 +-- pig-visual/pig-monitor/pom.xml | 2 +- pig-visual/pig-zipkin/pom.xml | 2 +- pig-visual/pom.xml | 2 +- pom.xml | 47 +++++-------------- 28 files changed, 109 insertions(+), 80 deletions(-) rename pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/config/{RedisConfig.java => RedisTemplateConfig.java} (91%) rename pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/{datascope => mybatis}/DataScope.java (95%) rename pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/{datascope => mybatis}/DataScopeInterceptor.java (98%) create mode 100644 pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/init/ApplicationLoggerInitializer.java diff --git a/README.md b/README.md index ce7b00ff..be1f955f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

- Build Status - Coverage Status - Downloads + Build Status + Coverage Status + Downloads

**Pig Microservice Architecture** @@ -24,12 +24,12 @@ 依赖 | 版本 ---|--- -Spring Boot | 2.1.5.RELEASE -Spring Cloud | Greenwich.RELEASE -Spring Security OAuth2 | 2.3.3 +Spring Boot | 2.1.6.RELEASE +Spring Cloud | Greenwich.SR1 +Spring Security OAuth2 | 2.3.5 Mybatis Plus | 3.1.0 -hutool | 4.5.10 -Avue | 1.5.0 +hutool | 4.5.13 +Avue | 1.6.0 diff --git a/pig-auth/pom.xml b/pig-auth/pom.xml index d7c82d04..d41b9100 100755 --- a/pig-auth/pom.xml +++ b/pig-auth/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig - 2.2.2 + 2.3.0 pig-auth @@ -39,13 +39,13 @@ com.pig4cloud pig-upms-api - 2.2.2 + 2.3.0 com.pig4cloud pig-common-security - 2.2.2 + 2.3.0 diff --git a/pig-common/pig-common-core/pom.xml b/pig-common/pig-common-core/pom.xml index 352dd28e..11e352e6 100755 --- a/pig-common/pig-common-core/pom.xml +++ b/pig-common/pig-common-core/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig-common - 2.2.2 + 2.3.0 pig-common-core @@ -80,5 +80,10 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 + + org.springframework + spring-webmvc + provided + diff --git a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/config/RedisConfig.java b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/config/RedisTemplateConfig.java similarity index 91% rename from pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/config/RedisConfig.java rename to pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/config/RedisTemplateConfig.java index 39496b34..0129fdc2 100755 --- a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/config/RedisConfig.java +++ b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/config/RedisTemplateConfig.java @@ -17,6 +17,8 @@ package com.pig4cloud.pig.common.core.config; import lombok.AllArgsConstructor; +import org.springframework.boot.autoconfigure.AutoConfigureBefore; +import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -33,7 +35,8 @@ import org.springframework.data.redis.serializer.StringRedisSerializer; @EnableCaching @Configuration @AllArgsConstructor -public class RedisConfig { +@AutoConfigureBefore(RedisAutoConfiguration.class) +public class RedisTemplateConfig { private final RedisConnectionFactory factory; @Bean diff --git a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/datascope/DataScope.java b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/mybatis/DataScope.java similarity index 95% rename from pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/datascope/DataScope.java rename to pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/mybatis/DataScope.java index 2e925e20..f0db7c5f 100755 --- a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/datascope/DataScope.java +++ b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/mybatis/DataScope.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.pig4cloud.pig.common.core.datascope; +package com.pig4cloud.pig.common.core.mybatis; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/datascope/DataScopeInterceptor.java b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/mybatis/DataScopeInterceptor.java similarity index 98% rename from pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/datascope/DataScopeInterceptor.java rename to pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/mybatis/DataScopeInterceptor.java index dfa3d766..7fc36f0e 100755 --- a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/datascope/DataScopeInterceptor.java +++ b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/mybatis/DataScopeInterceptor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.pig4cloud.pig.common.core.datascope; +package com.pig4cloud.pig.common.core.mybatis; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; diff --git a/pig-common/pig-common-core/src/main/resources/META-INF/spring.factories b/pig-common/pig-common-core/src/main/resources/META-INF/spring.factories index a7de3d37..65f75797 100755 --- a/pig-common/pig-common-core/src/main/resources/META-INF/spring.factories +++ b/pig-common/pig-common-core/src/main/resources/META-INF/spring.factories @@ -1,6 +1,6 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.pig4cloud.pig.common.core.config.JacksonConfig,\ - com.pig4cloud.pig.common.core.config.RedisConfig,\ + com.pig4cloud.pig.common.core.config.RedisTemplateConfig,\ com.pig4cloud.pig.common.core.config.RestTemplateConfig,\ com.pig4cloud.pig.common.core.config.FilterIgnorePropertiesConfig,\ com.pig4cloud.pig.common.core.exception.GlobalExceptionHandler,\ diff --git a/pig-common/pig-common-log/pom.xml b/pig-common/pig-common-log/pom.xml index bd6ea575..d18e3a9d 100755 --- a/pig-common/pig-common-log/pom.xml +++ b/pig-common/pig-common-log/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig-common - 2.2.2 + 2.3.0 pig-common-log @@ -35,13 +35,13 @@ com.pig4cloud pig-common-core - 2.2.2 + 2.3.0 com.pig4cloud pig-upms-api - 2.2.2 + 2.3.0 diff --git a/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/LogAutoConfiguration.java b/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/LogAutoConfiguration.java index 805c606b..4f6f96d6 100755 --- a/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/LogAutoConfiguration.java +++ b/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/LogAutoConfiguration.java @@ -21,7 +21,6 @@ import com.pig4cloud.pig.common.log.aspect.SysLogAspect; import com.pig4cloud.pig.common.log.event.SysLogListener; import lombok.AllArgsConstructor; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableAsync; @@ -35,7 +34,6 @@ import org.springframework.scheduling.annotation.EnableAsync; @Configuration @AllArgsConstructor @ConditionalOnWebApplication -@EnableFeignClients({"com.pig4cloud.pig.admin.api.feign"}) public class LogAutoConfiguration { private final RemoteLogService remoteLogService; diff --git a/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/init/ApplicationLoggerInitializer.java b/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/init/ApplicationLoggerInitializer.java new file mode 100644 index 00000000..caf62d21 --- /dev/null +++ b/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/init/ApplicationLoggerInitializer.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2025, lengleng All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the pig4cloud.com developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: lengleng (wangiegie@gmail.com) + */ + +package com.pig4cloud.pig.common.log.init; + +import org.springframework.context.ApplicationContextInitializer; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.env.ConfigurableEnvironment; + +/** + * @author lengleng + * @date 2019-06-25 + *

+ * 通过环境变量的形式注入 logging.file + * 自动维护 Spring Boot Admin Logger Viewer + */ +public class ApplicationLoggerInitializer implements ApplicationContextInitializer { + @Override + public void initialize(ConfigurableApplicationContext applicationContext) { + ConfigurableEnvironment environment = applicationContext.getEnvironment(); + + String appName = environment.getProperty("spring.application.name"); + + String logBase = environment.getProperty("LOGGING_PATH", "logs"); + // spring boot admin 直接加载日志 + System.setProperty("logging.file", String.format("%s/%s/debug.log", logBase, appName)); + } +} diff --git a/pig-common/pig-common-log/src/main/resources/META-INF/spring.factories b/pig-common/pig-common-log/src/main/resources/META-INF/spring.factories index 032c11d8..8b7094c1 100755 --- a/pig-common/pig-common-log/src/main/resources/META-INF/spring.factories +++ b/pig-common/pig-common-log/src/main/resources/META-INF/spring.factories @@ -1,2 +1,4 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.pig4cloud.pig.common.log.LogAutoConfiguration +org.springframework.context.ApplicationContextInitializer=\ + com.pig4cloud.pig.common.log.init.ApplicationLoggerInitializer diff --git a/pig-common/pig-common-security/pom.xml b/pig-common/pig-common-security/pom.xml index 994f3389..1cf5a7cb 100755 --- a/pig-common/pig-common-security/pom.xml +++ b/pig-common/pig-common-security/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig-common - 2.2.2 + 2.3.0 pig-common-security @@ -35,7 +35,7 @@ com.pig4cloud pig-common-core - 2.2.2 + 2.3.0 @@ -50,7 +50,7 @@ com.pig4cloud pig-upms-api - 2.2.2 + 2.3.0 diff --git a/pig-common/pom.xml b/pig-common/pom.xml index c3cbef4c..dc08c2f2 100755 --- a/pig-common/pom.xml +++ b/pig-common/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig - 2.2.2 + 2.3.0 pig-common diff --git a/pig-config/pom.xml b/pig-config/pom.xml index 6018ccc5..6d1a7c5a 100755 --- a/pig-config/pom.xml +++ b/pig-config/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig - 2.2.2 + 2.3.0 pig-config diff --git a/pig-eureka/pom.xml b/pig-eureka/pom.xml index 073d57d7..6b6a6ed1 100755 --- a/pig-eureka/pom.xml +++ b/pig-eureka/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig - 2.2.2 + 2.3.0 pig-eureka diff --git a/pig-gateway/pom.xml b/pig-gateway/pom.xml index 52ae3d5a..8e4809c3 100755 --- a/pig-gateway/pom.xml +++ b/pig-gateway/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig - 2.2.2 + 2.3.0 pig-gateway @@ -54,7 +54,7 @@ com.pig4cloud pig-common-core - 2.2.2 + 2.3.0 diff --git a/pig-upms/pig-upms-api/pom.xml b/pig-upms/pig-upms-api/pom.xml index 31fdca15..d9763464 100755 --- a/pig-upms/pig-upms-api/pom.xml +++ b/pig-upms/pig-upms-api/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig-upms - 2.2.2 + 2.3.0 pig-upms-api @@ -35,7 +35,7 @@ com.pig4cloud pig-common-core - 2.2.2 + 2.3.0 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteLogService.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteLogService.java index 8061d45d..198da8b2 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteLogService.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteLogService.java @@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RequestHeader; * @author lengleng * @date 2019/2/1 */ -@FeignClient(value = ServiceNameConstants.UMPS_SERVICE, fallbackFactory = RemoteLogServiceFallbackFactory.class) +@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.UMPS_SERVICE, fallbackFactory = RemoteLogServiceFallbackFactory.class) public interface RemoteLogService { /** * 保存日志 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteTokenService.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteTokenService.java index 99d43596..797e1e36 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteTokenService.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteTokenService.java @@ -29,7 +29,7 @@ import java.util.Map; * @author lengleng * @date 2019/2/1 */ -@FeignClient(value = ServiceNameConstants.AUTH_SERVICE, fallbackFactory = RemoteTokenServiceFallbackFactory.class) +@FeignClient(contextId = "remoteTokenService", value = ServiceNameConstants.AUTH_SERVICE, fallbackFactory = RemoteTokenServiceFallbackFactory.class) public interface RemoteTokenService { /** * 分页查询token 信息 diff --git a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java index eeeb4da9..160ce82a 100755 --- a/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java +++ b/pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/feign/RemoteUserService.java @@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RequestHeader; * @author lengleng * @date 2019/2/1 */ -@FeignClient(value = ServiceNameConstants.UMPS_SERVICE, fallbackFactory = RemoteUserServiceFallbackFactory.class) +@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.UMPS_SERVICE, fallbackFactory = RemoteUserServiceFallbackFactory.class) public interface RemoteUserService { /** * 通过用户名查询用户、角色信息 diff --git a/pig-upms/pig-upms-biz/pom.xml b/pig-upms/pig-upms-biz/pom.xml index 9c94d795..db9e5ba4 100644 --- a/pig-upms/pig-upms-biz/pom.xml +++ b/pig-upms/pig-upms-biz/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig-upms - 2.2.2 + 2.3.0 pig-upms-biz @@ -34,19 +34,19 @@ com.pig4cloud pig-upms-api - 2.2.2 + 2.3.0 com.pig4cloud pig-common-security - 2.2.2 + 2.3.0 com.pig4cloud pig-common-log - 2.2.2 + 2.3.0 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/config/MybatisPlusConfigurer.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/config/MybatisPlusConfigurer.java index 4469806d..18bcbfca 100755 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/config/MybatisPlusConfigurer.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/config/MybatisPlusConfigurer.java @@ -19,7 +19,7 @@ package com.pig4cloud.pig.admin.config; import com.baomidou.mybatisplus.core.injector.ISqlInjector; import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; -import com.pig4cloud.pig.common.core.datascope.DataScopeInterceptor; +import com.pig4cloud.pig.common.core.mybatis.DataScopeInterceptor; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/pig-upms/pom.xml b/pig-upms/pom.xml index 0fcb8fba..492c689c 100755 --- a/pig-upms/pom.xml +++ b/pig-upms/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig - 2.2.2 + 2.3.0 pig-upms diff --git a/pig-visual/pig-codegen/pom.xml b/pig-visual/pig-codegen/pom.xml index 81c50f0c..336c36a4 100755 --- a/pig-visual/pig-codegen/pom.xml +++ b/pig-visual/pig-codegen/pom.xml @@ -22,7 +22,7 @@ com.pig4cloud pig-visual - 2.2.2 + 2.3.0 pig-codegen @@ -50,13 +50,13 @@ com.pig4cloud pig-common-core - 2.2.2 + 2.3.0 com.pig4cloud pig-common-security - 2.2.2 + 2.3.0 diff --git a/pig-visual/pig-monitor/pom.xml b/pig-visual/pig-monitor/pom.xml index 28ffca04..ddb626b5 100755 --- a/pig-visual/pig-monitor/pom.xml +++ b/pig-visual/pig-monitor/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig-visual - 2.2.2 + 2.3.0 pig-monitor diff --git a/pig-visual/pig-zipkin/pom.xml b/pig-visual/pig-zipkin/pom.xml index e2c2df1c..0e032e15 100644 --- a/pig-visual/pig-zipkin/pom.xml +++ b/pig-visual/pig-zipkin/pom.xml @@ -5,7 +5,7 @@ pig-visual com.pig4cloud - 2.2.2 + 2.3.0 4.0.0 diff --git a/pig-visual/pom.xml b/pig-visual/pom.xml index dc633973..7d8710eb 100755 --- a/pig-visual/pom.xml +++ b/pig-visual/pom.xml @@ -21,7 +21,7 @@ com.pig4cloud pig - 2.2.2 + 2.3.0 pig-visual diff --git a/pom.xml b/pom.xml index 8bd92325..0439d89f 100755 --- a/pom.xml +++ b/pom.xml @@ -21,33 +21,30 @@ com.pig4cloud pig - 2.2.2 + 2.3.0 ${project.artifactId} pom https://www.pig4cloud.com - 2.1.5.RELEASE - Greenwich.RELEASE - Cairo-SR7 + 2.1.6.RELEASE + Greenwich.SR1 + Cairo-SR8 UTF-8 1.8 1.8 - 2.1.4 - 4.5.10 + 2.1.5 + 4.5.13 3.1.0 0.0.9 1.7 2.1.0 - 2.3.5.RELEASE - 2.1.2.RELEASE + 2.3.6.RELEASE 2.9.8 3.11.9 2.12.2 2.8.4 - http://192.168.0.13:4243 - 192.168.0.13:5000 @@ -145,11 +142,6 @@ spring-security-oauth2 ${security.oauth.version} - - org.springframework.security.oauth.boot - spring-security-oauth2-autoconfigure - ${security.oauth.auto.version} - com.fasterxml.jackson.module @@ -163,6 +155,12 @@ ${project.name} + + + src/main/resources + true + + @@ -180,25 +178,6 @@ - - com.spotify - docker-maven-plugin - 0.4.12 - - ${registry.url}/${project.name}:0.0.1 - ${docker.url} - ${project.basedir} - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - docker-hub - https://index.docker.io/v1/ - -