tuonina 6 years ago
parent
commit
27dae5ad0a

+ 18 - 9
README.md

@@ -31,17 +31,26 @@
 - 项目对mybatis plus进行了升级,使用的是mybatis-plus 3.0,与之前有一定区别,具体可见[文档](http://mp.baomidou.com/guide/wrapper.html#querywrapper)
 
 #### 2018/9/29
-- 添加配置中心,将配置中心与即时通信消息系统结合起来
-- 添加Spring bus。服务间的消息通知。这一点举一点应用:业务系统需要向前端或者用户发送消息,
-只需要调用发送消息的sender即可。由消息中心把消息发送给前端用户。
-
-- 删除shiro配置,但是因为授权中心使用shiro,导致客户端不能完全移除shiro依赖,但是只引用了shiro的核心包。
-具体原因是:授权中心shiro在生成的session中放入了shiro包中的类实体对象,jdk序列化之后,在各自的业务系统中反序列化,如果不引入shiro核心包,将
-导致jdk反序列化失败,导致各自业务系统无法获取到当前登录的用户信息。
+##### 1、添加配置中心,将配置中心与即时通信消息系统结合起来
+##### 2、 添加Spring bus。服务间的消息通知。
+
+        这一点举一点应用:业务系统需要向前端或者用户发送消息,
+        只需要调用发送消息的sender即可。由消息中心把消息发送给前端用户。
+
+##### 3、 删除shiro配置。
+        
+        但是因为授权中心使用shiro,导致客户端不能完全移除shiro依赖,但是只引用了shiro的核心包。
+        具体原因是:授权中心shiro在生成的session中放入了shiro包中的类实体对象,jdk序列化之后,在各自的业务系统中反序列化,如果不引入shiro核心包,将
+        导致jdk反序列化失败,导致各自业务系统无法获取到当前登录的用户信息。
+##### 4、 精简大量yml 文件配置,只保留必要的部分。
+ 有了配置中心的存在,可以将所有项目的公有和私有配置放到配置中心,而无需大量放到本地。
+ 
+##### 5、移除Tomcat依赖,添加jetty依赖
+Jetty 更加轻量化,更符合Spring Cloud 分布式部署;当然,这个还需要验证和考量。
 
 ### 后期计划
 
-- 将继续精简shiro相关配置,直至完全移除;
-- 消息总线
+- 将继续精简shiro相关配置,直至完全移除;(已完成)
+- 消息总线 (已完成)
 - 日志记录
 - 即时通信整合(估计会另外建一个项目来做即时通信)

+ 1 - 40
zen-web/src/main/resources/application-cache.yml

@@ -25,43 +25,4 @@ cache:
         maximumSize: 100 # 最大容量
       sys: # cache name
         initialCapacity: -1 # 初始化容量 默认-1
-        maximumSize: 128 # 最大容量]
-
----
-spring:
-  profiles: dev
-  cache:
-    type: redis # 使用什么作为缓存框架
-  redis:
-    database: 2 # redis数据库索引
-    host: 192.168.1.206
-    port: 6379
-    password:
-    timeout: 5s # 连接超时时间(毫秒)
-    jedis:
-      pool:
-        min-idle: 5  # 连接池中的最小空闲连接
-        max-idle: 20  # 连接池中的最大空闲连接
-        max-active: 20  # 连接池最大连接数(使用负值表示没有限制)
-        max-wait: -1s  # 连接池最大阻塞等待时间(使用负值表示没有限制)
-
----
-spring:
-  profiles: prod
-  cache:
-    type: redis # 使用什么作为缓存框架
-    # type: caffeine
-    caffeine:
-      spec:
-  redis:
-    database: 2 # redis数据库索引
-    host: 192.168.1.206
-    port: 6379
-    password:
-    timeout: 5s # 连接超时时间(毫秒)
-    jedis:
-      pool:
-        min-idle: 5  # 连接池中的最小空闲连接
-        max-idle: 20  # 连接池中的最大空闲连接
-        max-active: 20  # 连接池最大连接数(使用负值表示没有限制)
-        max-wait: -1s  # 连接池最大阻塞等待时间(使用负值表示没有限制)
+        maximumSize: 128 # 最大容量]

+ 0 - 18
zen-web/src/main/resources/application-msg.yml

@@ -1,18 +0,0 @@
-spring:
-  profiles: dev
-  rabbitmq:
-    username: client
-    password: client
-    host: 192.168.1.206
-    port: 5672
-
-
----
-spring:
-  profiles: prod
-  rabbitmq:
-    username: client
-    password: client
-    host: 192.168.1.206
-    port: 5672
-

+ 0 - 52
zen-web/src/main/resources/application-orm.yml

@@ -1,52 +0,0 @@
-###################  mybatis-plus配置  ###################
-
-mybatis-plus:
-  mapper-locations: classpath*:mapper/**/*.xml
-  global-config:
-    db-config:
-      id-type: auto
-      table-underline: true
-      logic-delete-value: 0
-      logic-not-delete-value: 1
-      column-like: true
-    refresh: true
-
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: true #配置的缓存的全局开关
-    lazyLoadingEnabled: true #延时加载的开关
-    multipleResultSetsEnabled: true #延时加载一个属性时会加载该对象全部属性,否则按需加载属性
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-
-spring:
-  datasource:
-    type: com.zaxxer.hikari.HikariDataSource
-    driver-class-name: com.mysql.jdbc.Driver
-    hikari:
-      minimum-idle: 5
-      maximum-pool-size: 15
-      auto-commit: true
-      idle-timeout: 30000
-      pool-name: DatebookHikariCP
-      max-lifetime: 1800000
-      connection-timeout: 30000
-      connection-test-query: select 1
-
----
-spring:
-  profiles: dev
-  datasource:
-    username: root
-    password: tuonina
-    url: jdbc:mysql://192.168.1.206:3307/envir_sys?useInformationSchema=true&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
-# &useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
-
-
----
-spring:
-  profiles: prod
-  datasource:
-    username: root
-    password: tuonina
-    url: jdbc:mysql://192.168.1.206:3307/archives_sys?useInformationSchema=true&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
-# &useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

+ 10 - 32
zen-web/src/main/resources/application.yml

@@ -1,46 +1,24 @@
 
-spring:
-  http:
-    converters:
-      preferred-json-mapper: jackson
-  jackson:
-    date-format: yyyy-MM-hh HH:mm
-    deserialization:
-      fail-on-unknown-properties: false # 多余字段反序列化过滤
-  aop:
-    auto: true
-    proxy-target-class: true #false为启用jdk默认动态代理,true为cglib动态代理
-
-  freemarker:
-    prefer-file-system-access: false
-
-
-
 ---
 spring:
   profiles: dev
-  session:
-    store-type: redis
-    redis:
-      host: 192.168.1.206
-      port: 6379
-      database: 0
+  datasource:
+    username: root
+    password: tuonina
+    url: jdbc:mysql://192.168.1.206:3307/envir_sys?useInformationSchema=true&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
+# &useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
 
 swagger:
   open: true
 
-
 ---
 spring:
   profiles: prod
-  session:
-    store-type: redis
-    redis:
-      host: 192.168.1.206
-      database: 0
-
-server:
-  port: 10000 # 生产环境端口号
+  datasource:
+    username: root
+    password: tuonina
+    url: jdbc:mysql://192.168.1.206:3307/archives_sys?useInformationSchema=true&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull
+# &useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
 
 swagger:
   open: false

+ 5 - 3
zen-web/src/main/resources/bootstrap.yml

@@ -5,15 +5,17 @@ server:
 spring:
   application:
     name: framework
+  profiles:
+    active: dev
+    include:  orm,cache,msg
   cloud:
     config:
       profile: dev
       discovery:
         enabled: true
         service-id: messager
-  profiles:
-    active: dev
-    include:  orm,cache,msg
+      allow-override: false
+
 
 
 ---