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也是对商业应用友好的许可。使用者也可以在需要 - - + + diff --git a/blade-auth/blade-auth.iml b/blade-auth/blade-auth.iml index da71a68..3364ac3 100644 --- a/blade-auth/blade-auth.iml +++ b/blade-auth/blade-auth.iml @@ -20,17 +20,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + - - + + + + + @@ -40,70 +118,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + @@ -114,6 +155,8 @@ + + @@ -122,11 +165,49 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -134,21 +215,8 @@ - - - - - - - - - - - - - - + @@ -164,25 +232,38 @@ - + - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml index 66d97d0..1189c84 100644 --- a/blade-auth/pom.xml +++ b/blade-auth/pom.xml @@ -8,7 +8,7 @@ SpringBlade org.springblade - 2.0.0-RC3 + 2.0.0 blade-auth @@ -23,6 +23,11 @@ blade-common ${blade.project.version} + + org.springblade + blade-core-cloud + ${blade.tool.version} + org.springblade blade-core-secure @@ -43,11 +48,6 @@ blade-core-swagger ${blade.tool.version} - - - org.springframework.cloud - spring-cloud-starter-config - diff --git a/blade-auth/src/main/resources/bootstrap.yml b/blade-auth/src/main/resources/bootstrap.yml index 27a6297..64cec20 100644 --- a/blade-auth/src/main/resources/bootstrap.yml +++ b/blade-auth/src/main/resources/bootstrap.yml @@ -1,12 +1,2 @@ server: port: 8100 - -spring: - cloud: - config: - label: master - profile: ${blade.env} - fail-fast: true - discovery: - enabled: true - service-id: blade-config-server diff --git a/blade-common/blade-common.iml b/blade-common/blade-common.iml index 3415ccd..102ff0c 100644 --- a/blade-common/blade-common.iml +++ b/blade-common/blade-common.iml @@ -20,10 +20,45 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -31,20 +66,19 @@ - - - - - - + + + + + - - - - - + + + + + @@ -54,23 +88,29 @@ - - + + - - - - - - - - - + + + + + + + + + + + + + + + - + @@ -86,9 +126,11 @@ + - - + + + @@ -97,44 +139,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/blade-common/pom.xml b/blade-common/pom.xml index 9210932..41c103a 100644 --- a/blade-common/pom.xml +++ b/blade-common/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 @@ -20,6 +20,12 @@ blade-core-launch ${blade.tool.version} + + net.dreamlu + mica-auto + ${mica.auto.version} + provided + diff --git a/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java b/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java index 1d838a7..76f5e89 100644 --- a/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java +++ b/blade-common/src/main/java/org/springblade/common/constant/CommonConstant.java @@ -8,19 +8,24 @@ package org.springblade.common.constant; public interface CommonConstant { /** - * consul dev 地址 + * nacos dev 地址 */ - String CONSUL_DEV_HOST = "http://localhost"; + String NACOS_DEV_ADDR = "127.0.0.1:8848"; /** - * consul prod 地址 + * nacos prod 地址 */ - String CONSUL_PROD_HOST = "http://192.168.186.129"; + String NACOS_PROD_ADDR = "192.168.186.129:8848"; /** - * consul端口 + * sentinel dev 地址 */ - String CONSUL_PORT = "8500"; + String SENTINEL_DEV_ADDR = "127.0.0.1:8858"; + + /** + * sentinel prod 地址 + */ + String SENTINEL_PROD_ADDR = "192.168.186.129:8858"; /** * 顶级父节点id @@ -37,4 +42,5 @@ public interface CommonConstant { * 默认密码 */ String DEFAULT_PASSWORD = "123456"; + } diff --git a/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java b/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java index 589d8a8..349570e 100644 --- a/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java +++ b/blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java @@ -32,8 +32,9 @@ public class LauncherServiceImpl implements LauncherService { @Override public void launcher(SpringApplicationBuilder builder, String appName, String profile) { Properties props = System.getProperties(); - props.setProperty("spring.cloud.consul.host", profile.equals(AppConstant.DEV_CDOE) ? CommonConstant.CONSUL_DEV_HOST : CommonConstant.CONSUL_PROD_HOST); - props.setProperty("spring.cloud.consul.port", CommonConstant.CONSUL_PORT); + props.setProperty("spring.cloud.nacos.discovery.server-addr", profile.equals(AppConstant.DEV_CDOE) ? CommonConstant.NACOS_DEV_ADDR : CommonConstant.NACOS_PROD_ADDR); + props.setProperty("spring.cloud.nacos.config.server-addr", profile.equals(AppConstant.DEV_CDOE) ? CommonConstant.NACOS_DEV_ADDR : CommonConstant.NACOS_PROD_ADDR); + props.setProperty("spring.cloud.sentinel.transport.dashboard", profile.equals(AppConstant.DEV_CDOE) ? CommonConstant.SENTINEL_DEV_ADDR : CommonConstant.SENTINEL_PROD_ADDR); } } diff --git a/blade-common/target/classes/META-INF/services/org.springblade.core.launch.service.LauncherService b/blade-common/target/classes/META-INF/services/org.springblade.core.launch.service.LauncherService deleted file mode 100644 index 87512c9..0000000 --- a/blade-common/target/classes/META-INF/services/org.springblade.core.launch.service.LauncherService +++ /dev/null @@ -1 +0,0 @@ -org.springblade.common.launch.LauncherServiceImpl diff --git a/blade-common/target/classes/META-INF/spring-devtools.properties b/blade-common/target/classes/META-INF/spring-devtools.properties deleted file mode 100644 index 4aae8ab..0000000 --- a/blade-common/target/classes/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.blade-common=/blade-common[\\w-]+\.jar \ No newline at end of file diff --git a/blade-common/target/classes/META-INF/spring.factories b/blade-common/target/classes/META-INF/spring.factories deleted file mode 100644 index be9adc5..0000000 --- a/blade-common/target/classes/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.common.config.BladeCommonConfiguration diff --git a/blade-common/target/classes/org/springblade/common/cache/CacheNames.class b/blade-common/target/classes/org/springblade/common/cache/CacheNames.class deleted file mode 100644 index 26e27f1..0000000 Binary files a/blade-common/target/classes/org/springblade/common/cache/CacheNames.class and /dev/null differ diff --git a/blade-common/target/classes/org/springblade/common/config/BladeCommonConfiguration.class b/blade-common/target/classes/org/springblade/common/config/BladeCommonConfiguration.class deleted file mode 100644 index ef6536e..0000000 Binary files a/blade-common/target/classes/org/springblade/common/config/BladeCommonConfiguration.class and /dev/null differ diff --git a/blade-common/target/classes/org/springblade/common/constant/CommonConstant.class b/blade-common/target/classes/org/springblade/common/constant/CommonConstant.class deleted file mode 100644 index 59b4acb..0000000 Binary files a/blade-common/target/classes/org/springblade/common/constant/CommonConstant.class and /dev/null differ diff --git a/blade-common/target/classes/org/springblade/common/launch/LauncherServiceImpl.class b/blade-common/target/classes/org/springblade/common/launch/LauncherServiceImpl.class deleted file mode 100644 index 37fc909..0000000 Binary files a/blade-common/target/classes/org/springblade/common/launch/LauncherServiceImpl.class and /dev/null differ diff --git a/blade-common/target/classes/org/springblade/common/tool/CommonUtil.class b/blade-common/target/classes/org/springblade/common/tool/CommonUtil.class deleted file mode 100644 index 52e3ccb..0000000 Binary files a/blade-common/target/classes/org/springblade/common/tool/CommonUtil.class and /dev/null differ diff --git a/blade-gateway/blade-gateway.iml b/blade-gateway/blade-gateway.iml index 4c80386..0e690df 100644 --- a/blade-gateway/blade-gateway.iml +++ b/blade-gateway/blade-gateway.iml @@ -15,10 +15,63 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -26,19 +79,66 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - @@ -50,23 +150,27 @@ + - + + + - + - - - - - - + + + + + + + - - + + @@ -77,6 +181,8 @@ + + @@ -85,59 +191,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -150,20 +205,17 @@ - - - + + + - - - - - - + + + \ No newline at end of file diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml index 1f0dd29..43c2d71 100644 --- a/blade-gateway/pom.xml +++ b/blade-gateway/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 @@ -51,10 +51,30 @@ org.springframework.boot spring-boot-starter-data-redis-reactive - + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + org.springframework.cloud - spring-cloud-starter-config + spring-cloud-starter-netflix-hystrix + + + commons-logging + commons-logging + + + + + org.springframework.cloud + spring-cloud-starter-alibaba-nacos-discovery + ${alibaba.cloud.version} + + + org.springframework.cloud + spring-cloud-starter-alibaba-nacos-config + ${alibaba.cloud.version} diff --git a/blade-gateway/src/main/java/org/springblade/gateway/controller/DiscoveryClientController.java b/blade-gateway/src/main/java/org/springblade/gateway/controller/DiscoveryClientController.java index d72deb7..4568fe9 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/controller/DiscoveryClientController.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/controller/DiscoveryClientController.java @@ -15,15 +15,11 @@ */ package org.springblade.gateway.controller; -import com.ecwid.consul.v1.ConsulClient; -import com.ecwid.consul.v1.health.model.Check; -import com.ecwid.consul.v1.health.model.HealthService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -44,8 +40,6 @@ public class DiscoveryClientController { private final DiscoveryClient discoveryClient; - private final ConsulClient consulClient; - /** * 获取服务实例 */ @@ -60,46 +54,4 @@ public class DiscoveryClientController { return instances; } - /** - * 删除指定无效服务 - * - * @param serviceName 服务名 - * @return - */ - @RequestMapping("/deRegister/{serviceName}") - public String deRegister(@PathVariable String serviceName) { - serviceDeregister(serviceName); - return "服务删除成功"; - } - - /** - * 删除所有无效服务 - * - * @return - */ - @RequestMapping("/deRegisterAll") - public String deRegisterAll() { - consulClient.getAgentChecks().getValue().forEach((k, v) -> serviceDeregister(v.getServiceName())); - return "服务删除成功"; - } - - /** - * 根据serviceName删除无效服务 - * - * @param serviceName - */ - public void serviceDeregister(String serviceName) { - List response = consulClient.getHealthServices(serviceName, false, null).getValue(); - for (HealthService service : response) { - // 创建一个用来剔除无效实例的ConsulClient,连接到无效实例注册的agent - ConsulClient clearClient = new ConsulClient(service.getNode().getAddress()); - service.getChecks().forEach(check -> { - if (check.getStatus() != Check.CheckStatus.PASSING) { - log.info("deregister : {}", check.getServiceId()); - clearClient.agentServiceDeregister(check.getServiceId()); - } - }); - } - } - } diff --git a/blade-gateway/src/main/resources/bootstrap.yml b/blade-gateway/src/main/resources/bootstrap.yml index dead78e..c7f53a9 100644 --- a/blade-gateway/src/main/resources/bootstrap.yml +++ b/blade-gateway/src/main/resources/bootstrap.yml @@ -10,13 +10,6 @@ blade: spring: cloud: - config: - label: master - profile: ${blade.env} - fail-fast: true - discovery: - enabled: true - service-id: blade-config-server gateway: routes: # 认证中心 diff --git a/blade-ops/blade-admin/blade-admin.iml b/blade-ops/blade-admin/blade-admin.iml index 6bb051d..3fbffc7 100644 --- a/blade-ops/blade-admin/blade-admin.iml +++ b/blade-ops/blade-admin/blade-admin.iml @@ -20,11 +20,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + @@ -32,20 +99,19 @@ - - - - - - + + + + + - - - - - + + + + + @@ -55,58 +121,45 @@ - - + + + + + + + + + + + - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - + + @@ -117,6 +170,8 @@ + + @@ -125,15 +180,30 @@ - - - - + + + + + + + + + + + + + + + + + + + - - - + + + @@ -145,26 +215,53 @@ - + - + - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml index b2ffd9d..45ed799 100644 --- a/blade-ops/blade-admin/pom.xml +++ b/blade-ops/blade-admin/pom.xml @@ -5,7 +5,7 @@ blade-ops org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 @@ -26,6 +26,11 @@ blade-core-launch ${blade.tool.version} + + org.springblade + blade-core-cloud + ${blade.tool.version} + de.codecentric diff --git a/blade-ops/blade-admin/src/main/java/org/springblade/admin/BladeAdminApplication.java b/blade-ops/blade-admin/src/main/java/org/springblade/admin/AdminApplication.java similarity index 81% rename from blade-ops/blade-admin/src/main/java/org/springblade/admin/BladeAdminApplication.java rename to blade-ops/blade-admin/src/main/java/org/springblade/admin/AdminApplication.java index 71f4166..4e4ece6 100644 --- a/blade-ops/blade-admin/src/main/java/org/springblade/admin/BladeAdminApplication.java +++ b/blade-ops/blade-admin/src/main/java/org/springblade/admin/AdminApplication.java @@ -16,9 +16,9 @@ package org.springblade.admin; import de.codecentric.boot.admin.server.config.EnableAdminServer; -import org.springblade.core.launch.constant.AppConstant; import org.springblade.core.launch.BladeApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springblade.core.launch.constant.AppConstant; +import org.springframework.cloud.client.SpringCloudApplication; /** * admin启动器 @@ -26,11 +26,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @author Chill */ @EnableAdminServer -@SpringBootApplication -public class BladeAdminApplication { +@SpringCloudApplication +public class AdminApplication { public static void main(String[] args) { - BladeApplication.run(AppConstant.APPLICATION_ADMIN_NAME, BladeAdminApplication.class, args); + BladeApplication.run(AppConstant.APPLICATION_ADMIN_NAME, AdminApplication.class, args); } } diff --git a/blade-ops/blade-admin/src/main/resources/bootstrap.yml b/blade-ops/blade-admin/src/main/resources/bootstrap.yml index 859023d..af767c9 100644 --- a/blade-ops/blade-admin/src/main/resources/bootstrap.yml +++ b/blade-ops/blade-admin/src/main/resources/bootstrap.yml @@ -11,20 +11,7 @@ server: direct-buffers: true spring: - cloud: - zookeeper: - discovery: - register: false boot: admin: discovery: ignored-services: consul - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always \ No newline at end of file diff --git a/blade-ops/blade-config-server/Dockerfile b/blade-ops/blade-config-server/Dockerfile deleted file mode 100644 index 160cf30..0000000 --- a/blade-ops/blade-config-server/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM anapsix/alpine-java:8_server-jre_unlimited - -MAINTAINER smallchill@163.com - -RUN mkdir -p /blade/config - -WORKDIR /blade/config - -EXPOSE 7005 - -ADD ./target/blade-config-server.jar ./app.jar - -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] - -CMD ["--spring.profiles.active=test"] diff --git a/blade-ops/blade-config-server/README.md b/blade-ops/blade-config-server/README.md deleted file mode 100644 index bb97f0c..0000000 --- a/blade-ops/blade-config-server/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# bladex-config - -##bladex配置文件仓库部署步骤 - -1.建好git仓库,并建好文件夹,如:respo - -2.将/config下的文件放到respo文件夹下,并push到git - -3.到/resources/bootstrap.yml文件,修改spring.cloud.config.git节点下对应的配置 - -4.启动工程,开启config-server服务 - -##访问请求 - -在浏览器里输入:http://localhost:7005/application/dev/master - 或 http://localhost:7005/application-dev.yml - 或 http://localhost:7005/application-dev.properties - -证明配置服务中心可以从远程程序获取配置信息,http请求地址和资源文件映射如下: -·        /{application}/{profile}/{label} -·        /{application}-{profile}.yml -·        /{label}/{application}-{profile}.yml -·        /{application}-{profile}.properties -·        /{label}/{application}-{profile}.properties diff --git a/blade-ops/blade-config-server/blade-config-server.iml b/blade-ops/blade-config-server/blade-config-server.iml deleted file mode 100644 index 9d3a543..0000000 --- a/blade-ops/blade-config-server/blade-config-server.iml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/blade-ops/blade-config-server/pom.xml b/blade-ops/blade-config-server/pom.xml deleted file mode 100644 index 67c6789..0000000 --- a/blade-ops/blade-config-server/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - blade-ops - org.springblade - 2.0.0-RC3 - - 4.0.0 - - blade-config-server - ${project.artifactId} - ${blade.project.version} - jar - - - - - org.springblade - blade-common - ${blade.project.version} - - - org.springblade - blade-core-launch - ${blade.tool.version} - - - - org.springframework.cloud - spring-cloud-config-server - - - - - - - com.spotify - docker-maven-plugin - ${docker.plugin.version} - - ${docker.registry.url}/blade/${project.artifactId}:${project.version} - ${project.basedir} - ${docker.registry.host} - - - / - ${project.build.directory} - ${project.build.finalName}.jar - - - ${docker.registry.url} - ${docker.registry.url} - true - - - - - - diff --git a/blade-ops/blade-config-server/src/main/java/org/springblade/config/BladeConfigApplication.java b/blade-ops/blade-config-server/src/main/java/org/springblade/config/BladeConfigApplication.java deleted file mode 100644 index 0851b59..0000000 --- a/blade-ops/blade-config-server/src/main/java/org/springblade/config/BladeConfigApplication.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.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. - */ -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 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32,31 +109,22 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - + + @@ -66,80 +134,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - + + @@ -149,6 +157,8 @@ + + @@ -157,10 +167,68 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -183,7 +251,7 @@ - + @@ -197,17 +265,42 @@ - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml index b7d15a0..6019cb3 100644 --- a/blade-ops/blade-develop/pom.xml +++ b/blade-ops/blade-develop/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-ops - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-ops/blade-develop/src/main/resources/templates/sword/list.js.vm b/blade-ops/blade-develop/src/main/resources/templates/sword/list.js.vm index dd5604b..72a6eef 100644 --- a/blade-ops/blade-develop/src/main/resources/templates/sword/list.js.vm +++ b/blade-ops/blade-develop/src/main/resources/templates/sword/list.js.vm @@ -52,7 +52,7 @@ class $!{entity} extends PureComponent { const { form, loading, - param: { data }, + $!{table.entityPath}: { data }, } = this.props; const columns = [ diff --git a/blade-ops/blade-develop/target/classes/META-INF/spring-devtools.properties b/blade-ops/blade-develop/target/classes/META-INF/spring-devtools.properties deleted file mode 100644 index b5841f4..0000000 --- a/blade-ops/blade-develop/target/classes/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.blade-develop=/blade-develop[\\w-]+\.jar \ No newline at end of file diff --git a/blade-ops/blade-develop/target/classes/META-INF/spring.factories b/blade-ops/blade-develop/target/classes/META-INF/spring.factories deleted file mode 100644 index d3bab83..0000000 --- a/blade-ops/blade-develop/target/classes/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.develop.DevelopApplication diff --git a/blade-ops/blade-develop/target/classes/application-dev.yml b/blade-ops/blade-develop/target/classes/application-dev.yml deleted file mode 100644 index e81d987..0000000 --- a/blade-ops/blade-develop/target/classes/application-dev.yml +++ /dev/null @@ -1,10 +0,0 @@ -#服务器端口 -server: - port: 7007 - -#数据源配置 -spring: - datasource: - url: ${blade.datasource.dev.url} - username: ${blade.datasource.dev.username} - password: ${blade.datasource.dev.password} diff --git a/blade-ops/blade-develop/target/classes/application-prod.yml b/blade-ops/blade-develop/target/classes/application-prod.yml deleted file mode 100644 index bf8af97..0000000 --- a/blade-ops/blade-develop/target/classes/application-prod.yml +++ /dev/null @@ -1,10 +0,0 @@ -#服务器端口 -server: - port: 7007 - -#数据源配置 -spring: - datasource: - url: ${blade.datasource.prod.url} - username: ${blade.datasource.prod.username} - password: ${blade.datasource.prod.password} diff --git a/blade-ops/blade-develop/target/classes/application-test.yml b/blade-ops/blade-develop/target/classes/application-test.yml deleted file mode 100644 index e8a77d1..0000000 --- a/blade-ops/blade-develop/target/classes/application-test.yml +++ /dev/null @@ -1,10 +0,0 @@ -#服务器端口 -server: - port: 7007 - -#数据源配置 -spring: - datasource: - url: ${blade.datasource.test.url} - username: ${blade.datasource.test.username} - password: ${blade.datasource.test.password} diff --git a/blade-ops/blade-develop/target/classes/generator.properties b/blade-ops/blade-develop/target/classes/generator.properties deleted file mode 100644 index 58bec8f..0000000 --- a/blade-ops/blade-develop/target/classes/generator.properties +++ /dev/null @@ -1,5 +0,0 @@ -spring.datasource.driver-class-name=com.mysql.jdbc.Driver -spring.datasource.url=jdbc:mysql://localhost:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false -spring.datasource.username=root -spring.datasource.password=root -author=BladeX diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/DevelopApplication.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/DevelopApplication.class deleted file mode 100644 index 3adab6d..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/DevelopApplication.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/controller/CodeController.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/controller/CodeController.class deleted file mode 100644 index b906920..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/controller/CodeController.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/entity/Code.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/entity/Code.class deleted file mode 100644 index e344942..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/entity/Code.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/mapper/CodeMapper.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/mapper/CodeMapper.class deleted file mode 100644 index 2af3383..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/mapper/CodeMapper.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/mapper/CodeMapper.xml b/blade-ops/blade-develop/target/classes/org/springblade/develop/mapper/CodeMapper.xml deleted file mode 100644 index d282aaf..0000000 --- a/blade-ops/blade-develop/target/classes/org/springblade/develop/mapper/CodeMapper.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - select - id, service_name, code_name, table_name, pk_name, model_name, package_name, api_path, web_path, is_deleted - - - diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/service/ICodeService.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/service/ICodeService.class deleted file mode 100644 index d98bea6..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/service/ICodeService.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/service/impl/CodeServiceImpl.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/service/impl/CodeServiceImpl.class deleted file mode 100644 index ed2fe6c..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/service/impl/CodeServiceImpl.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$1.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$1.class deleted file mode 100644 index dbd1a99..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$1.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$10.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$10.class deleted file mode 100644 index 13596a3..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$10.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$11.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$11.class deleted file mode 100644 index 71d51f7..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$11.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$2.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$2.class deleted file mode 100644 index 4596804..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$2.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$3.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$3.class deleted file mode 100644 index a0bea17..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$3.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$4.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$4.class deleted file mode 100644 index f38c008..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$4.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$5.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$5.class deleted file mode 100644 index f0dec86..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$5.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$6.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$6.class deleted file mode 100644 index b5de576..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$6.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$7.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$7.class deleted file mode 100644 index 97b6798..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$7.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$8.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$8.class deleted file mode 100644 index 28cc540..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$8.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$9.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$9.class deleted file mode 100644 index a439701..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator$9.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator.class deleted file mode 100644 index 6c90a89..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/BladeGenerator.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/CodeGenerator.class b/blade-ops/blade-develop/target/classes/org/springblade/develop/support/CodeGenerator.class deleted file mode 100644 index 10db376..0000000 Binary files a/blade-ops/blade-develop/target/classes/org/springblade/develop/support/CodeGenerator.class and /dev/null differ diff --git a/blade-ops/blade-develop/target/classes/templates/controller.java.vm b/blade-ops/blade-develop/target/classes/templates/controller.java.vm deleted file mode 100644 index 49ff4c4..0000000 --- a/blade-ops/blade-develop/target/classes/templates/controller.java.vm +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.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. - */ -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> list($!{entity} $!{table.entityPath}, Query query) { - IPage<$!{entity}> pages = $!{table.entityPath}Service.page(Condition.getPage(query), Condition.getQueryWrapper($!{table.entityPath})); - $!{entity}Wrapper $!{table.entityPath}Wrapper = new $!{entity}Wrapper(dictClient); - return R.data($!{table.entityPath}Wrapper.pageVO(pages)); - } - - /** - * 自定义分页 $!{table.comment} - */ - @GetMapping("/page") - @ApiOperation(value = "分页", notes = "传入$!{table.entityPath}", position = 3) - public R> page($!{entity}VO $!{table.entityPath}, Query query) { - IPage<$!{entity}VO> pages = $!{table.entityPath}Service.select$!{entity}Page(Condition.getPage(query), $!{table.entityPath}); - return R.data(pages); - } - - /** - * 新增 $!{table.comment} - */ - @PostMapping("/save") - @ApiOperation(value = "新增", notes = "传入$!{table.entityPath}", position = 4) - public R save(@Valid @RequestBody $!{entity} $!{table.entityPath}) { - return R.status($!{table.entityPath}Service.save($!{table.entityPath})); - } - - /** - * 修改 $!{table.comment} - */ - @PostMapping("/update") - @ApiOperation(value = "修改", notes = "传入$!{table.entityPath}", position = 5) - public R update(@Valid @RequestBody $!{entity} $!{table.entityPath}) { - return R.status($!{table.entityPath}Service.updateById($!{table.entityPath})); - } - - /** - * 新增或修改 $!{table.comment} - */ - @PostMapping("/submit") - @ApiOperation(value = "新增或修改", notes = "传入$!{table.entityPath}", position = 6) - public R submit(@Valid @RequestBody $!{entity} $!{table.entityPath}) { - return R.status($!{table.entityPath}Service.saveOrUpdate($!{table.entityPath})); - } - - #if($!{superEntityClass}) - - /** - * 删除 $!{table.comment} - */ - @PostMapping("/remove") - @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7) - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status($!{table.entityPath}Service.deleteLogic(Func.toIntList(ids))); - } - - #else - - /** - * 删除 $!{table.comment} - */ - @PostMapping("/remove") - @ApiOperation(value = "物理删除", notes = "传入ids", position = 7) - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status($!{table.entityPath}Service.removeByIds(Func.toIntList(ids))); - } - - #end - -} diff --git a/blade-ops/blade-develop/target/classes/templates/entity.java.vm b/blade-ops/blade-develop/target/classes/templates/entity.java.vm deleted file mode 100644 index e182b7a..0000000 --- a/blade-ops/blade-develop/target/classes/templates/entity.java.vm +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.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. - */ -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 @@ - - - - -#if($!{enableCache}) - - - -#end -#if($!{baseResultMap}) - - -#foreach($field in $!{table.fields}) -#if($!{field.keyFlag})##生成主键排在第一位 - -#end -#end -#foreach($field in $!{table.commonFields})##生成公共字段 - -#end -#foreach($field in $!{table.fields}) -#if(!$!{field.keyFlag})##生成普通字段 - -#end -#end - - -#end -#if($!{baseColumnList}) - - - select - #foreach($field in $!{table.commonFields}) - #if($!{field.name} == $!{field.propertyName})$!{field.name}#else$!{field.name} AS $!{field.propertyName}#end, - #end - $!{table.fieldNames} - - - - -#end - diff --git a/blade-ops/blade-develop/target/classes/templates/serviceImpl.java.vm b/blade-ops/blade-develop/target/classes/templates/serviceImpl.java.vm deleted file mode 100644 index d025d13..0000000 --- a/blade-ops/blade-develop/target/classes/templates/serviceImpl.java.vm +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.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. - */ -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 ( - -

- -#foreach($field in $!{table.fields}) - - {getFieldDecorator('$!{field.propertyName}', { - rules: [ - { - required: true, - message: '请输入$!{field.comment}', - }, - ], - })()} - -#end - -
- - ); - } -} - -export default $!{entity}Add; diff --git a/blade-ops/blade-develop/target/classes/templates/sword/edit.js.vm b/blade-ops/blade-develop/target/classes/templates/sword/edit.js.vm deleted file mode 100644 index 87d9903..0000000 --- a/blade-ops/blade-develop/target/classes/templates/sword/edit.js.vm +++ /dev/null @@ -1,97 +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}_DETAIL, $!{upperEntityPath}_SUBMIT } from '../../../actions/$!{table.entityPath}'; - -const FormItem = Form.Item; - -@connect(({ $!{table.entityPath}, loading }) => ({ - $!{table.entityPath}, - submitting: loading.effects['code/submit'], -})) -@Form.create() -class $!{entity}Edit extends PureComponent { - componentWillMount() { - const { - dispatch, - match: { - params: { id }, - }, - } = this.props; - dispatch($!{upperEntityPath}_DETAIL(id)); - } - - handleSubmit = e => { - e.preventDefault(); - const { - dispatch, - match: { - params: { id }, - }, - form, - } = this.props; - form.validateFieldsAndScroll((err, values) => { - if (!err) { - const params = { - id, - ...values, - }; - console.log(params); - dispatch($!{upperEntityPath}_SUBMIT(params)); - } - }); - }; - - render() { - const { - form: { getFieldDecorator }, - $!{table.entityPath}: { detail }, - 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 ( - -
- -#foreach($field in $!{table.fields}) - - {getFieldDecorator('$!{field.propertyName}', { - rules: [ - { - required: true, - message: '请输入$!{field.comment}', - }, - ], - initialValue: detail.$!{field.propertyName}, - })()} - -#end - -
-
- ); - } -} - -export default $!{entity}Edit; diff --git a/blade-ops/blade-develop/target/classes/templates/sword/list.js.vm b/blade-ops/blade-develop/target/classes/templates/sword/list.js.vm deleted file mode 100644 index dd5604b..0000000 --- a/blade-ops/blade-develop/target/classes/templates/sword/list.js.vm +++ /dev/null @@ -1,82 +0,0 @@ -#set($upperEntityPath=$table.entityPath.toUpperCase()) -import React, { PureComponent } from 'react'; -import { connect } from 'dva'; -import { Button, Col, Form, Input, Row } from 'antd'; -import Panel from '../../../components/Panel'; -import { $!{upperEntityPath}_LIST } from '../../../actions/$!{table.entityPath}'; -import Grid from '../../../components/Sword/Grid'; - -const FormItem = Form.Item; - -@connect(({ $!{table.entityPath}, loading }) => ({ - $!{table.entityPath}, - loading: loading.models.param, -})) -@Form.create() -class $!{entity} extends PureComponent { - // ============ 查询 =============== - handleSearch = params => { - const { dispatch } = this.props; - dispatch($!{upperEntityPath}_LIST(params)); - }; - - // ============ 查询表单 =============== - renderSearchForm = onReset => { - const { form } = this.props; - const { getFieldDecorator } = form; - - return ( - - - - {getFieldDecorator('name')()} - - - -
- - -
- -
- ); - }; - - render() { - const code = '$!{table.entityPath}'; - - const { - form, - loading, - param: { data }, - } = this.props; - - const columns = [ -#foreach($field in $!{table.fields}) - { - title: '$!{field.comment}', - dataIndex: '$!{field.propertyName}', - }, -#end - ]; - - return ( - - - - ); - } -} -export default $!{entity}; diff --git a/blade-ops/blade-develop/target/classes/templates/sword/model.js.vm b/blade-ops/blade-develop/target/classes/templates/sword/model.js.vm deleted file mode 100644 index 54b40c1..0000000 --- a/blade-ops/blade-develop/target/classes/templates/sword/model.js.vm +++ /dev/null @@ -1,84 +0,0 @@ -#set($upperEntityPath=$table.entityPath.toUpperCase()) -import { message } from 'antd'; -import router from 'umi/router'; -import { $!{upperEntityPath}_NAMESPACE } from '../actions/$!{table.entityPath}'; -import { list, submit, detail, remove } from '../services/$!{table.entityPath}'; - -export default { - namespace: $!{upperEntityPath}_NAMESPACE, - state: { - data: { - list: [], - pagination: false, - }, - detail: {}, - }, - effects: { - *fetchList({ payload }, { call, put }) { - const response = yield call(list, payload); - if (response.success) { - yield put({ - type: 'saveList', - payload: { - list: response.data, - pagination: false, - }, - }); - } - }, - *fetchDetail({ payload }, { call, put }) { - const response = yield call(detail, payload); - if (response.success) { - yield put({ - type: 'saveDetail', - payload: { - detail: response.data, - }, - }); - } - }, - *clearDetail({ payload }, { put }) { - yield put({ - type: 'removeDetail', - payload: { payload }, - }); - }, - *submit({ payload }, { call }) { - const response = yield call(submit, payload); - if (response.success) { - message.success('提交成功'); - router.push('/$!{cfg.servicePackage}/$!{table.entityPath}'); - } - }, - *remove({ payload }, { call }) { - const { - data: { keys }, - success, - } = payload; - const response = yield call(remove, { ids: keys }); - if (response.success) { - success(); - } - }, - }, - reducers: { - saveList(state, action) { - return { - ...state, - data: action.payload, - }; - }, - saveDetail(state, action) { - return { - ...state, - detail: action.payload.detail, - }; - }, - removeDetail(state) { - return { - ...state, - detail: {}, - }; - }, - }, -}; diff --git a/blade-ops/blade-develop/target/classes/templates/sword/service.js.vm b/blade-ops/blade-develop/target/classes/templates/sword/service.js.vm deleted file mode 100644 index 47b9676..0000000 --- a/blade-ops/blade-develop/target/classes/templates/sword/service.js.vm +++ /dev/null @@ -1,26 +0,0 @@ -#set($params="$" + "{stringify" + "(params)" + "}") -import { stringify } from 'qs'; -import func from '../utils/Func'; -import request from '../utils/request'; - -export async function list(params) { - return request(`/api/$!{cfg.serviceName}/$!{table.entityPath}/list?$!{params}`); -} - -export async function submit(params) { - return request('/api/$!{cfg.serviceName}/$!{table.entityPath}/submit', { - method: 'POST', - body: params, - }); -} - -export async function detail(params) { - return request(`/api/$!{cfg.serviceName}/$!{table.entityPath}/detail?$!{params}`); -} - -export async function remove(params) { - return request('/api/$!{cfg.serviceName}/$!{table.entityPath}/remove', { - method: 'POST', - body: func.toFormData(params), - }); -} diff --git a/blade-ops/blade-develop/target/classes/templates/sword/view.js.vm b/blade-ops/blade-develop/target/classes/templates/sword/view.js.vm deleted file mode 100644 index 0f985db..0000000 --- a/blade-ops/blade-develop/target/classes/templates/sword/view.js.vm +++ /dev/null @@ -1,74 +0,0 @@ -#set($upperEntityPath=$table.entityPath.toUpperCase()) -import React, { PureComponent } from 'react'; -import router from 'umi/router'; -import { Form, Card, Button } from 'antd'; -import { connect } from 'dva'; -import Panel from '../../../components/Panel'; -import styles from '../../../layouts/Sword.less'; -import { $!{upperEntityPath}_DETAIL } from '../../../actions/$!{table.entityPath}'; - -const FormItem = Form.Item; - -@connect(({ $!{table.entityPath} }) => ({ - $!{table.entityPath}, -})) -@Form.create() -class $!{entity}View extends PureComponent { - componentWillMount() { - const { - dispatch, - match: { - params: { id }, - }, - } = this.props; - dispatch($!{upperEntityPath}_DETAIL(id)); - } - - handleEdit = () => { - const { - match: { - params: { id }, - }, - } = this.props; - router.push(`/$!{cfg.servicePackage}/$!{table.entityPath}/edit/${id}`); - }; - - render() { - const { - $!{table.entityPath}: { detail }, - } = this.props; - - const formItemLayout = { - labelCol: { - xs: { span: 24 }, - sm: { span: 7 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 12 }, - md: { span: 10 }, - }, - }; - - const action = ( - - ); - - return ( - -
- -#foreach($field in $!{table.fields}) - - {detail.$!{field.propertyName}} - -#end - -
-
- ); - } -} -export default $!{entity}View; diff --git a/blade-ops/blade-ops.iml b/blade-ops/blade-ops.iml index 1f1c297..beff754 100644 --- a/blade-ops/blade-ops.iml +++ b/blade-ops/blade-ops.iml @@ -8,18 +8,75 @@ + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml index 32f52cb..6e616cf 100644 --- a/blade-ops/pom.xml +++ b/blade-ops/pom.xml @@ -5,7 +5,7 @@ SpringBlade org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 @@ -14,7 +14,6 @@ blade-admin blade-develop - blade-config-server diff --git a/blade-service-api/blade-desk-api/blade-desk-api.iml b/blade-service-api/blade-desk-api/blade-desk-api.iml index c293f05..05769c7 100644 --- a/blade-service-api/blade-desk-api/blade-desk-api.iml +++ b/blade-service-api/blade-desk-api/blade-desk-api.iml @@ -19,7 +19,45 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -27,20 +65,19 @@ - + - - - - - - - - + + + + + + + - - + + @@ -50,16 +87,16 @@ - + - - - + + + @@ -67,67 +104,16 @@ - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -141,10 +127,10 @@ - - + + - + @@ -163,18 +149,38 @@ - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml index 664166a..6c41bdd 100644 --- a/blade-service-api/blade-desk-api/pom.xml +++ b/blade-service-api/blade-desk-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-service-api/blade-dict-api/blade-dict-api.iml b/blade-service-api/blade-dict-api/blade-dict-api.iml index c293f05..05769c7 100644 --- a/blade-service-api/blade-dict-api/blade-dict-api.iml +++ b/blade-service-api/blade-dict-api/blade-dict-api.iml @@ -19,7 +19,45 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -27,20 +65,19 @@ - + - - - - - - - - + + + + + + + - - + + @@ -50,16 +87,16 @@ - + - - - + + + @@ -67,67 +104,16 @@ - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -141,10 +127,10 @@ - - + + - + @@ -163,18 +149,38 @@ - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml index ca04253..3b8f611 100644 --- a/blade-service-api/blade-dict-api/pom.xml +++ b/blade-service-api/blade-dict-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-service-api/blade-dict-api/target/classes/META-INF/spring-devtools.properties b/blade-service-api/blade-dict-api/target/classes/META-INF/spring-devtools.properties deleted file mode 100644 index 5ad0e21..0000000 --- a/blade-service-api/blade-dict-api/target/classes/META-INF/spring-devtools.properties +++ /dev/null @@ -1 +0,0 @@ -restart.include.blade-dict-api=/blade-dict-api[\\w-]+\.jar \ No newline at end of file diff --git a/blade-service-api/blade-dict-api/target/classes/META-INF/spring.factories b/blade-service-api/blade-dict-api/target/classes/META-INF/spring.factories deleted file mode 100644 index 325facd..0000000 --- a/blade-service-api/blade-dict-api/target/classes/META-INF/spring.factories +++ /dev/null @@ -1,4 +0,0 @@ -net.dreamlu.mica.feign.MicaFeignAutoConfiguration=\ - org.springblade.system.feign.IDictClient -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.springblade.system.config.DictFeignConfiguration diff --git a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/config/DictFeignConfiguration.class b/blade-service-api/blade-dict-api/target/classes/org/springblade/system/config/DictFeignConfiguration.class deleted file mode 100644 index 4575a4e..0000000 Binary files a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/config/DictFeignConfiguration.class and /dev/null differ diff --git a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/dto/DictDTO.class b/blade-service-api/blade-dict-api/target/classes/org/springblade/system/dto/DictDTO.class deleted file mode 100644 index c2d6b45..0000000 Binary files a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/dto/DictDTO.class and /dev/null differ diff --git a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/entity/Dict.class b/blade-service-api/blade-dict-api/target/classes/org/springblade/system/entity/Dict.class deleted file mode 100644 index e32ab38..0000000 Binary files a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/entity/Dict.class and /dev/null differ diff --git a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/feign/IDictClient.class b/blade-service-api/blade-dict-api/target/classes/org/springblade/system/feign/IDictClient.class deleted file mode 100644 index e306cbe..0000000 Binary files a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/feign/IDictClient.class and /dev/null differ diff --git a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/feign/IDictClientFallback.class b/blade-service-api/blade-dict-api/target/classes/org/springblade/system/feign/IDictClientFallback.class deleted file mode 100644 index 928f3d7..0000000 Binary files a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/feign/IDictClientFallback.class and /dev/null differ diff --git a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/vo/DictVO.class b/blade-service-api/blade-dict-api/target/classes/org/springblade/system/vo/DictVO.class deleted file mode 100644 index 24936fa..0000000 Binary files a/blade-service-api/blade-dict-api/target/classes/org/springblade/system/vo/DictVO.class and /dev/null differ diff --git a/blade-service-api/blade-service-api.iml b/blade-service-api/blade-service-api.iml index 938f4e1..9b17c72 100644 --- a/blade-service-api/blade-service-api.iml +++ b/blade-service-api/blade-service-api.iml @@ -8,7 +8,45 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16,20 +54,19 @@ - + - - - - - - - - + + + + + + + - - + + @@ -39,16 +76,16 @@ - + - - - + + + @@ -56,67 +93,16 @@ - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -130,10 +116,10 @@ - - + + - + @@ -152,18 +138,38 @@ - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-service-api/blade-system-api/blade-system-api.iml b/blade-service-api/blade-system-api/blade-system-api.iml index c293f05..05769c7 100644 --- a/blade-service-api/blade-system-api/blade-system-api.iml +++ b/blade-service-api/blade-system-api/blade-system-api.iml @@ -19,7 +19,45 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -27,20 +65,19 @@ - + - - - - - - - - + + + + + + + - - + + @@ -50,16 +87,16 @@ - + - - - + + + @@ -67,67 +104,16 @@ - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -141,10 +127,10 @@ - - + + - + @@ -163,18 +149,38 @@ - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml index 331309b..0847d6d 100644 --- a/blade-service-api/blade-system-api/pom.xml +++ b/blade-service-api/blade-system-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-service-api/blade-user-api/blade-user-api.iml b/blade-service-api/blade-user-api/blade-user-api.iml index c293f05..05769c7 100644 --- a/blade-service-api/blade-user-api/blade-user-api.iml +++ b/blade-service-api/blade-user-api/blade-user-api.iml @@ -19,7 +19,45 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -27,20 +65,19 @@ - + - - - - - - - - + + + + + + + - - + + @@ -50,16 +87,16 @@ - + - - - + + + @@ -67,67 +104,16 @@ - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -141,10 +127,10 @@ - - + + - + @@ -163,18 +149,38 @@ - - + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml index df44265..af11500 100644 --- a/blade-service-api/blade-user-api/pom.xml +++ b/blade-service-api/blade-user-api/pom.xml @@ -5,7 +5,7 @@ blade-service-api org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml index dc160f3..df61f04 100644 --- a/blade-service-api/pom.xml +++ b/blade-service-api/pom.xml @@ -5,13 +5,13 @@ SpringBlade org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 blade-service-api ${project.artifactId} - 2.0.0-RC3 + 2.0.0 pom SpringBlade 微服务API集合 @@ -48,6 +48,12 @@ swagger-models ${swagger.models.version}
+ + net.dreamlu + mica-auto + ${mica.auto.version} + provided + diff --git a/blade-service/blade-desk/blade-desk.iml b/blade-service/blade-desk/blade-desk.iml index 52457dc..09ffab5 100644 --- a/blade-service/blade-desk/blade-desk.iml +++ b/blade-service/blade-desk/blade-desk.iml @@ -20,10 +20,87 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32,32 +109,23 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -67,10 +135,61 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,9 +197,9 @@ - + - + @@ -104,38 +223,64 @@ - - - - - + + + + + - + - + - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -146,68 +291,16 @@ + - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml index eb5106a..f76ece3 100644 --- a/blade-service/blade-desk/pom.xml +++ b/blade-service/blade-desk/pom.xml @@ -6,7 +6,7 @@ org.springblade blade-service - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-service/blade-log/blade-log.iml b/blade-service/blade-log/blade-log.iml index 7c2278d..d2ea65d 100644 --- a/blade-service/blade-log/blade-log.iml +++ b/blade-service/blade-log/blade-log.iml @@ -20,10 +20,87 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32,33 +109,24 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + + @@ -68,27 +136,11 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + @@ -101,7 +153,74 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -118,38 +237,48 @@ - - - - - + + + + + - + - + - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -160,52 +289,16 @@ + - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/blade-service/blade-log/pom.xml b/blade-service/blade-log/pom.xml index 41d9691..b9b67ef 100644 --- a/blade-service/blade-log/pom.xml +++ b/blade-service/blade-log/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-service/blade-log/src/main/java/org/springblade/core/log/BladeLogApplication.java b/blade-service/blade-log/src/main/java/org/springblade/core/log/LogApplication.java similarity index 89% rename from blade-service/blade-log/src/main/java/org/springblade/core/log/BladeLogApplication.java rename to blade-service/blade-log/src/main/java/org/springblade/core/log/LogApplication.java index 1050f5b..3a486f3 100644 --- a/blade-service/blade-log/src/main/java/org/springblade/core/log/BladeLogApplication.java +++ b/blade-service/blade-log/src/main/java/org/springblade/core/log/LogApplication.java @@ -27,10 +27,10 @@ import org.springframework.cloud.openfeign.EnableFeignClients; */ @SpringCloudApplication @EnableFeignClients(AppConstant.BASE_PACKAGES) -public class BladeLogApplication { +public class LogApplication { public static void main(String[] args) { - BladeApplication.run(AppConstant.APPLICATION_LOG_NAME, BladeLogApplication.class, args); + BladeApplication.run(AppConstant.APPLICATION_LOG_NAME, LogApplication.class, args); } } diff --git a/blade-service/blade-service.iml b/blade-service/blade-service.iml index d4d550b..67a3bbf 100644 --- a/blade-service/blade-service.iml +++ b/blade-service/blade-service.iml @@ -8,30 +8,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + - - - + + + @@ -41,23 +63,36 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -73,57 +108,19 @@ + - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/blade-service/blade-system/blade-system.iml b/blade-service/blade-system/blade-system.iml index b6e3700..b06480e 100644 --- a/blade-service/blade-system/blade-system.iml +++ b/blade-service/blade-system/blade-system.iml @@ -20,10 +20,87 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32,32 +109,23 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -67,10 +135,61 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,9 +197,9 @@ - + - + @@ -88,7 +207,7 @@ - + @@ -105,38 +224,63 @@ - - - - - + + + + + - + - + - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -147,67 +291,16 @@ + - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml index 9372823..7a9ab77 100644 --- a/blade-service/blade-system/pom.xml +++ b/blade-service/blade-system/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-service/blade-user/blade-user.iml b/blade-service/blade-user/blade-user.iml index 43946bf..3532066 100644 --- a/blade-service/blade-user/blade-user.iml +++ b/blade-service/blade-user/blade-user.iml @@ -20,10 +20,87 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -32,32 +109,23 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + @@ -67,10 +135,61 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,9 +197,9 @@ - + - + @@ -88,7 +207,7 @@ - + @@ -105,38 +224,63 @@ - - - - - + + + + + - + - + - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -147,67 +291,16 @@ + - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/blade-service/blade-user/pom.xml b/blade-service/blade-user/pom.xml index 3ae9292..ca174d8 100644 --- a/blade-service/blade-user/pom.xml +++ b/blade-service/blade-user/pom.xml @@ -5,7 +5,7 @@ blade-service org.springblade - 2.0.0-RC3 + 2.0.0 4.0.0 diff --git a/blade-service/pom.xml b/blade-service/pom.xml index 1bc8e8f..1e79f0c 100644 --- a/blade-service/pom.xml +++ b/blade-service/pom.xml @@ -6,14 +6,14 @@ blade-service ${project.artifactId} - 2.0.0-RC3 + 2.0.0 pom SpringBlade 微服务集合 org.springblade SpringBlade - 2.0.0-RC3 + 2.0.0 diff --git a/doc/consul/consul.md b/doc/consul/consul.md deleted file mode 100644 index f7ad3b8..0000000 --- a/doc/consul/consul.md +++ /dev/null @@ -1,45 +0,0 @@ -# 启动步骤 -## 安装consul -下载地址:https://www.consul.io/downloads.html - -安装启动然后访问consul web端:http://localhost:8500 -## 安装(mac) -```bash -brew install consul -``` - -## 启动 -### 命令方式: - -```bash -consul agent -server -bootstrap -bind 127.0.0.1 -client 0.0.0.0 -data-dir ./data -ui -datacenter=blade -``` - -### brew服务 -> 修改consul启动参数: -```bash -vim /usr/local/opt/consul/homebrew.mxcl.consul.plist -``` - -> 修改ProgramArguments部分: -```html -ProgramArguments - - /usr/local/opt/consul/bin/consul - agent - -server - -bootstrap - -advertise - 127.0.0.1 - -data-dir - ./data - -ui - -``` - -> 启动: -```bash -brew services start consul -``` - - diff --git a/doc/consul/spring-cloud-consul.pdf b/doc/consul/spring-cloud-consul.pdf deleted file mode 100644 index 7a58a3d..0000000 Binary files a/doc/consul/spring-cloud-consul.pdf and /dev/null differ diff --git a/doc/nacos/blade-dev.yaml b/doc/nacos/blade-dev.yaml new file mode 100644 index 0000000..1573526 --- /dev/null +++ b/doc/nacos/blade-dev.yaml @@ -0,0 +1,22 @@ +#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 + +#项目模块集中配置 +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/doc/nacos/blade-prod.yaml b/doc/nacos/blade-prod.yaml new file mode 100644 index 0000000..82ae8c6 --- /dev/null +++ b/doc/nacos/blade-prod.yaml @@ -0,0 +1,22 @@ +#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 + +#项目模块集中配置 +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/doc/nacos/blade-test.yaml b/doc/nacos/blade-test.yaml new file mode 100644 index 0000000..861cca8 --- /dev/null +++ b/doc/nacos/blade-test.yaml @@ -0,0 +1,22 @@ +#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 + +#项目模块集中配置 +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/application-dev.yml b/doc/nacos/blade.yaml similarity index 68% rename from blade-ops/blade-config-server/src/main/resources/config/application-dev.yml rename to doc/nacos/blade.yaml index dd2c405..ab14ff8 100644 --- a/blade-ops/blade-config-server/src/main/resources/config/application-dev.yml +++ b/doc/nacos/blade.yaml @@ -12,24 +12,15 @@ server: #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: + #hystrix: + #enabled: true + sentinel: enabled: true okhttp: enabled: true @@ -72,12 +63,3 @@ management: 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/pic/springblade-consul-nodes1.png b/pic/springblade-consul-nodes1.png deleted file mode 100644 index ebd73bf..0000000 Binary files a/pic/springblade-consul-nodes1.png and /dev/null differ diff --git a/pic/springblade-consul-nodes2.png b/pic/springblade-consul-nodes2.png deleted file mode 100644 index 3cc105e..0000000 Binary files a/pic/springblade-consul-nodes2.png and /dev/null differ diff --git a/pic/springblade-consul.png b/pic/springblade-consul.png deleted file mode 100644 index 24571ea..0000000 Binary files a/pic/springblade-consul.png and /dev/null differ diff --git a/pic/springblade-nacos.png b/pic/springblade-nacos.png new file mode 100644 index 0000000..7a789b4 Binary files /dev/null and b/pic/springblade-nacos.png differ diff --git a/pic/springblade-sentinel.png b/pic/springblade-sentinel.png new file mode 100644 index 0000000..8e6e4e6 Binary files /dev/null and b/pic/springblade-sentinel.png differ diff --git a/pom.xml b/pom.xml index 85fc595..c8efc15 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.springblade SpringBlade - 2.0.0-RC3 + 2.0.0 pom - 1.0.0-RC6 - 2.0.0-RC3 + 2.0.0 + 2.0.0 1.8 2.9.2 @@ -19,10 +19,11 @@ 3.0.7.1 4.0.1 1.6.0 - 1.0.0 + 1.0.1 + 0.2.1.RELEASE 2.0.2 - 2.0.7.RELEASE + 2.0.8.RELEASE Finchley.SR2 Cairo-SR5 @@ -79,10 +80,14 @@ true - net.dreamlu - mica-auto - ${mica.auto.version} - provided + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + commons-logging + commons-logging + + diff --git a/script/docker/.env b/script/docker/.env index 4a2722a..3b9bdb8 100644 --- a/script/docker/.env +++ b/script/docker/.env @@ -1,2 +1,2 @@ REGISTER=192.168.186.129/blade -TAG=1.0.0 +TAG=2.0.0 diff --git a/script/docker/deploy.sh b/script/docker/deploy.sh index ab7aa9a..1163c87 100644 --- a/script/docker/deploy.sh +++ b/script/docker/deploy.sh @@ -1,14 +1,14 @@ #使用说明,用来提示输入参数 usage() { - echo "Usage: sh 执行脚本.sh [port|base|modules|stop|rm|rmiNoneTag|services|health]" + echo "Usage: sh 执行脚本.sh [port|base|modules|stop|rm|rmiNoneTag]" exit 1 } #开启所需端口 port(){ firewall-cmd --add-port=88/tcp --permanent - firewall-cmd --add-port=8500/tcp --permanent + firewall-cmd --add-port=8848/tcp --permanent firewall-cmd --add-port=3306/tcp --permanent firewall-cmd --add-port=3379/tcp --permanent firewall-cmd --add-port=7002/tcp --permanent @@ -21,7 +21,7 @@ base(){ mkdir /docker/nginx cp nginx.conf /docker/nginx/nginx.conf fi - docker-compose up -d consul-server1 consul-server2 consul-server3 consul-node1 consul-node2 consul-nginx blade-redis blade-gateway1 blade-gateway2 blade-gateway3 blade-config-server blade-admin + docker-compose up -d blade-nginx blade-redis blade-gateway1 blade-gateway2 blade-gateway3 blade-admin } #启动程序模块 @@ -29,18 +29,6 @@ modules(){ docker-compose up -d blade-auth blade-user blade-desk blade-system blade-log } -#获取注册服务 -services(){ - RESULT=$(curl -s 127.0.0.1:8500/v1/catalog/services) - echo $RESULT -} - -#获取检查健康 -health(){ - RESULT=$(curl -s 127.0.0.1:8500/v1/health/checks/blade-config-server) - echo $RESULT -} - #关闭所有模块 stop(){ docker-compose stop @@ -76,12 +64,6 @@ case "$1" in "rmiNoneTag") rmiNoneTag ;; -"services") - services -;; -"health") - health -;; *) usage ;; diff --git a/script/docker/docker-compose.yml b/script/docker/docker-compose.yml index 4419a70..d3d2557 100644 --- a/script/docker/docker-compose.yml +++ b/script/docker/docker-compose.yml @@ -1,71 +1,8 @@ version: '3' services: - consul-server1: - image: consul:1.3.1 - hostname: "consul-server1" - volumes: - - /docker/consul/data1:/consul/data - command: "agent -server -bootstrap-expect 3 -ui -disable-host-node-id -client 0.0.0.0" - privileged: true - restart: always - networks: - blade_net: - ipv4_address: 172.30.0.51 - consul-server2: - image: consul:1.3.1 - depends_on: - - consul-server1 - hostname: "consul-server2" - volumes: - - /docker/consul/data2:/consul/data - command: "agent -server -ui -join consul-server1 -disable-host-node-id -client 0.0.0.0" - privileged: true - restart: always - networks: - blade_net: - ipv4_address: 172.30.0.52 - - consul-server3: - image: consul:1.3.1 - depends_on: - - consul-server1 - hostname: "consul-server3" - volumes: - - /docker/consul/data3:/consul/data - command: "agent -server -ui -join consul-server1 -disable-host-node-id -client 0.0.0.0" - privileged: true - restart: always - networks: - blade_net: - ipv4_address: 172.30.0.53 - - consul-node1: - image: consul:1.3.1 - depends_on: - - consul-server1 - hostname: "consul-node1" - command: "agent -join consul-server1 -disable-host-node-id" - privileged: true - restart: always - networks: - - blade_net - - consul-node2: - image: consul:1.3.1 - depends_on: - - consul-server1 - hostname: "consul-node2" - command: "agent -join consul-server1 -disable-host-node-id" - privileged: true - restart: always - networks: - - blade_net - - consul-nginx: + blade-nginx: image: nginx:stable-alpine-perl - depends_on: - - consul-server1 hostname: "consul-nginx" ports: - 8500:8500 @@ -90,19 +27,8 @@ services: networks: - blade_net - blade-config-server: - image: "${REGISTER}/blade-config-server:${TAG}" - depends_on: - - consul-server1 - privileged: true - restart: always - networks: - - blade_net - blade-admin: image: "${REGISTER}/blade-admin:${TAG}" - depends_on: - - blade-config-server ports: - 7002:7002 privileged: true @@ -112,8 +38,6 @@ services: blade-gateway1: image: "${REGISTER}/blade-gateway:${TAG}" - depends_on: - - blade-config-server privileged: true restart: always networks: @@ -122,8 +46,6 @@ services: blade-gateway2: image: "${REGISTER}/blade-gateway:${TAG}" - depends_on: - - blade-config-server privileged: true restart: always networks: @@ -132,8 +54,6 @@ services: blade-gateway3: image: "${REGISTER}/blade-gateway:${TAG}" - depends_on: - - blade-config-server privileged: true restart: always networks: @@ -142,8 +62,6 @@ services: blade-auth: image: "${REGISTER}/blade-auth:${TAG}" - depends_on: - - blade-config-server privileged: true restart: always networks: @@ -151,8 +69,6 @@ services: blade-log: image: "${REGISTER}/blade-log:${TAG}" - depends_on: - - blade-config-server privileged: true restart: always networks: @@ -160,8 +76,6 @@ services: blade-desk: image: "${REGISTER}/blade-desk:${TAG}" - depends_on: - - blade-config-server privileged: true restart: always networks: @@ -169,8 +83,6 @@ services: blade-user: image: "${REGISTER}/blade-user:${TAG}" - depends_on: - - blade-config-server privileged: true restart: always networks: @@ -178,8 +90,6 @@ services: blade-system: image: "${REGISTER}/blade-system:${TAG}" - depends_on: - - blade-config-server privileged: true restart: always networks: diff --git a/script/docker/nacos.md b/script/docker/nacos.md new file mode 100644 index 0000000..12e92b1 --- /dev/null +++ b/script/docker/nacos.md @@ -0,0 +1,3 @@ +* SpringBlade的注册中心 +* 具体文档详见:https://nacos.io/zh-cn/docs/quick-start.html +* docker部署详见:https://github.com/nacos-group/nacos-docker \ No newline at end of file diff --git a/script/docker/nginx.conf b/script/docker/nginx.conf index 05e9628..1bbef68 100644 --- a/script/docker/nginx.conf +++ b/script/docker/nginx.conf @@ -30,40 +30,23 @@ http { #include /etc/nginx/conf.d/*.conf; - upstream consul { - server 172.30.0.51:8500; - server 172.30.0.52:8500; - server 172.30.0.53:8500; - } - upstream gateway { server 172.30.0.81; server 172.30.0.82; server 172.30.0.83; } + server { - listen 8500; - server_name consul; + listen 88; + server_name gateway; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; - proxy_pass http://consul; + proxy_pass http://gateway; } - } - - server { - listen 88; - server_name gateway; - location / { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_buffering off; - proxy_pass http://gateway; - } - } + } } diff --git a/src/main/java/org/springblade/demo/controller/BlogController.java b/src/main/java/org/springblade/demo/controller/BlogController.java new file mode 100644 index 0000000..8325ed9 --- /dev/null +++ b/src/main/java/org/springblade/demo/controller/BlogController.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.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. + */ +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 detail(Blog blog) { + Blog detail = blogService.getOne(Condition.getQueryWrapper(blog)); + BlogWrapper blogWrapper = new BlogWrapper(dictService); + return R.data(blogWrapper.entityVO(detail)); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperation(value = "分页", notes = "传入blog", position = 2) + public R> list(Blog blog, Query query) { + IPage pages = blogService.page(Condition.getPage(query), Condition.getQueryWrapper(blog)); + BlogWrapper blogWrapper = new BlogWrapper(dictService); + return R.data(blogWrapper.pageVO(pages)); + } + + /** + * 自定义分页 + */ + @GetMapping("/page") + @ApiOperation(value = "分页", notes = "传入blog", position = 3) + public R> page(BlogVO blog, Query query) { + IPage pages = blogService.selectBlogPage(Condition.getPage(query), blog); + return R.data(pages); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperation(value = "新增", notes = "传入blog", position = 4) + public R save(@Valid @RequestBody Blog blog) { + return R.status(blogService.save(blog)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperation(value = "修改", notes = "传入blog", position = 5) + public R update(@Valid @RequestBody Blog blog) { + return R.status(blogService.updateById(blog)); + } + + /** + * 新增或修改 + */ + @PostMapping("/submit") + @ApiOperation(value = "新增或修改", notes = "传入blog", position = 6) + public R submit(@Valid @RequestBody Blog blog) { + return R.status(blogService.saveOrUpdate(blog)); + } + + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperation(value = "物理删除", notes = "传入ids", position = 7) + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(blogService.removeByIds(Func.toIntList(ids))); + } + + +} diff --git a/blade-ops/blade-develop/target/classes/templates/entityDTO.java.vm b/src/main/java/org/springblade/demo/dto/BlogDTO.java similarity index 71% rename from blade-ops/blade-develop/target/classes/templates/entityDTO.java.vm rename to src/main/java/org/springblade/demo/dto/BlogDTO.java index a7f0512..54d9a52 100644 --- a/blade-ops/blade-develop/target/classes/templates/entityDTO.java.vm +++ b/src/main/java/org/springblade/demo/dto/BlogDTO.java @@ -13,26 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#set($dtoPackage=$package.Entity.replace("entity","dto")) -package $!{dtoPackage}; +package org.springblade.demo.dto; -import $!{package.Entity}.$!{entity}; -#if($!{entityLombokModel}) +import org.springblade.demo.entity.Blog; import lombok.Data; import lombok.EqualsAndHashCode; -#end /** - * $!{table.comment}数据传输对象实体类 + * 数据传输对象实体类 * - * @author $!{author} - * @since $!{date} + * @author BladeX + * @since 2019-02-13 */ -#if($!{entityLombokModel}) @Data @EqualsAndHashCode(callSuper = true) -#end -public class $!{entity}DTO extends $!{entity} { +public class BlogDTO extends Blog { private static final long serialVersionUID = 1L; } diff --git a/src/main/java/org/springblade/demo/entity/Blog.java b/src/main/java/org/springblade/demo/entity/Blog.java new file mode 100644 index 0000000..67273ef --- /dev/null +++ b/src/main/java/org/springblade/demo/entity/Blog.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.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. + */ +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 { /** * 自定义分页 * * @param page - * @param $!{table.entityPath} + * @param blog * @return */ - List<$!{entity}VO> select$!{entity}Page(IPage page, $!{entity}VO $!{table.entityPath}); + List selectBlogPage(IPage page, BlogVO blog); } -#end diff --git a/src/main/java/org/springblade/demo/mapper/BlogMapper.xml b/src/main/java/org/springblade/demo/mapper/BlogMapper.xml new file mode 100644 index 0000000..a894846 --- /dev/null +++ b/src/main/java/org/springblade/demo/mapper/BlogMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + select + id, blog_title, blog_content, blog_date, is_deleted + + + + + diff --git a/blade-ops/blade-develop/target/classes/templates/service.java.vm b/src/main/java/org/springblade/demo/service/IBlogService.java similarity index 57% rename from blade-ops/blade-develop/target/classes/templates/service.java.vm rename to src/main/java/org/springblade/demo/service/IBlogService.java index 4b37a25..9e9fcd7 100644 --- a/blade-ops/blade-develop/target/classes/templates/service.java.vm +++ b/src/main/java/org/springblade/demo/service/IBlogService.java @@ -13,33 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package $!{package.Service}; +package org.springblade.demo.service; -import $!{package.Entity}.$!{entity}; -#set($voPackage=$package.Entity.replace("entity","vo")) -import $!{voPackage}.$!{entity}VO; -import $!{superServiceClassPackage}; +import org.springblade.demo.entity.Blog; +import org.springblade.demo.vo.BlogVO; +import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.core.metadata.IPage; /** - * $!{table.comment} 服务类 + * 服务类 * - * @author $!{author} - * @since $!{date} + * @author BladeX + * @since 2019-02-13 */ -#if($!{kotlin}) -interface $!{table.serviceName} : $!{superServiceClass}<$!{entity}> -#else -public interface $!{table.serviceName} extends $!{superServiceClass}<$!{entity}> { +public interface IBlogService extends IService { /** * 自定义分页 * * @param page - * @param $!{table.entityPath} + * @param blog * @return */ - IPage<$!{entity}VO> select$!{entity}Page(IPage<$!{entity}VO> page, $!{entity}VO $!{table.entityPath}); + IPage selectBlogPage(IPage page, BlogVO blog); } -#end diff --git a/src/main/java/org/springblade/demo/service/impl/BlogServiceImpl.java b/src/main/java/org/springblade/demo/service/impl/BlogServiceImpl.java new file mode 100644 index 0000000..e27f53f --- /dev/null +++ b/src/main/java/org/springblade/demo/service/impl/BlogServiceImpl.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.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. + */ +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 implements IBlogService { + + @Override + public IPage selectBlogPage(IPage page, BlogVO blog) { + return page.setRecords(baseMapper.selectBlogPage(page, blog)); + } + +} diff --git a/blade-ops/blade-develop/target/classes/templates/entityVO.java.vm b/src/main/java/org/springblade/demo/vo/BlogVO.java similarity index 63% rename from blade-ops/blade-develop/target/classes/templates/entityVO.java.vm rename to src/main/java/org/springblade/demo/vo/BlogVO.java index cc88136..76a6bf7 100644 --- a/blade-ops/blade-develop/target/classes/templates/entityVO.java.vm +++ b/src/main/java/org/springblade/demo/vo/BlogVO.java @@ -13,32 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#set($voPackage=$package.Entity.replace("entity","vo")) -package $!{voPackage}; +package org.springblade.demo.vo; -import $!{package.Entity}.$!{entity}; -#if($!{entityLombokModel}) +import org.springblade.demo.entity.Blog; import lombok.Data; import lombok.EqualsAndHashCode; -#end -#if($!{swagger2}) import io.swagger.annotations.ApiModel; -#end /** - * $!{table.comment}视图实体类 + * 视图实体类 * - * @author $!{author} - * @since $!{date} + * @author BladeX + * @since 2019-02-13 */ -#if($!{entityLombokModel}) @Data @EqualsAndHashCode(callSuper = true) -#end -#if($!{swagger2}) -@ApiModel(value = "$!{entity}VO对象", description = #if ("$!{table.comment}"=="")"$!{entity}VO对象"#else"$!{table.comment}"#end) -#end -public class $!{entity}VO extends $!{entity} { +@ApiModel(value = "BlogVO对象", description = "BlogVO对象") +public class BlogVO extends Blog { private static final long serialVersionUID = 1L; } diff --git a/blade-ops/blade-develop/target/classes/templates/wrapper.java.vm b/src/main/java/org/springblade/demo/wrapper/BlogWrapper.java similarity index 51% rename from blade-ops/blade-develop/target/classes/templates/wrapper.java.vm rename to src/main/java/org/springblade/demo/wrapper/BlogWrapper.java index 0f79a8e..04ee121 100644 --- a/blade-ops/blade-develop/target/classes/templates/wrapper.java.vm +++ b/src/main/java/org/springblade/demo/wrapper/BlogWrapper.java @@ -13,39 +13,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#set($wrapperPackage=$package.Entity.replace("entity","wrapper")) -package $!{wrapperPackage}; +package org.springblade.demo.wrapper; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; -import org.springblade.system.feign.IDictClient; -import $!{package.Entity}.$!{entity}; -#set($voPackage=$package.Entity.replace("entity","vo")) -import $!{voPackage}.$!{entity}VO; +import org.springblade.modules.system.service.IDictService; +import org.springblade.demo.entity.Blog; +import org.springblade.demo.vo.BlogVO; /** - * $!{table.comment}包装类,返回视图层所需的字段 + * 包装类,返回视图层所需的字段 * - * @author $!{author} - * @since $!{date} + * @author BladeX + * @since 2019-02-13 */ @AllArgsConstructor -public class $!{entity}Wrapper extends BaseEntityWrapper<$!{entity}, $!{entity}VO> { +public class BlogWrapper extends BaseEntityWrapper { - private IDictClient dictClient; + private IDictService dictService; @Override - public $!{entity}VO entityVO($!{entity} $!{table.entityPath}) { - $!{entity}VO $!{table.entityPath}VO = BeanUtil.copy($!{table.entityPath}, $!{entity}VO.class); + public BlogVO entityVO(Blog blog) { + BlogVO blogVO = BeanUtil.copy(blog, BlogVO.class); - /*R dict = dictClient.getValue("$!{table.entityPath}" , $!{table.entityPath}VO.getCategory()); + /*R dict = dictService.getValue("blog" , blogVO.getCategory()); if (dict.isSuccess()) { String categoryName = dict.getData(); - $!{table.entityPath}VO.setCategoryName(categoryName); + blogVO.setCategoryName(categoryName); }*/ - return $!{table.entityPath}VO; + return blogVO; } }