diff --git a/README.md b/README.md index 09b5a39d..59211083 100644 --- a/README.md +++ b/README.md @@ -1,5 +1 @@ -## what is spring cloud ? -Spring Cloud builds on Spring Boot by providing a bunch of libraries that enhance the behaviour of an application when added to the classpath. You can take advantage of the basic default behaviour to get started really quickly, and then when you need to, you can configure or extend to create a custom solution. - -## why use spring cloud ? -Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns. They will work well in any distributed environment, including the developer's own laptop, bare metal data centres, and managed platforms such as Cloud Foundry. \ No newline at end of file +2017年10月30日 1.0-ALPHA \ No newline at end of file diff --git a/pig-admin-service/pom.xml b/pig-admin-service/pom.xml index a494af04..fbe8aa61 100644 --- a/pig-admin-service/pom.xml +++ b/pig-admin-service/pom.xml @@ -5,7 +5,7 @@ com.github.pig pig-admin-service - 0.0.1-SNAPSHOT + ${pig.version} jar pig-admin-service @@ -14,14 +14,14 @@ com.github pig - 1.0-SNAPSHOT + ${pig.version} com.github.pig pig-common - 0.0.1-SNAPSHOT + ${pig.version} diff --git a/pig-auth-service/pom.xml b/pig-auth-service/pom.xml index 6bb18eb7..e0747077 100644 --- a/pig-auth-service/pom.xml +++ b/pig-auth-service/pom.xml @@ -5,7 +5,7 @@ com.github.pig pig-auth-service - 0.0.1-SNAPSHOT + ${pig.version} jar pig-auth-service @@ -14,24 +14,14 @@ com.github pig - 1.0-SNAPSHOT + ${pig.version} com.github.pig pig-common - 0.0.1-SNAPSHOT - - - - org.springframework.boot - spring-boot-starter-data-redis - - - - org.springframework.boot - spring-boot-starter-cache + ${pig.version} diff --git a/pig-auth-service/src/main/java/com/github/pig/auth/PigAuthServerApplication.java b/pig-auth-service/src/main/java/com/github/pig/auth/PigAuthServerApplication.java index ce5f9d7f..2a474472 100644 --- a/pig-auth-service/src/main/java/com/github/pig/auth/PigAuthServerApplication.java +++ b/pig-auth-service/src/main/java/com/github/pig/auth/PigAuthServerApplication.java @@ -2,20 +2,20 @@ package com.github.pig.auth; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cache.annotation.EnableCaching; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.context.annotation.ComponentScan; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; /** * @author lengleng - * 获取用户信息也是通过这个应用实现 - * 这里既是认证服务器,也是资源服务器 - * EnableResourceServer + * 获取用户信息也是通过这个应用实现 + * 这里既是认证服务器,也是资源服务器 + * EnableResourceServer */ @SpringBootApplication @EnableResourceServer @EnableDiscoveryClient +@ComponentScan(basePackages = {"com.github.pig.auth","com.github.pig.common.config"}) public class PigAuthServerApplication { public static void main(String[] args) { diff --git a/pig-auth-service/src/main/resources/bootstrap.yml b/pig-auth-service/src/main/resources/bootstrap.yml index 5b19da47..09c6f105 100644 --- a/pig-auth-service/src/main/resources/bootstrap.yml +++ b/pig-auth-service/src/main/resources/bootstrap.yml @@ -16,4 +16,3 @@ spring: enabled: true profile: dev label: master - diff --git a/pig-common/pom.xml b/pig-common/pom.xml index 58e718bc..e794a790 100644 --- a/pig-common/pom.xml +++ b/pig-common/pom.xml @@ -1,58 +1,68 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.github.pig - pig-common - 0.0.1-SNAPSHOT - jar + com.github.pig + pig-common + ${pig.version} + jar - pig-common - common + pig-common + common - - com.github - pig - 1.0-SNAPSHOT - + + com.github + pig + ${pig.version} + - - - - io.jsonwebtoken - jjwt - 0.7.0 - - - - mysql - mysql-connector-java - - - - com.baomidou - mybatis-plus - 2.1.4 - - - com.baomidou - mybatisplus-spring-boot-starter - 1.0.5 - - - - org.apache.velocity - velocity-engine-core - 2.0 - - - + + + + io.jsonwebtoken + jjwt + 0.7.0 + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.springframework.boot + spring-boot-starter-cache + + + + mysql + mysql-connector-java + + + + com.baomidou + mybatis-plus + 2.1.4 + + + com.baomidou + mybatisplus-spring-boot-starter + 1.0.5 + + + + org.apache.velocity + velocity-engine-core + 2.0 + + + - - - - + + + + diff --git a/pig-auth-service/src/main/java/com/github/pig/auth/config/MybatisPlusConfig.java b/pig-common/src/main/java/com/github/pig/common/config/MybatisPlusConfig.java similarity index 84% rename from pig-auth-service/src/main/java/com/github/pig/auth/config/MybatisPlusConfig.java rename to pig-common/src/main/java/com/github/pig/common/config/MybatisPlusConfig.java index 5b2e6854..3e940311 100644 --- a/pig-auth-service/src/main/java/com/github/pig/auth/config/MybatisPlusConfig.java +++ b/pig-common/src/main/java/com/github/pig/common/config/MybatisPlusConfig.java @@ -1,4 +1,4 @@ -package com.github.pig.auth.config; +package com.github.pig.common.config; import com.baomidou.mybatisplus.plugins.PaginationInterceptor; import org.mybatis.spring.annotation.MapperScan; @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; * @date 2017/10/29 */ @Configuration -@MapperScan("com.github.pig.auth.mapper") +@MapperScan("com.github.pig") public class MybatisPlusConfig { @Bean public PaginationInterceptor paginationInterceptor() { diff --git a/pig-auth-service/src/main/java/com/github/pig/auth/config/RedisCacheConfig.java b/pig-common/src/main/java/com/github/pig/common/config/RedisCacheConfig.java similarity index 86% rename from pig-auth-service/src/main/java/com/github/pig/auth/config/RedisCacheConfig.java rename to pig-common/src/main/java/com/github/pig/common/config/RedisCacheConfig.java index d4e0649f..2c56209e 100644 --- a/pig-auth-service/src/main/java/com/github/pig/auth/config/RedisCacheConfig.java +++ b/pig-common/src/main/java/com/github/pig/common/config/RedisCacheConfig.java @@ -1,11 +1,9 @@ -package com.github.pig.auth.config; +package com.github.pig.common.config; -import com.github.pig.common.constant.CommonConstant; import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.EnableCaching; -import org.springframework.cache.interceptor.KeyGenerator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.cache.RedisCacheManager; @@ -21,9 +19,9 @@ import org.springframework.data.redis.serializer.StringRedisSerializer; @Configuration @EnableCaching public class RedisCacheConfig extends CachingConfigurerSupport { - @Value("${redis.cache.expiration}") + @Value("${redis.cache.expiration:3600}") private Long expiration; - @SuppressWarnings("rawtypes") + @Bean public CacheManager cacheManager(RedisTemplate redisTemplate) { RedisCacheManager rcm = new RedisCacheManager(redisTemplate); diff --git a/pig-config/pom.xml b/pig-config/pom.xml index a7340439..c945b3fe 100644 --- a/pig-config/pom.xml +++ b/pig-config/pom.xml @@ -5,7 +5,7 @@ com.github.pig pig-config - 0.0.1-SNAPSHOT + ${pig.version} jar pig-config @@ -14,7 +14,7 @@ com.github pig - 1.0-SNAPSHOT + ${pig.version} diff --git a/pig-eureka/pom.xml b/pig-eureka/pom.xml index 859adaa1..2f97d8c9 100644 --- a/pig-eureka/pom.xml +++ b/pig-eureka/pom.xml @@ -5,7 +5,7 @@ com.github.pig pig-eureka - 0.0.1-SNAPSHOT + ${pig.version} jar pig-eureka @@ -14,7 +14,7 @@ com.github pig - 1.0-SNAPSHOT + ${pig.version} diff --git a/pig-gateway/pom.xml b/pig-gateway/pom.xml index 1bf8cbce..d0a6c3d0 100644 --- a/pig-gateway/pom.xml +++ b/pig-gateway/pom.xml @@ -5,7 +5,7 @@ com.github.pig pig-gateway - 0.0.1-SNAPSHOT + ${pig.version} jar pig-gateway @@ -14,14 +14,14 @@ com.github pig - 1.0-SNAPSHOT + ${pig.version} com.github.pig pig-common - 0.0.1-SNAPSHOT + ${pig.version} diff --git a/pom.xml b/pom.xml index 424d8fc6..2cc00d2f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github pig - 1.0-SNAPSHOT + ${pig.version} pom @@ -20,7 +20,7 @@ UTF-8 UTF-8 1.8 - 1.0-SNAPSHOT + 1.0-ALPHA