diff --git a/README.md b/README.md index 87455a2..b8a3edf 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ * SpringBlade 致力于创造新颖的开发模式,将开发中遇到的痛点、生产中所踩的坑整理归纳,并将解决方案都融合到框架中。 ## 官网 -官网地址: [https://bladex.vip](https://bladex.vip) +官网地址:[https://bladex.vip](https://bladex.vip) ## 在线演示 演示地址:[https://sword.bladex.vip](https://sword.bladex.vip) @@ -12,14 +12,18 @@ * 采用前后端分离的模式,前端单独开源出一个框架:[Sword](https://gitee.com/smallc/Sword),主要选型技术为React、Ant Design、Umi、Dva * 后端采用SpringCloud全家桶,并同时对其基础组件做了高度的封装,单独开源出一个框架:[Blade-Tool](https://github.com/chillzhuang/blade-tool.git) * [Blade-Tool](https://github.com/chillzhuang/blade-tool.git)已推送至Maven中央库,直接引入即可,减少了工程的臃肿,也可更注重于业务开发 -* 注册中心选型Consul +* 集成Sentinel从流量控制、熔断降级、系统负载保护等多个维度保护服务的稳定性。 +* 注册中心、配置中心选型Nacos,为工程瘦身的同时加强各模块之间的联动。 +* 使用Traefik进行反向代理,监听后台变化自动化应用新的配置文件。 * 部署使用Docker或K8s + Jenkins -* 使用Traefik进行反向代理 * 踩了踩Kong的坑,有个基本的使用方案,但不深入,因为涉及到OpenResty。 * 封装了简单的Secure模块,采用JWT做Token认证,可拓展集成Redis等细颗粒度控制方案 * 在2.0诞生之前,已经稳定生产了近一年,经历了从Camden -> Finchley的技术架构,也经历了从fat jar -> docker -> k8s + jenkins的部署架构 * 项目分包明确,规范微服务的开发模式,使包与包之间的分工清晰。 +## 会员计划及交流群 +* [会员计划及交流群](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade会员计划) + ## 技术文档 * [SpringBlade开发手册](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册) @@ -32,7 +36,6 @@ SpringBlade ├── blade-ops -- 运维中心 ├ ├── blade-admin -- spring-cloud后台管理 ├ ├── blade-codegen -- 代码生成 -├ └── blade-config-server -- 配置中心 ├── blade-service -- 业务模块 ├ ├── blade-desk -- 工作台模块 ├ ├── blade-log -- 日志模块 @@ -72,14 +75,6 @@ Apache Licence也是对商业应用友好的许可。使用者也可以在需要 注意:若禁止条款被发现有权追讨19999的授权费。 -## 如何启动 -* 安装Lombok Plugin、idea可选装MyBatisX -* [开启consul](https://gitee.com/smallc/SpringBlade/blob/master/doc/consul/consul.md),redis,mysql -* fork ([bladex-config](https://gitee.com/smallc/bladex-config))项目,修改数据库等相关链接 -* 修改 `blade-config-server` 工程 `bootstrap.yml中config.server.git.uri` 的值为新fork项目的地址 -* 先启动 `blade-config-server` -* 再依次启动其余模块 - ## 注 * SpringBlade前端UI项目地址:[Sword](https://gitee.com/smallc/Sword) * SpringBlade核心框架项目地址:[Blade-Tool](https://github.com/chillzhuang/blade-tool.git) @@ -101,8 +96,8 @@ Apache Licence也是对商业应用友好的许可。使用者也可以在需要
- * 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.
- */
-package org.springblade.config;
-
-import org.springblade.core.launch.constant.AppConstant;
-import org.springblade.core.launch.BladeApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.config.server.EnableConfigServer;
-
-/**
- * 服务中心启动器
- *
- * @author Chill
- */
-@EnableConfigServer
-@SpringBootApplication
-public class BladeConfigApplication {
-
- public static void main(String[] args) {
- BladeApplication.run(AppConstant.APPLICATION_CONFIG_NAME, BladeConfigApplication.class, args);
- }
-
-}
diff --git a/blade-ops/blade-config-server/src/main/resources/banner.txt b/blade-ops/blade-config-server/src/main/resources/banner.txt
deleted file mode 100644
index cbd0280..0000000
--- a/blade-ops/blade-config-server/src/main/resources/banner.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-${AnsiColor.BRIGHT_CYAN} _____ _ ${AnsiColor.BLUE} ______ _ _
-${AnsiColor.BRIGHT_CYAN}/ ___| (_) ${AnsiColor.BLUE} | ___ \| | | |
-${AnsiColor.BRIGHT_CYAN}\ `--. _ __ _ __ _ _ __ __ _ ${AnsiColor.BLUE} | |_/ /| | __ _ __| | ___
-${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \ / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \
-${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || | | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| || __/
-${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_| |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|
-${AnsiColor.BRIGHT_CYAN} | | __/ |
-${AnsiColor.BRIGHT_CYAN} |_| |___/
-
-${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK}
diff --git a/blade-ops/blade-config-server/src/main/resources/bootstrap.yml b/blade-ops/blade-config-server/src/main/resources/bootstrap.yml
deleted file mode 100644
index 162b059..0000000
--- a/blade-ops/blade-config-server/src/main/resources/bootstrap.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-server:
- port: 7005
- undertow:
- # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
- io-threads: 4
- # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
- worker-threads: 20
- # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
- buffer-size: 1024
- # 是否分配的直接内存
- direct-buffers: true
-
-spring:
- # 配置中心
- cloud:
- #config:
- # server:
- # native:
- # search-locations: classpath:/config/
- config:
- server:
- git:
- uri: https://gitee.com/smallc/bladex-config
- search-paths: respo
- default-label: master
- #username: username
- #password: password
- loadbalancer:
- retry:
- enabled: true
- devtools:
- restart:
- log-condition-evaluation-delta: false
-
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: always
diff --git a/blade-ops/blade-config-server/src/main/resources/config/application-prod.yml b/blade-ops/blade-config-server/src/main/resources/config/application-prod.yml
deleted file mode 100644
index a41ae71..0000000
--- a/blade-ops/blade-config-server/src/main/resources/config/application-prod.yml
+++ /dev/null
@@ -1,83 +0,0 @@
-#服务器配置
-server:
- undertow:
- # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
- io-threads: 4
- # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
- worker-threads: 20
- # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
- buffer-size: 1024
- # 是否分配的直接内存
- direct-buffers: true
-
-#spring配置
-spring:
- redis:
- ##redis 单机环境配置
- host: 192.168.186.129
- port: 3379
- password:
- database: 0
- ssl: false
- ##redis 集群环境配置
- #cluster:
- # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
- # commandTimeout: 5000
- devtools:
- restart:
- log-condition-evaluation-delta: false
-
-#feign配置
-feign:
- hystrix:
- enabled: true
- okhttp:
- enabled: true
- httpclient:
- enabled: false
-
-#hystrix配置
-hystrix:
- threadpool:
- default:
- coreSize: 300
- maxQueueSize: 1000
- queueSizeRejectionThreshold: 800
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 720000
-
-#ribbon配置
-ribbon:
- #对当前实例的重试次数
- MaxAutoRetries: 1
- #切换实例的重试次数
- MaxAutoRetriesNextServer: 2
- #请求处理的超时时间
- ReadTimeout: 60000
- #请求连接的超时时间
- ConnectTimeout: 60000
- #对所有操作请求都进行重试
- OkToRetryOnAllOperations: true
-
-#对外暴露端口
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: always
-
-#项目模块集中配置
-blade:
- #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
- datasource:
- prod:
- url: jdbc:mysql://192.168.186.129:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true
- username: root
- password: root
diff --git a/blade-ops/blade-config-server/src/main/resources/config/application-test.yml b/blade-ops/blade-config-server/src/main/resources/config/application-test.yml
deleted file mode 100644
index bd17831..0000000
--- a/blade-ops/blade-config-server/src/main/resources/config/application-test.yml
+++ /dev/null
@@ -1,83 +0,0 @@
-#服务器配置
-server:
- undertow:
- # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
- io-threads: 4
- # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
- worker-threads: 20
- # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
- buffer-size: 1024
- # 是否分配的直接内存
- direct-buffers: true
-
-#spring配置
-spring:
- redis:
- ##redis 单机环境配置
- host: 192.168.186.129
- port: 3379
- password:
- database: 0
- ssl: false
- ##redis 集群环境配置
- #cluster:
- # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
- # commandTimeout: 5000
- devtools:
- restart:
- log-condition-evaluation-delta: false
-
-#feign配置
-feign:
- hystrix:
- enabled: true
- okhttp:
- enabled: true
- httpclient:
- enabled: false
-
-#hystrix配置
-hystrix:
- threadpool:
- default:
- coreSize: 300
- maxQueueSize: 1000
- queueSizeRejectionThreshold: 800
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 720000
-
-#ribbon配置
-ribbon:
- #对当前实例的重试次数
- MaxAutoRetries: 1
- #切换实例的重试次数
- MaxAutoRetriesNextServer: 2
- #请求处理的超时时间
- ReadTimeout: 60000
- #请求连接的超时时间
- ConnectTimeout: 60000
- #对所有操作请求都进行重试
- OkToRetryOnAllOperations: true
-
-#对外暴露端口
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: always
-
-#项目模块集中配置
-blade:
- #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
- datasource:
- test:
- url: jdbc:mysql://192.168.186.129:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true
- username: root
- password: root
diff --git a/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-dev.yml b/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-dev.yml
deleted file mode 100644
index a2a845c..0000000
--- a/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-dev.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-blade:
- modules:
- id: 1
- name: dashboard-dev
\ No newline at end of file
diff --git a/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-prod.yml b/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-prod.yml
deleted file mode 100644
index 41b04c6..0000000
--- a/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-prod.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-blade:
- modules:
- id: 1
- name: dashboard-prod
\ No newline at end of file
diff --git a/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-test.yml b/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-test.yml
deleted file mode 100644
index 1e3e491..0000000
--- a/blade-ops/blade-config-server/src/main/resources/config/blade-dashboard-test.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-blade:
- modules:
- id: 3
- name: dashboard-test
\ No newline at end of file
diff --git a/blade-ops/blade-config-server/target/classes/META-INF/spring-devtools.properties b/blade-ops/blade-config-server/target/classes/META-INF/spring-devtools.properties
deleted file mode 100644
index 159c2cc..0000000
--- a/blade-ops/blade-config-server/target/classes/META-INF/spring-devtools.properties
+++ /dev/null
@@ -1 +0,0 @@
-restart.include.blade-config-server=/blade-config-server[\\w-]+\.jar
\ No newline at end of file
diff --git a/blade-ops/blade-config-server/target/classes/META-INF/spring.factories b/blade-ops/blade-config-server/target/classes/META-INF/spring.factories
deleted file mode 100644
index 1b48d96..0000000
--- a/blade-ops/blade-config-server/target/classes/META-INF/spring.factories
+++ /dev/null
@@ -1,2 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
- org.springblade.config.BladeConfigApplication
diff --git a/blade-ops/blade-config-server/target/classes/banner.txt b/blade-ops/blade-config-server/target/classes/banner.txt
deleted file mode 100644
index cbd0280..0000000
--- a/blade-ops/blade-config-server/target/classes/banner.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-${AnsiColor.BRIGHT_CYAN} _____ _ ${AnsiColor.BLUE} ______ _ _
-${AnsiColor.BRIGHT_CYAN}/ ___| (_) ${AnsiColor.BLUE} | ___ \| | | |
-${AnsiColor.BRIGHT_CYAN}\ `--. _ __ _ __ _ _ __ __ _ ${AnsiColor.BLUE} | |_/ /| | __ _ __| | ___
-${AnsiColor.BRIGHT_CYAN} `--. \| '_ \ | '__|| || '_ \ / _` | ${AnsiColor.BLUE} | ___ \| | / _` | / _` | / _ \
-${AnsiColor.BRIGHT_CYAN}/\__/ /| |_) || | | || | | || (_| | ${AnsiColor.BLUE} | |_/ /| || (_| || (_| || __/
-${AnsiColor.BRIGHT_CYAN}\____/ | .__/ |_| |_||_| |_| \__, | ${AnsiColor.BLUE} \____/ |_| \__,_| \__,_| \___|
-${AnsiColor.BRIGHT_CYAN} | | __/ |
-${AnsiColor.BRIGHT_CYAN} |_| |___/
-
-${AnsiColor.BLUE}:: SpringBlade :: ${spring.application.name}:${AnsiColor.RED}${blade.env}${AnsiColor.BLUE} :: Running SpringBoot ${spring-boot.version} :: ${AnsiColor.BRIGHT_BLACK}
diff --git a/blade-ops/blade-config-server/target/classes/bootstrap.yml b/blade-ops/blade-config-server/target/classes/bootstrap.yml
deleted file mode 100644
index 162b059..0000000
--- a/blade-ops/blade-config-server/target/classes/bootstrap.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-server:
- port: 7005
- undertow:
- # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
- io-threads: 4
- # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
- worker-threads: 20
- # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
- buffer-size: 1024
- # 是否分配的直接内存
- direct-buffers: true
-
-spring:
- # 配置中心
- cloud:
- #config:
- # server:
- # native:
- # search-locations: classpath:/config/
- config:
- server:
- git:
- uri: https://gitee.com/smallc/bladex-config
- search-paths: respo
- default-label: master
- #username: username
- #password: password
- loadbalancer:
- retry:
- enabled: true
- devtools:
- restart:
- log-condition-evaluation-delta: false
-
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: always
diff --git a/blade-ops/blade-config-server/target/classes/config/application-dev.yml b/blade-ops/blade-config-server/target/classes/config/application-dev.yml
deleted file mode 100644
index dd2c405..0000000
--- a/blade-ops/blade-config-server/target/classes/config/application-dev.yml
+++ /dev/null
@@ -1,83 +0,0 @@
-#服务器配置
-server:
- undertow:
- # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
- io-threads: 4
- # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
- worker-threads: 20
- # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
- buffer-size: 1024
- # 是否分配的直接内存
- direct-buffers: true
-
-#spring配置
-spring:
- redis:
- ##redis 单机环境配置
- host: 127.0.0.1
- port: 6379
- password:
- database: 0
- ssl: false
- ##redis 集群环境配置
- #cluster:
- # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
- # commandTimeout: 5000
- devtools:
- restart:
- log-condition-evaluation-delta: false
-
-#feign配置
-feign:
- hystrix:
- enabled: true
- okhttp:
- enabled: true
- httpclient:
- enabled: false
-
-#hystrix配置
-hystrix:
- threadpool:
- default:
- coreSize: 300
- maxQueueSize: 1000
- queueSizeRejectionThreshold: 800
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 720000
-
-#ribbon配置
-ribbon:
- #对当前实例的重试次数
- MaxAutoRetries: 1
- #切换实例的重试次数
- MaxAutoRetriesNextServer: 2
- #请求处理的超时时间
- ReadTimeout: 60000
- #请求连接的超时时间
- ConnectTimeout: 60000
- #对所有操作请求都进行重试
- OkToRetryOnAllOperations: true
-
-#对外暴露端口
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: always
-
-#项目模块集中配置
-blade:
- #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
- datasource:
- dev:
- url: jdbc:mysql://localhost:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true
- username: root
- password: root
diff --git a/blade-ops/blade-config-server/target/classes/config/application-prod.yml b/blade-ops/blade-config-server/target/classes/config/application-prod.yml
deleted file mode 100644
index a41ae71..0000000
--- a/blade-ops/blade-config-server/target/classes/config/application-prod.yml
+++ /dev/null
@@ -1,83 +0,0 @@
-#服务器配置
-server:
- undertow:
- # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
- io-threads: 4
- # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
- worker-threads: 20
- # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
- buffer-size: 1024
- # 是否分配的直接内存
- direct-buffers: true
-
-#spring配置
-spring:
- redis:
- ##redis 单机环境配置
- host: 192.168.186.129
- port: 3379
- password:
- database: 0
- ssl: false
- ##redis 集群环境配置
- #cluster:
- # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
- # commandTimeout: 5000
- devtools:
- restart:
- log-condition-evaluation-delta: false
-
-#feign配置
-feign:
- hystrix:
- enabled: true
- okhttp:
- enabled: true
- httpclient:
- enabled: false
-
-#hystrix配置
-hystrix:
- threadpool:
- default:
- coreSize: 300
- maxQueueSize: 1000
- queueSizeRejectionThreshold: 800
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 720000
-
-#ribbon配置
-ribbon:
- #对当前实例的重试次数
- MaxAutoRetries: 1
- #切换实例的重试次数
- MaxAutoRetriesNextServer: 2
- #请求处理的超时时间
- ReadTimeout: 60000
- #请求连接的超时时间
- ConnectTimeout: 60000
- #对所有操作请求都进行重试
- OkToRetryOnAllOperations: true
-
-#对外暴露端口
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: always
-
-#项目模块集中配置
-blade:
- #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
- datasource:
- prod:
- url: jdbc:mysql://192.168.186.129:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true
- username: root
- password: root
diff --git a/blade-ops/blade-config-server/target/classes/config/application-test.yml b/blade-ops/blade-config-server/target/classes/config/application-test.yml
deleted file mode 100644
index bd17831..0000000
--- a/blade-ops/blade-config-server/target/classes/config/application-test.yml
+++ /dev/null
@@ -1,83 +0,0 @@
-#服务器配置
-server:
- undertow:
- # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
- io-threads: 4
- # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
- worker-threads: 20
- # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
- buffer-size: 1024
- # 是否分配的直接内存
- direct-buffers: true
-
-#spring配置
-spring:
- redis:
- ##redis 单机环境配置
- host: 192.168.186.129
- port: 3379
- password:
- database: 0
- ssl: false
- ##redis 集群环境配置
- #cluster:
- # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
- # commandTimeout: 5000
- devtools:
- restart:
- log-condition-evaluation-delta: false
-
-#feign配置
-feign:
- hystrix:
- enabled: true
- okhttp:
- enabled: true
- httpclient:
- enabled: false
-
-#hystrix配置
-hystrix:
- threadpool:
- default:
- coreSize: 300
- maxQueueSize: 1000
- queueSizeRejectionThreshold: 800
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 720000
-
-#ribbon配置
-ribbon:
- #对当前实例的重试次数
- MaxAutoRetries: 1
- #切换实例的重试次数
- MaxAutoRetriesNextServer: 2
- #请求处理的超时时间
- ReadTimeout: 60000
- #请求连接的超时时间
- ConnectTimeout: 60000
- #对所有操作请求都进行重试
- OkToRetryOnAllOperations: true
-
-#对外暴露端口
-management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- health:
- show-details: always
-
-#项目模块集中配置
-blade:
- #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖)
- datasource:
- test:
- url: jdbc:mysql://192.168.186.129:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true
- username: root
- password: root
diff --git a/blade-ops/blade-config-server/target/classes/config/blade-dashboard-dev.yml b/blade-ops/blade-config-server/target/classes/config/blade-dashboard-dev.yml
deleted file mode 100644
index a2a845c..0000000
--- a/blade-ops/blade-config-server/target/classes/config/blade-dashboard-dev.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-blade:
- modules:
- id: 1
- name: dashboard-dev
\ No newline at end of file
diff --git a/blade-ops/blade-config-server/target/classes/config/blade-dashboard-prod.yml b/blade-ops/blade-config-server/target/classes/config/blade-dashboard-prod.yml
deleted file mode 100644
index 41b04c6..0000000
--- a/blade-ops/blade-config-server/target/classes/config/blade-dashboard-prod.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-blade:
- modules:
- id: 1
- name: dashboard-prod
\ No newline at end of file
diff --git a/blade-ops/blade-config-server/target/classes/config/blade-dashboard-test.yml b/blade-ops/blade-config-server/target/classes/config/blade-dashboard-test.yml
deleted file mode 100644
index 1e3e491..0000000
--- a/blade-ops/blade-config-server/target/classes/config/blade-dashboard-test.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-blade:
- modules:
- id: 3
- name: dashboard-test
\ No newline at end of file
diff --git a/blade-ops/blade-config-server/target/classes/org/springblade/config/BladeConfigApplication.class b/blade-ops/blade-config-server/target/classes/org/springblade/config/BladeConfigApplication.class
deleted file mode 100644
index 0bed9ba..0000000
Binary files a/blade-ops/blade-config-server/target/classes/org/springblade/config/BladeConfigApplication.class and /dev/null differ
diff --git a/blade-ops/blade-develop/blade-develop.iml b/blade-ops/blade-develop/blade-develop.iml
index 1c36f82..a2d424c 100644
--- a/blade-ops/blade-develop/blade-develop.iml
+++ b/blade-ops/blade-develop/blade-develop.iml
@@ -20,10 +20,87 @@
- * 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.
- */
-package $!{package.Controller};
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import lombok.AllArgsConstructor;
-import javax.validation.Valid;
-
-import org.springblade.core.mp.support.Condition;
-import org.springblade.core.mp.support.Query;
-import org.springblade.system.feign.IDictClient;
-import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.Func;
-import org.springframework.web.bind.annotation.*;
-#if($!{superEntityClass})
-import org.springframework.web.bind.annotation.RequestParam;
-#end
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import $!{package.Entity}.$!{entity};
-#set($voPackage=$package.Entity.replace("entity","vo"))
-import $!{voPackage}.$!{entity}VO;
-#set($wrapperPackage=$package.Entity.replace("entity","wrapper"))
-import $!{wrapperPackage}.$!{entity}Wrapper;
-import $!{package.Service}.$!{table.serviceName};
-#if($!{superControllerClassPackage})
-import $!{superControllerClassPackage};
-#end
-#if(!$!{superEntityClass})
-#end
-import java.util.List;
-
-/**
- * $!{table.comment} 控制器
- *
- * @author $!{author}
- * @since $!{date}
- */
-@RestController
-@AllArgsConstructor
-@RequestMapping("#if($!{package.ModuleName})/$!{package.ModuleName}#end/$!{table.entityPath}")
-@Api(value = "$!{table.comment}", tags = "$!{table.comment}接口")
-#if($!{superControllerClass})
-public class $!{table.controllerName} extends $!{superControllerClass} {
-#else
-public class $!{table.controllerName} {
-#end
-
- private $!{table.serviceName} $!{table.entityPath}Service;
-
- private IDictClient dictClient;
-
- /**
- * 详情
- */
- @GetMapping("/detail")
- @ApiOperation(value = "详情", notes = "传入$!{table.entityPath}", position = 1)
- public R<$!{entity}VO> detail($!{entity} $!{table.entityPath}) {
- $!{entity} detail = $!{table.entityPath}Service.getOne(Condition.getQueryWrapper($!{table.entityPath}));
- $!{entity}Wrapper $!{table.entityPath}Wrapper = new $!{entity}Wrapper(dictClient);
- return R.data($!{table.entityPath}Wrapper.entityVO(detail));
- }
-
- /**
- * 分页 $!{table.comment}
- */
- @GetMapping("/list")
- @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}", position = 2)
- public R
- * 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.
- */
-package $!{package.Entity};
-
-#foreach($pkg in $!{table.importPackages})
-import $!{pkg};
-#end
-#if($!{entityLombokModel})
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-#end
-#if($!{swagger2})
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-#end
-
-/**
- * $!{table.comment}实体类
- *
- * @author $!{author}
- * @since $!{date}
- */
-#if($!{entityLombokModel})
-@Data
-#end
-#if($!{table.convert})
-@TableName("$!{table.name}")
-#end
-#if($!{superEntityClass})
-@EqualsAndHashCode(callSuper = true)
-#end
-#if($!{swagger2})
-@ApiModel(value = "$!{entity}对象", description = #if ("$!{table.comment}"=="")"$!{entity}对象"#else"$!{table.comment}"#end)
-#end
-#if($!{superEntityClass})
-public class $!{entity} extends $!{superEntityClass}#if($!{activeRecord})<$!{entity}>#end {
-#elseif($!{activeRecord})
-@Accessors(chain = true)
-public class $!{entity} extends Model<$!{entity}> {
-#else
-public class $!{entity} implements Serializable {
-#end
-
- private static final long serialVersionUID = 1L;
-
-## ---------- BEGIN 字段循环遍历 ----------
-#foreach($field in $!{table.fields})
-#if($!{field.keyFlag})
-#set($keyPropertyName=$!{field.propertyName})
-#end
-#if("$!field.comment" != "")
- /**
- * $!{field.comment}
- */
- #if($!{swagger2})
- @ApiModelProperty(value = "$!{field.comment}")
- #end
-#end
-#if($!{field.keyFlag})
-## 主键
-#if($!{field.keyIdentityFlag})
- @TableId(value = "$!{field.name}", type = IdType.AUTO)
-#elseif(!$null.isNull($!{idType}) && "$!idType" != "")
- @TableId(value = "$!{field.name}", type = IdType.$!{idType})
-#elseif($!{field.convert})
- @TableId("$!{field.name}")
-#end
-## 普通字段
-#elseif($!{field.fill})
-## ----- 存在字段填充设置 -----
-#if($!{field.convert})
- @TableField(value = "$!{field.name}", fill = FieldFill.$!{field.fill})
-#else
- @TableField(fill = FieldFill.$!{field.fill})
-#end
-#elseif($!{field.convert})
- @TableField("$!{field.name}")
-#end
-## 乐观锁注解
-#if($!{versionFieldName}==$!{field.name})
- @Version
-#end
-## 逻辑删除注解
-#if($!{logicDeleteFieldName}==$!{field.name})
- @TableLogic
-#end
- private $!{field.propertyType} $!{field.propertyName};
-
-#end
-## ---------- END 字段循环遍历 ----------
-
-#if(!$!{entityLombokModel})
-#foreach($field in $!{table.fields})
-#if($!{field.propertyType.equals("boolean")})
-#set($getprefix="is")
-#else
-#set($getprefix="get")
-#end
-
- public $!{field.propertyType} $!{getprefix}$!{field.capitalName}() {
- return $!{field.propertyName};
- }
-
-#if($!{entityBuilderModel})
- public $!{entity} set$!{field.capitalName}($!{field.propertyType} $!{field.propertyName}) {
-#else
- public void set$!{field.capitalName}($!{field.propertyType} $!{field.propertyName}) {
-#end
- this.$!{field.propertyName} = $!{field.propertyName};
-#if($!{entityBuilderModel})
- return this;
-#end
- }
-#end
-#end
-
-#if($!{entityColumnConstant})
-#foreach($field in $!{table.fields})
- public static final String $!{field.name.toUpperCase()} = "$!{field.name}";
-
-#end
-#end
-#if($!{activeRecord})
- @Override
- protected Serializable pkVal() {
-#if($!{keyPropertyName})
- return this.$!{keyPropertyName};
-#else
- return this.id;
-#end
- }
-
-#end
-#if(!$!{entityLombokModel})
- @Override
- public String toString() {
- return "$!{entity}{" +
-#foreach($field in $!{table.fields})
-#if($!{velocityCount}==1)
- "$!{field.propertyName}=" + $!{field.propertyName} +
-#else
- ", $!{field.propertyName}=" + $!{field.propertyName} +
-#end
-#end
- "}";
- }
-#end
-}
diff --git a/blade-ops/blade-develop/target/classes/templates/mapper.xml.vm b/blade-ops/blade-develop/target/classes/templates/mapper.xml.vm
deleted file mode 100644
index 77eb3dc..0000000
--- a/blade-ops/blade-develop/target/classes/templates/mapper.xml.vm
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
- * 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.
- */
-package $!{package.ServiceImpl};
-
-import $!{package.Entity}.$!{entity};
-#set($voPackage=$package.Entity.replace("entity","vo"))
-import $!{voPackage}.$!{entity}VO;
-import $!{package.Mapper}.$!{table.mapperName};
-import $!{package.Service}.$!{table.serviceName};
-import $!{superServiceImplClassPackage};
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-
-/**
- * $!{table.comment} 服务实现类
- *
- * @author $!{author}
- * @since $!{date}
- */
-@Service
-#if($!{kotlin})
-open class $!{table.serviceImplName} : $!{superServiceImplClass}<$!{table.mapperName}, $!{entity}>(), $!{table.serviceName} {
-
-}
-#else
-public class $!{table.serviceImplName} extends $!{superServiceImplClass}<$!{table.mapperName}, $!{entity}> implements $!{table.serviceName} {
-
- @Override
- public IPage<$!{entity}VO> select$!{entity}Page(IPage<$!{entity}VO> page, $!{entity}VO $!{table.entityPath}) {
- return page.setRecords(baseMapper.select$!{entity}Page(page, $!{table.entityPath}));
- }
-
-}
-#end
diff --git a/blade-ops/blade-develop/target/classes/templates/sword/action.js.vm b/blade-ops/blade-develop/target/classes/templates/sword/action.js.vm
deleted file mode 100644
index e0eb476..0000000
--- a/blade-ops/blade-develop/target/classes/templates/sword/action.js.vm
+++ /dev/null
@@ -1,37 +0,0 @@
-#set($upperEntityPath=$table.entityPath.toUpperCase())
-export const $!{upperEntityPath}_NAMESPACE = '$!{table.entityPath}';
-
-export function $!{upperEntityPath}_LIST(payload) {
- return {
- type: `${$!{upperEntityPath}_NAMESPACE}/fetchList`,
- payload,
- };
-}
-
-export function $!{upperEntityPath}_DETAIL(id) {
- return {
- type: `${$!{upperEntityPath}_NAMESPACE}/fetchDetail`,
- payload: { id },
- };
-}
-
-export function $!{upperEntityPath}_CLEAR_DETAIL() {
- return {
- type: `${$!{upperEntityPath}_NAMESPACE}/clearDetail`,
- payload: {},
- };
-}
-
-export function $!{upperEntityPath}_SUBMIT(payload) {
- return {
- type: `${$!{upperEntityPath}_NAMESPACE}/submit`,
- payload,
- };
-}
-
-export function $!{upperEntityPath}_REMOVE(payload) {
- return {
- type: `${$!{upperEntityPath}_NAMESPACE}/remove`,
- payload,
- };
-}
diff --git a/blade-ops/blade-develop/target/classes/templates/sword/add.js.vm b/blade-ops/blade-develop/target/classes/templates/sword/add.js.vm
deleted file mode 100644
index b1480a4..0000000
--- a/blade-ops/blade-develop/target/classes/templates/sword/add.js.vm
+++ /dev/null
@@ -1,73 +0,0 @@
-#set($upperEntityPath=$table.entityPath.toUpperCase())
-import React, { PureComponent } from 'react';
-import { Form, Input, Card, Button } from 'antd';
-import { connect } from 'dva';
-import Panel from '../../../components/Panel';
-import styles from '../../../layouts/Sword.less';
-import { $!{upperEntityPath}_SUBMIT } from '../../../actions/$!{table.entityPath}';
-
-const FormItem = Form.Item;
-
-@connect(({ loading }) => ({
- submitting: loading.effects['$!{table.entityPath}/submit'],
-}))
-@Form.create()
-class $!{entity}Add extends PureComponent {
- handleSubmit = e => {
- e.preventDefault();
- const { dispatch, form } = this.props;
- form.validateFieldsAndScroll((err, values) => {
- if (!err) {
- dispatch($!{upperEntityPath}_SUBMIT(values));
- }
- });
- };
-
- render() {
- const {
- form: { getFieldDecorator },
- submitting,
- } = this.props;
-
- const formItemLayout = {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 },
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 12 },
- md: { span: 10 },
- },
- };
-
- const action = (
-
- );
-
- return (
-
+ * 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.
+ */
+package org.springblade.demo.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.modules.system.service.IDictService;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.demo.entity.Blog;
+import org.springblade.demo.vo.BlogVO;
+import org.springblade.demo.wrapper.BlogWrapper;
+import org.springblade.demo.service.IBlogService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 控制器
+ *
+ * @author BladeX
+ * @since 2019-02-13
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/blog")
+@Api(value = "", tags = "接口")
+public class BlogController extends BladeController {
+
+ private IBlogService blogService;
+
+ private IDictService dictService;
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperation(value = "详情", notes = "传入blog", position = 1)
+ public R
+ * 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.
+ */
+package org.springblade.demo.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2019-02-13
+ */
+@Data
+@TableName("blade_blog")
+@ApiModel(value = "Blog对象", description = "Blog对象")
+public class Blog implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+ private String blogTitle;
+
+ private String blogContent;
+
+ private LocalDateTime blogDate;
+
+ private Integer isDeleted;
+
+
+
+}
diff --git a/blade-ops/blade-develop/target/classes/templates/mapper.java.vm b/src/main/java/org/springblade/demo/mapper/BlogMapper.java
similarity index 58%
rename from blade-ops/blade-develop/target/classes/templates/mapper.java.vm
rename to src/main/java/org/springblade/demo/mapper/BlogMapper.java
index 81f3422..92be5a7 100644
--- a/blade-ops/blade-develop/target/classes/templates/mapper.java.vm
+++ b/src/main/java/org/springblade/demo/mapper/BlogMapper.java
@@ -13,34 +13,29 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package $!{package.Mapper};
+package org.springblade.demo.mapper;
-import $!{package.Entity}.$!{entity};
-#set($voPackage=$package.Entity.replace("entity","vo"))
-import $!{voPackage}.$!{entity}VO;
-import $!{superMapperClassPackage};
+import org.springblade.demo.entity.Blog;
+import org.springblade.demo.vo.BlogVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
- * $!{table.comment} Mapper 接口
+ * Mapper 接口
*
- * @author $!{author}
- * @since $!{date}
+ * @author BladeX
+ * @since 2019-02-13
*/
-#if($!{kotlin})
-interface $!{table.mapperName} : $!{superMapperClass}<$!{entity}>
-#else
-public interface $!{table.mapperName} extends $!{superMapperClass}<$!{entity}> {
+public interface BlogMapper extends BaseMapper
+ * 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.
+ */
+package org.springblade.demo.service.impl;
+
+import org.springblade.demo.entity.Blog;
+import org.springblade.demo.vo.BlogVO;
+import org.springblade.demo.mapper.BlogMapper;
+import org.springblade.demo.service.IBlogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 服务实现类
+ *
+ * @author BladeX
+ * @since 2019-02-13
+ */
+@Service
+public class BlogServiceImpl extends ServiceImpl