diff --git a/README.md b/README.md
index c8e861a..e378937 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
+
diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml
index d3f873d..801253a 100644
--- a/blade-auth/pom.xml
+++ b/blade-auth/pom.xml
@@ -8,7 +8,7 @@
SpringBlade
org.springblade
- 2.5.3
+ 2.5.4
blade-auth
diff --git a/blade-common/pom.xml b/blade-common/pom.xml
index 43907fd..03dcf26 100644
--- a/blade-common/pom.xml
+++ b/blade-common/pom.xml
@@ -5,7 +5,7 @@
SpringBlade
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
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 fccf3e3..0be8b2f 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
@@ -1,7 +1,5 @@
package org.springblade.common.constant;
-import org.springblade.core.launch.constant.AppConstant;
-
/**
* 通用常量
*
@@ -9,51 +7,6 @@ import org.springblade.core.launch.constant.AppConstant;
*/
public interface CommonConstant {
- /**
- * nacos dev 地址
- */
- String NACOS_DEV_ADDR = "127.0.0.1:8848";
-
- /**
- * nacos prod 地址
- */
- String NACOS_PROD_ADDR = "172.30.0.48:8848";
-
- /**
- * nacos test 地址
- */
- String NACOS_TEST_ADDR = "172.30.0.48:8848";
-
- /**
- * sentinel dev 地址
- */
- String SENTINEL_DEV_ADDR = "127.0.0.1:8858";
-
- /**
- * sentinel prod 地址
- */
- String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
-
- /**
- * sentinel test 地址
- */
- String SENTINEL_TEST_ADDR = "172.30.0.58:8858";
-
- /**
- * zipkin dev 地址
- */
- String ZIPKIN_DEV_ADDR = "http://127.0.0.1:9411";
-
- /**
- * zipkin prod 地址
- */
- String ZIPKIN_PROD_ADDR = "http://172.30.0.58:9411";
-
- /**
- * zipkin test 地址
- */
- String ZIPKIN_TEST_ADDR = "http://172.30.0.58:9411";
-
/**
* sword 系统名
*/
@@ -80,57 +33,4 @@ public interface CommonConstant {
*/
String DEFAULT_PASSWORD = "123456";
-
-
- /**
- * 动态获取nacos地址
- *
- * @param profile 环境变量
- * @return addr
- */
- static String nacosAddr(String profile) {
- switch (profile) {
- case (AppConstant.PROD_CODE):
- return NACOS_PROD_ADDR;
- case (AppConstant.TEST_CODE):
- return NACOS_TEST_ADDR;
- default:
- return NACOS_DEV_ADDR;
- }
- }
-
- /**
- * 动态获取sentinel地址
- *
- * @param profile 环境变量
- * @return addr
- */
- static String sentinelAddr(String profile) {
- switch (profile) {
- case (AppConstant.PROD_CODE):
- return SENTINEL_PROD_ADDR;
- case (AppConstant.TEST_CODE):
- return SENTINEL_TEST_ADDR;
- default:
- return SENTINEL_DEV_ADDR;
- }
- }
-
- /**
- * 动态获取zipkin地址
- *
- * @param profile 环境变量
- * @return addr
- */
- static String zipkinAddr(String profile) {
- switch (profile) {
- case (AppConstant.PROD_CODE):
- return ZIPKIN_PROD_ADDR;
- case (AppConstant.TEST_CODE):
- return ZIPKIN_TEST_ADDR;
- default:
- return ZIPKIN_DEV_ADDR;
- }
- }
-
}
diff --git a/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java b/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
new file mode 100644
index 0000000..abc2107
--- /dev/null
+++ b/blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
@@ -0,0 +1,113 @@
+package org.springblade.common.constant;
+
+import org.springblade.core.launch.constant.AppConstant;
+
+/**
+ * 通用常量
+ *
+ * @author Chill
+ */
+public interface LauncherConstant {
+
+ /**
+ * nacos namespace id
+ */
+ String NACOS_NAMESPACE = "f447a694-519a-4255-95f9-bcbb5a5d636";
+
+ /**
+ * nacos dev 地址
+ */
+ String NACOS_DEV_ADDR = "127.0.0.1:8848";
+
+ /**
+ * nacos prod 地址
+ */
+ String NACOS_PROD_ADDR = "172.30.0.48:8848";
+
+ /**
+ * nacos test 地址
+ */
+ String NACOS_TEST_ADDR = "172.30.0.48:8848";
+
+ /**
+ * sentinel dev 地址
+ */
+ String SENTINEL_DEV_ADDR = "127.0.0.1:8858";
+
+ /**
+ * sentinel prod 地址
+ */
+ String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
+
+ /**
+ * sentinel test 地址
+ */
+ String SENTINEL_TEST_ADDR = "172.30.0.58:8858";
+
+ /**
+ * zipkin dev 地址
+ */
+ String ZIPKIN_DEV_ADDR = "http://127.0.0.1:9411";
+
+ /**
+ * zipkin prod 地址
+ */
+ String ZIPKIN_PROD_ADDR = "http://172.30.0.58:9411";
+
+ /**
+ * zipkin test 地址
+ */
+ String ZIPKIN_TEST_ADDR = "http://172.30.0.58:9411";
+
+ /**
+ * 动态获取nacos地址
+ *
+ * @param profile 环境变量
+ * @return addr
+ */
+ static String nacosAddr(String profile) {
+ switch (profile) {
+ case (AppConstant.PROD_CODE):
+ return NACOS_PROD_ADDR;
+ case (AppConstant.TEST_CODE):
+ return NACOS_TEST_ADDR;
+ default:
+ return NACOS_DEV_ADDR;
+ }
+ }
+
+ /**
+ * 动态获取sentinel地址
+ *
+ * @param profile 环境变量
+ * @return addr
+ */
+ static String sentinelAddr(String profile) {
+ switch (profile) {
+ case (AppConstant.PROD_CODE):
+ return SENTINEL_PROD_ADDR;
+ case (AppConstant.TEST_CODE):
+ return SENTINEL_TEST_ADDR;
+ default:
+ return SENTINEL_DEV_ADDR;
+ }
+ }
+
+ /**
+ * 动态获取zipkin地址
+ *
+ * @param profile 环境变量
+ * @return addr
+ */
+ static String zipkinAddr(String profile) {
+ switch (profile) {
+ case (AppConstant.PROD_CODE):
+ return ZIPKIN_PROD_ADDR;
+ case (AppConstant.TEST_CODE):
+ return ZIPKIN_TEST_ADDR;
+ default:
+ return ZIPKIN_DEV_ADDR;
+ }
+ }
+
+}
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 9937a89..150c14c 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
@@ -16,6 +16,7 @@
package org.springblade.common.launch;
import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.launch.service.LauncherService;
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -31,10 +32,10 @@ public class LauncherServiceImpl implements LauncherService {
@Override
public void launcher(SpringApplicationBuilder builder, String appName, String profile) {
Properties props = System.getProperties();
- props.setProperty("spring.cloud.nacos.discovery.server-addr", CommonConstant.nacosAddr(profile));
- props.setProperty("spring.cloud.nacos.config.server-addr", CommonConstant.nacosAddr(profile));
- props.setProperty("spring.cloud.sentinel.transport.dashboard", CommonConstant.sentinelAddr(profile));
- props.setProperty("spring.zipkin.base-url", CommonConstant.zipkinAddr(profile));
+ props.setProperty("spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile));
+ props.setProperty("spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
+ props.setProperty("spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
+ props.setProperty("spring.zipkin.base-url", LauncherConstant.zipkinAddr(profile));
}
}
diff --git a/blade-gateway/pom.xml b/blade-gateway/pom.xml
index 0a77607..f1b989e 100644
--- a/blade-gateway/pom.xml
+++ b/blade-gateway/pom.xml
@@ -5,7 +5,7 @@
SpringBlade
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-ops/blade-admin/pom.xml b/blade-ops/blade-admin/pom.xml
index 198f9f0..488512d 100644
--- a/blade-ops/blade-admin/pom.xml
+++ b/blade-ops/blade-admin/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-ops/blade-develop/pom.xml b/blade-ops/blade-develop/pom.xml
index 5d68a4a..bfa9c3f 100644
--- a/blade-ops/blade-develop/pom.xml
+++ b/blade-ops/blade-develop/pom.xml
@@ -6,7 +6,7 @@
org.springblade
blade-ops
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-ops/blade-resource/pom.xml b/blade-ops/blade-resource/pom.xml
index a9961e9..332de8c 100644
--- a/blade-ops/blade-resource/pom.xml
+++ b/blade-ops/blade-resource/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-ops/blade-seata-order/pom.xml b/blade-ops/blade-seata-order/pom.xml
index a753666..942943d 100644
--- a/blade-ops/blade-seata-order/pom.xml
+++ b/blade-ops/blade-seata-order/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
@@ -15,6 +15,11 @@
jar
+
+ org.springblade
+ blade-common
+ ${blade.project.version}
+
org.springblade
blade-core-boot
diff --git a/blade-ops/blade-seata-storage/pom.xml b/blade-ops/blade-seata-storage/pom.xml
index 53083c6..e68987d 100644
--- a/blade-ops/blade-seata-storage/pom.xml
+++ b/blade-ops/blade-seata-storage/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
@@ -15,6 +15,11 @@
jar
+
+ org.springblade
+ blade-common
+ ${blade.project.version}
+
org.springblade
blade-core-boot
diff --git a/blade-ops/blade-zipkin/pom.xml b/blade-ops/blade-zipkin/pom.xml
index e68ca37..823ec02 100644
--- a/blade-ops/blade-zipkin/pom.xml
+++ b/blade-ops/blade-zipkin/pom.xml
@@ -5,7 +5,7 @@
blade-ops
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-ops/pom.xml b/blade-ops/pom.xml
index 7b331cb..456b502 100644
--- a/blade-ops/pom.xml
+++ b/blade-ops/pom.xml
@@ -5,7 +5,7 @@
SpringBlade
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service-api/blade-demo-api/pom.xml b/blade-service-api/blade-demo-api/pom.xml
new file mode 100644
index 0000000..a3d0c89
--- /dev/null
+++ b/blade-service-api/blade-demo-api/pom.xml
@@ -0,0 +1,18 @@
+
+
+
+ blade-service-api
+ org.springblade
+ 2.5.4
+
+ 4.0.0
+
+ blade-demo-api
+ ${project.artifactId}
+ ${blade.project.version}
+ jar
+
+
+
diff --git a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java
new file mode 100644
index 0000000..c58ab24
--- /dev/null
+++ b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/entity/Notice.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ */
+@Data
+@TableName("blade_notice")
+@EqualsAndHashCode(callSuper = true)
+public class Notice extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键id
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ @ApiModelProperty(value = "主键id")
+ private Integer id;
+
+ /**
+ * 标题
+ */
+ @ApiModelProperty(value = "标题")
+ private String title;
+
+ /**
+ * 通知类型
+ */
+ @ApiModelProperty(value = "通知类型")
+ private Integer category;
+
+ /**
+ * 发布日期
+ */
+ @ApiModelProperty(value = "发布日期")
+ private Date releaseTime;
+
+ /**
+ * 内容
+ */
+ @ApiModelProperty(value = "内容")
+ private String content;
+
+
+}
diff --git a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/feign/INoticeClient.java b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/feign/INoticeClient.java
new file mode 100644
index 0000000..740df4b
--- /dev/null
+++ b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/feign/INoticeClient.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.feign;
+
+import org.springblade.core.launch.constant.AppConstant;
+import org.springblade.core.tool.api.R;
+import com.example.demo.entity.Notice;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+/**
+ * Notice Feign接口类
+ *
+ * @author Chill
+ */
+@FeignClient(
+ value = AppConstant.APPLICATION_DESK_NAME
+)
+public interface INoticeClient {
+
+ String API_PREFIX = "/client";
+ String TOP = API_PREFIX + "/top";
+
+ /**
+ * 获取notice列表
+ *
+ * @param number
+ * @return
+ */
+ @GetMapping(TOP)
+ R> top(@RequestParam("number") Integer number);
+
+}
diff --git a/blade-service-api/blade-demo-api/src/main/java/com/example/demo/vo/NoticeVO.java b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/vo/NoticeVO.java
new file mode 100644
index 0000000..dfb0a66
--- /dev/null
+++ b/blade-service-api/blade-demo-api/src/main/java/com/example/demo/vo/NoticeVO.java
@@ -0,0 +1,20 @@
+package com.example.demo.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import com.example.demo.entity.Notice;
+
+/**
+ * 通知公告视图类
+ *
+ * @author Chill
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class NoticeVO extends Notice {
+
+ @ApiModelProperty(value = "通知类型名")
+ private String categoryName;
+
+}
diff --git a/blade-service-api/blade-desk-api/pom.xml b/blade-service-api/blade-desk-api/pom.xml
index 0ecc436..53ae981 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.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service-api/blade-dict-api/pom.xml b/blade-service-api/blade-dict-api/pom.xml
index 5c81a1a..c9e4392 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.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service-api/blade-system-api/pom.xml b/blade-service-api/blade-system-api/pom.xml
index 8c83e62..724c3d9 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.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service-api/blade-user-api/pom.xml b/blade-service-api/blade-user-api/pom.xml
index 6b90516..f33c47e 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.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service-api/pom.xml b/blade-service-api/pom.xml
index d93fe37..2d67218 100644
--- a/blade-service-api/pom.xml
+++ b/blade-service-api/pom.xml
@@ -5,13 +5,13 @@
SpringBlade
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
blade-service-api
${project.artifactId}
- 2.5.3
+ 2.5.4
pom
SpringBlade 微服务API集合
@@ -20,6 +20,7 @@
blade-dict-api
blade-system-api
blade-user-api
+ blade-demo-api
diff --git a/blade-service/blade-demo/pom.xml b/blade-service/blade-demo/pom.xml
new file mode 100644
index 0000000..7e43ada
--- /dev/null
+++ b/blade-service/blade-demo/pom.xml
@@ -0,0 +1,40 @@
+
+
+
+ blade-service
+ org.springblade
+ 2.5.4
+
+ 4.0.0
+
+ blade-demo
+ ${project.artifactId}
+ ${blade.project.version}
+ jar
+
+
+
+ org.springblade
+ blade-core-boot
+ ${blade.tool.version}
+
+
+ org.springblade
+ blade-core-swagger
+ ${blade.tool.version}
+
+
+ org.springblade
+ blade-demo-api
+ ${blade.project.version}
+
+
+ com.baomidou
+ dynamic-datasource-spring-boot-starter
+ 2.5.6
+
+
+
+
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/DemoApplication.java b/blade-service/blade-demo/src/main/java/com/example/demo/DemoApplication.java
new file mode 100644
index 0000000..a06eaaa
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/DemoApplication.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo;
+
+import org.springblade.core.launch.BladeApplication;
+import org.springframework.cloud.client.SpringCloudApplication;
+
+/**
+ * Demo启动器
+ *
+ * @author Chill
+ */
+@SpringCloudApplication
+public class DemoApplication {
+
+ public static void main(String[] args) {
+ BladeApplication.run("blade-demo", DemoApplication.class, args);
+ }
+
+}
+
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/config/DemoConfiguration.java b/blade-service/blade-demo/src/main/java/com/example/demo/config/DemoConfiguration.java
new file mode 100644
index 0000000..238549b
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/config/DemoConfiguration.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.config;
+
+
+import com.example.demo.props.DemoProperties;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 配置feign、mybatis包名、properties
+ *
+ * @author Chill
+ */
+@Configuration
+@EnableFeignClients({"org.springblade", "com.example"})
+@MapperScan({"org.springblade.**.mapper.**", "com.example.**.mapper.**"})
+@EnableConfigurationProperties(DemoProperties.class)
+public class DemoConfiguration {
+
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/controller/DemoController.java b/blade-service/blade-demo/src/main/java/com/example/demo/controller/DemoController.java
new file mode 100644
index 0000000..0129a6a
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/controller/DemoController.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.controller;
+
+import com.example.demo.props.DemoProperties;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Demo控制器
+ *
+ * @author Chill
+ */
+@RefreshScope
+@RestController
+@RequestMapping("demo")
+@Api(value = "配置接口", tags = "即时刷新配置")
+public class DemoController {
+
+ @Value("${demo.name}")
+ private String name;
+
+ private final DemoProperties properties;
+
+ public DemoController(DemoProperties properties) {
+ this.properties = properties;
+ }
+
+
+ @GetMapping("name")
+ public String getName() {
+ return name;
+ }
+
+ @GetMapping("name-by-props")
+ public String getNameByProps() {
+ return properties.getName();
+ }
+
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/controller/DynamicController.java b/blade-service/blade-demo/src/main/java/com/example/demo/controller/DynamicController.java
new file mode 100644
index 0000000..47e129d
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/controller/DynamicController.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.controller;
+
+import com.example.demo.entity.Notice;
+import com.example.demo.service.IDynamicService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 多数据源
+ *
+ * @author Chill
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("dynamic")
+@Api(value = "多数据源接口", tags = "多数据源")
+public class DynamicController {
+
+ private IDynamicService dynamicService;
+
+ /**
+ * master列表
+ */
+ @GetMapping("/master-list")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "master列表", notes = "master列表")
+ public R> masterList() {
+ List list = dynamicService.masterList();
+ return R.data(list);
+ }
+
+ /**
+ * slave列表
+ */
+ @GetMapping("/slave-list")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "slave列表", notes = "slave列表")
+ public R> slaveList() {
+ List list = dynamicService.slaveList();
+ return R.data(list);
+ }
+
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java b/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java
new file mode 100644
index 0000000..1ffbdcf
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/controller/NoticeController.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.example.demo.entity.Notice;
+import com.example.demo.service.INoticeService;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springblade.common.cache.CacheNames;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.Map;
+
+/**
+ * 控制器
+ *
+ * @author Chill
+ */
+@RestController
+@RequestMapping("notice")
+@AllArgsConstructor
+@Api(value = "用户博客", tags = "博客接口")
+public class NoticeController extends BladeController implements CacheNames {
+
+ private INoticeService noticeService;
+
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入notice")
+ public R detail(Notice notice) {
+ Notice detail = noticeService.getOne(Condition.getQueryWrapper(notice));
+ return R.data(detail);
+ }
+
+ /**
+ * 分页
+ */
+ @GetMapping("/list")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
+ @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
+ })
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入notice")
+ public R> list(@ApiIgnore @RequestParam Map notice, Query query) {
+ IPage pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice, Notice.class));
+ return R.data(pages);
+ }
+
+ /**
+ * 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "新增", notes = "传入notice")
+ public R save(@RequestBody Notice notice) {
+ return R.status(noticeService.save(notice));
+ }
+
+ /**
+ * 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "修改", notes = "传入notice")
+ public R update(@RequestBody Notice notice) {
+ return R.status(noticeService.updateById(notice));
+ }
+
+ /**
+ * 新增或修改
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "新增或修改", notes = "传入notice")
+ public R submit(@RequestBody Notice notice) {
+ return R.status(noticeService.saveOrUpdate(notice));
+ }
+
+ /**
+ * 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "逻辑删除", notes = "传入notice")
+ public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+ boolean temp = noticeService.deleteLogic(Func.toIntList(ids));
+ return R.status(temp);
+ }
+
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/feign/NoticeClient.java b/blade-service/blade-demo/src/main/java/com/example/demo/feign/NoticeClient.java
new file mode 100644
index 0000000..8167388
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/feign/NoticeClient.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.feign;
+
+import com.example.demo.entity.Notice;
+import com.example.demo.mapper.NoticeMapper;
+import lombok.AllArgsConstructor;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+
+/**
+ * Notice Feign
+ *
+ * @author Chill
+ */
+@ApiIgnore()
+@RestController
+@AllArgsConstructor
+public class NoticeClient implements INoticeClient {
+
+ private NoticeMapper mapper;
+
+ @Override
+ @GetMapping(TOP)
+ public R> top(Integer number) {
+ return R.data(mapper.topList(number));
+ }
+
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/launcher/DemoLauncherServiceImpl.java b/blade-service/blade-demo/src/main/java/com/example/demo/launcher/DemoLauncherServiceImpl.java
new file mode 100644
index 0000000..1a93814
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/launcher/DemoLauncherServiceImpl.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.launcher;
+
+import org.springblade.core.launch.constant.NacosConstant;
+import org.springblade.core.launch.service.LauncherService;
+import org.springblade.core.launch.utils.PropsUtil;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+
+import java.util.Properties;
+
+/**
+ * 启动参数拓展
+ *
+ * @author Chill
+ */
+public class DemoLauncherServiceImpl implements LauncherService {
+
+ @Override
+ public void launcher(SpringApplicationBuilder builder, String appName, String profile) {
+ Properties props = System.getProperties();
+ PropsUtil.setProperty(props, "spring.cloud.nacos.config.ext-config[0].data-id", NacosConstant.dataId("example", profile));
+ PropsUtil.setProperty(props, "spring.cloud.nacos.config.ext-config[0].group", NacosConstant.NACOS_CONFIG_GROUP);
+ PropsUtil.setProperty(props, "spring.cloud.nacos.config.ext-config[0].refresh", NacosConstant.NACOS_CONFIG_REFRESH);
+ // 自定义命名空间
+ // PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", LauncherConstant.NACOS_NAMESPACE);
+ // PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", LauncherConstant.NACOS_NAMESPACE);
+ }
+
+ @Override
+ public int getOrder() {
+ return 20;
+ }
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/mapper/NoticeMapper.java b/blade-service/blade-demo/src/main/java/com/example/demo/mapper/NoticeMapper.java
new file mode 100644
index 0000000..8610285
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/mapper/NoticeMapper.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.example.demo.entity.Notice;
+
+import java.util.List;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ */
+public interface NoticeMapper extends BaseMapper {
+
+ /**
+ * 前N条数据
+ * @param number
+ * @return
+ */
+ List topList(Integer number);
+
+ /**
+ * 自定义分页
+ * @param page
+ * @param notice
+ * @return
+ */
+ List selectNoticePage(IPage page, Notice notice);
+
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/mapper/NoticeMapper.xml b/blade-service/blade-demo/src/main/java/com/example/demo/mapper/NoticeMapper.xml
new file mode 100644
index 0000000..046ca13
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/mapper/NoticeMapper.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select id,
+ create_user AS createUser,
+ create_time AS createTime,
+ update_user AS updateUser,
+ update_time AS updateTime,
+ status,
+ is_deleted AS isDeleted,
+ title, content
+
+
+
+
+
+
+
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/props/DemoProperties.java b/blade-service/blade-demo/src/main/java/com/example/demo/props/DemoProperties.java
new file mode 100644
index 0000000..7c3f700
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/props/DemoProperties.java
@@ -0,0 +1,18 @@
+package com.example.demo.props;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * DemoProperties
+ *
+ * @author Chill
+ */
+@Data
+@ConfigurationProperties(prefix = "demo")
+public class DemoProperties {
+ /**
+ * 名称
+ */
+ private String name;
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/service/IDynamicService.java b/blade-service/blade-demo/src/main/java/com/example/demo/service/IDynamicService.java
new file mode 100644
index 0000000..dd09977
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/service/IDynamicService.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.service;
+
+import com.example.demo.entity.Notice;
+import org.springblade.core.mp.base.BaseService;
+
+import java.util.List;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ */
+public interface IDynamicService extends BaseService {
+
+ /**
+ * master数据源的列表
+ *
+ * @return
+ */
+ List masterList();
+
+ /**
+ * slave数据源的列表
+ *
+ * @return
+ */
+ List slaveList();
+
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/service/INoticeService.java b/blade-service/blade-demo/src/main/java/com/example/demo/service/INoticeService.java
new file mode 100644
index 0000000..015af8d
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/service/INoticeService.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import com.example.demo.entity.Notice;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ */
+public interface INoticeService extends BaseService {
+
+ /**
+ * 自定义分页
+ * @param page
+ * @param notice
+ * @return
+ */
+ IPage selectNoticePage(IPage page, Notice notice);
+
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/service/impl/DynamicServiceImpl.java b/blade-service/blade-demo/src/main/java/com/example/demo/service/impl/DynamicServiceImpl.java
new file mode 100644
index 0000000..64dd1b6
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/service/impl/DynamicServiceImpl.java
@@ -0,0 +1,30 @@
+package com.example.demo.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.example.demo.entity.Notice;
+import com.example.demo.mapper.NoticeMapper;
+import com.example.demo.service.IDynamicService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * DynamicServiceImpl
+ *
+ * @author Chill
+ */
+@Service
+public class DynamicServiceImpl extends BaseServiceImpl implements IDynamicService {
+
+ @Override
+ public List masterList() {
+ return this.list();
+ }
+
+ @Override
+ @DS("slave")
+ public List slaveList() {
+ return this.list();
+ }
+}
diff --git a/blade-service/blade-demo/src/main/java/com/example/demo/service/impl/NoticeServiceImpl.java b/blade-service/blade-demo/src/main/java/com/example/demo/service/impl/NoticeServiceImpl.java
new file mode 100644
index 0000000..60bb06a
--- /dev/null
+++ b/blade-service/blade-demo/src/main/java/com/example/demo/service/impl/NoticeServiceImpl.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the dreamlu.net developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.example.demo.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.example.demo.mapper.NoticeMapper;
+import com.example.demo.service.INoticeService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import com.example.demo.entity.Notice;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ */
+@Service
+public class NoticeServiceImpl extends BaseServiceImpl implements INoticeService {
+
+ @Override
+ public IPage selectNoticePage(IPage page, Notice notice) {
+ return page.setRecords(baseMapper.selectNoticePage(page, notice));
+ }
+
+}
diff --git a/blade-service/blade-demo/src/main/resources/application-dev.yml b/blade-service/blade-demo/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..38426fa
--- /dev/null
+++ b/blade-service/blade-demo/src/main/resources/application-dev.yml
@@ -0,0 +1,28 @@
+#服务器端口
+server:
+ port: 8200
+
+#数据源配置
+#spring:
+# datasource:
+# url: ${blade.datasource.dev.url}
+# username: ${blade.datasource.dev.username}
+# password: ${blade.datasource.dev.password}
+
+spring:
+ #排除DruidDataSourceAutoConfigure
+ autoconfigure:
+ exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+ datasource:
+ dynamic:
+ #设置默认的数据源或者数据源组,默认值即为master
+ primary: master
+ datasource:
+ master:
+ url: ${blade.datasource.demo.master.url}
+ username: ${blade.datasource.demo.master.username}
+ password: ${blade.datasource.demo.master.password}
+ slave:
+ url: ${blade.datasource.demo.slave.url}
+ username: ${blade.datasource.demo.slave.username}
+ password: ${blade.datasource.demo.slave.password}
diff --git a/blade-service/blade-demo/src/main/resources/application-prod.yml b/blade-service/blade-demo/src/main/resources/application-prod.yml
new file mode 100644
index 0000000..da89262
--- /dev/null
+++ b/blade-service/blade-demo/src/main/resources/application-prod.yml
@@ -0,0 +1,28 @@
+#服务器端口
+server:
+ port: 8200
+
+#数据源配置
+#spring:
+# datasource:
+# url: ${blade.datasource.prod.url}
+# username: ${blade.datasource.prod.username}
+# password: ${blade.datasource.prod.password}
+
+spring:
+ #排除DruidDataSourceAutoConfigure
+ autoconfigure:
+ exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+ datasource:
+ dynamic:
+ #设置默认的数据源或者数据源组,默认值即为master
+ primary: master
+ datasource:
+ master:
+ url: ${blade.datasource.demo.master.url}
+ username: ${blade.datasource.demo.master.username}
+ password: ${blade.datasource.demo.master.password}
+ slave:
+ url: ${blade.datasource.demo.slave.url}
+ username: ${blade.datasource.demo.slave.username}
+ password: ${blade.datasource.demo.slave.password}
diff --git a/blade-service/blade-demo/src/main/resources/application-test.yml b/blade-service/blade-demo/src/main/resources/application-test.yml
new file mode 100644
index 0000000..4b4e157
--- /dev/null
+++ b/blade-service/blade-demo/src/main/resources/application-test.yml
@@ -0,0 +1,28 @@
+#服务器端口
+server:
+ port: 8200
+
+#数据源配置
+#spring:
+# datasource:
+# url: ${blade.datasource.test.url}
+# username: ${blade.datasource.test.username}
+# password: ${blade.datasource.test.password}
+
+spring:
+ #排除DruidDataSourceAutoConfigure
+ autoconfigure:
+ exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+ datasource:
+ dynamic:
+ #设置默认的数据源或者数据源组,默认值即为master
+ primary: master
+ datasource:
+ master:
+ url: ${blade.datasource.demo.master.url}
+ username: ${blade.datasource.demo.master.username}
+ password: ${blade.datasource.demo.master.password}
+ slave:
+ url: ${blade.datasource.demo.slave.url}
+ username: ${blade.datasource.demo.slave.username}
+ password: ${blade.datasource.demo.slave.password}
diff --git a/blade-service/blade-demo/src/main/resources/application.yml b/blade-service/blade-demo/src/main/resources/application.yml
new file mode 100644
index 0000000..103a257
--- /dev/null
+++ b/blade-service/blade-demo/src/main/resources/application.yml
@@ -0,0 +1,12 @@
+#mybatis-plus配置
+mybatis-plus:
+ mapper-locations: classpath:com/example/**/mapper/*Mapper.xml
+ #实体扫描,多个package用逗号或者分号分隔
+ typeAliasesPackage: com.example.**.entity
+
+#swagger扫描路径配置
+swagger:
+ base-packages:
+ - org.springbalde
+ - com.example
+
diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml
index ff0e83d..321c11d 100644
--- a/blade-service/blade-desk/pom.xml
+++ b/blade-service/blade-desk/pom.xml
@@ -6,7 +6,7 @@
org.springblade
blade-service
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service/blade-desk/src/test/java/org/springblade/desk/test/launcher/DemoTestLauncherServiceImpl.java b/blade-service/blade-desk/src/test/java/org/springblade/desk/test/launcher/DemoTestLauncherServiceImpl.java
index 3ba4a5c..495d7b0 100644
--- a/blade-service/blade-desk/src/test/java/org/springblade/desk/test/launcher/DemoTestLauncherServiceImpl.java
+++ b/blade-service/blade-desk/src/test/java/org/springblade/desk/test/launcher/DemoTestLauncherServiceImpl.java
@@ -15,7 +15,7 @@
*/
package org.springblade.desk.test.launcher;
-import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.launch.service.LauncherService;
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -31,9 +31,9 @@ public class DemoTestLauncherServiceImpl implements LauncherService {
@Override
public void launcher(SpringApplicationBuilder builder, String appName, String profile) {
Properties props = System.getProperties();
- props.setProperty("spring.cloud.nacos.discovery.server-addr", CommonConstant.NACOS_DEV_ADDR);
- props.setProperty("spring.cloud.nacos.config.server-addr", CommonConstant.NACOS_DEV_ADDR);
- props.setProperty("spring.cloud.sentinel.transport.dashboard", CommonConstant.SENTINEL_DEV_ADDR);
+ props.setProperty("spring.cloud.nacos.discovery.server-addr", LauncherConstant.NACOS_DEV_ADDR);
+ props.setProperty("spring.cloud.nacos.config.server-addr", LauncherConstant.NACOS_DEV_ADDR);
+ props.setProperty("spring.cloud.sentinel.transport.dashboard", LauncherConstant.SENTINEL_DEV_ADDR);
}
@Override
diff --git a/blade-service/blade-log/pom.xml b/blade-service/blade-log/pom.xml
index 595e603..00c3cc5 100644
--- a/blade-service/blade-log/pom.xml
+++ b/blade-service/blade-log/pom.xml
@@ -5,7 +5,7 @@
blade-service
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service/blade-system/pom.xml b/blade-service/blade-system/pom.xml
index 7c999cb..1f89838 100644
--- a/blade-service/blade-system/pom.xml
+++ b/blade-service/blade-system/pom.xml
@@ -5,7 +5,7 @@
blade-service
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service/blade-user/pom.xml b/blade-service/blade-user/pom.xml
index b0d675f..6142b0f 100644
--- a/blade-service/blade-user/pom.xml
+++ b/blade-service/blade-user/pom.xml
@@ -5,7 +5,7 @@
blade-service
org.springblade
- 2.5.3
+ 2.5.4
4.0.0
diff --git a/blade-service/pom.xml b/blade-service/pom.xml
index f6a3c1c..245b59f 100644
--- a/blade-service/pom.xml
+++ b/blade-service/pom.xml
@@ -7,12 +7,12 @@
org.springblade
SpringBlade
- 2.5.3
+ 2.5.4
blade-service
${project.artifactId}
- 2.5.3
+ 2.5.4
pom
SpringBlade 微服务集合
@@ -21,6 +21,7 @@
blade-log
blade-system
blade-user
+ blade-demo
diff --git a/doc/nacos/blade-demo-dev.yaml b/doc/nacos/blade-demo-dev.yaml
new file mode 100644
index 0000000..fee2be5
--- /dev/null
+++ b/doc/nacos/blade-demo-dev.yaml
@@ -0,0 +1,19 @@
+#自定义配置
+demo:
+ name: demo-name
+
+#放行配置
+blade:
+ secure:
+ skip-url:
+ - /demo/**
+ datasource:
+ demo:
+ master:
+ url: jdbc:mysql://localhost:3306/bladex?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8
+ username: root
+ password: root
+ slave:
+ url: jdbc:mysql://localhost:3306/bladex_slave?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8
+ username: root
+ password: root
diff --git a/doc/sql/blade-update-2.5.1~2.5.2.sql b/doc/sql/blade-update-2.5.1~2.5.2.sql
deleted file mode 100644
index 862d42a..0000000
--- a/doc/sql/blade-update-2.5.1~2.5.2.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE `blade`.`blade_user`
- ADD COLUMN `avatar` varchar(2000) NULL COMMENT '头像' AFTER `real_name`;
diff --git a/doc/sql/blade-saber-mysql.sql b/doc/sql/blade/blade-saber-mysql.sql
similarity index 100%
rename from doc/sql/blade-saber-mysql.sql
rename to doc/sql/blade/blade-saber-mysql.sql
diff --git a/doc/sql/blade-sword-mysql.sql b/doc/sql/blade/blade-sword-mysql.sql
similarity index 100%
rename from doc/sql/blade-sword-mysql.sql
rename to doc/sql/blade/blade-sword-mysql.sql
diff --git a/doc/sql/seata/seata.sql b/doc/sql/seata/seata.sql
new file mode 100644
index 0000000..26d1890
--- /dev/null
+++ b/doc/sql/seata/seata.sql
@@ -0,0 +1,79 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server : mysql_localhost
+ Source Server Type : MySQL
+ Source Server Version : 50723
+ Source Host : localhost:3306
+ Source Schema : seata
+
+ Target Server Type : MySQL
+ Target Server Version : 50723
+ File Encoding : 65001
+
+ Date: 13/11/2019 18:14:10
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for branch_table
+-- ----------------------------
+DROP TABLE IF EXISTS `branch_table`;
+CREATE TABLE `branch_table` (
+ `branch_id` bigint(20) NOT NULL,
+ `xid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `transaction_id` bigint(20) NULL DEFAULT NULL,
+ `resource_group_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `resource_id` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `lock_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `branch_type` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `status` tinyint(4) NULL DEFAULT NULL,
+ `client_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `application_data` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `gmt_create` datetime(0) NULL DEFAULT NULL,
+ `gmt_modified` datetime(0) NULL DEFAULT NULL,
+ PRIMARY KEY (`branch_id`) USING BTREE,
+ INDEX `idx_xid`(`xid`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
+
+-- ----------------------------
+-- Table structure for global_table
+-- ----------------------------
+DROP TABLE IF EXISTS `global_table`;
+CREATE TABLE `global_table` (
+ `xid` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `transaction_id` bigint(20) NULL DEFAULT NULL,
+ `status` tinyint(4) NOT NULL,
+ `application_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `transaction_service_group` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `transaction_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `timeout` int(11) NULL DEFAULT NULL,
+ `begin_time` bigint(20) NULL DEFAULT NULL,
+ `application_data` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `gmt_create` datetime(0) NULL DEFAULT NULL,
+ `gmt_modified` datetime(0) NULL DEFAULT NULL,
+ PRIMARY KEY (`xid`) USING BTREE,
+ INDEX `idx_gmt_modified_status`(`gmt_modified`, `status`) USING BTREE,
+ INDEX `idx_transaction_id`(`transaction_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
+
+-- ----------------------------
+-- Table structure for lock_table
+-- ----------------------------
+DROP TABLE IF EXISTS `lock_table`;
+CREATE TABLE `lock_table` (
+ `row_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `xid` varchar(96) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `transaction_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
+ `branch_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
+ `resource_id` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `table_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `pk` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+ `gmt_create` datetime(0) NULL DEFAULT NULL,
+ `gmt_modified` datetime(0) NULL DEFAULT NULL,
+ PRIMARY KEY (`row_key`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/doc/sql/seata/seata_order.sql b/doc/sql/seata/seata_order.sql
new file mode 100644
index 0000000..1288cc7
--- /dev/null
+++ b/doc/sql/seata/seata_order.sql
@@ -0,0 +1,51 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server : mysql_localhost
+ Source Server Type : MySQL
+ Source Server Version : 50723
+ Source Host : localhost:3306
+ Source Schema : seata_order
+
+ Target Server Type : MySQL
+ Target Server Version : 50723
+ File Encoding : 65001
+
+ Date: 13/11/2019 18:12:16
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for tb_order
+-- ----------------------------
+DROP TABLE IF EXISTS `tb_order`;
+CREATE TABLE `tb_order` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `user_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `commodity_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `count` int(11) NULL DEFAULT 0,
+ `money` int(11) NULL DEFAULT 0,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci;
+
+-- ----------------------------
+-- Table structure for undo_log
+-- ----------------------------
+DROP TABLE IF EXISTS `undo_log`;
+CREATE TABLE `undo_log` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `branch_id` bigint(20) NOT NULL,
+ `xid` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `context` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `rollback_info` longblob NOT NULL,
+ `log_status` int(11) NOT NULL,
+ `log_created` datetime(0) NOT NULL,
+ `log_modified` datetime(0) NOT NULL,
+ `ext` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `ux_undo_log`(`xid`, `branch_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/doc/sql/seata/seata_storage.sql b/doc/sql/seata/seata_storage.sql
new file mode 100644
index 0000000..eb3427d
--- /dev/null
+++ b/doc/sql/seata/seata_storage.sql
@@ -0,0 +1,57 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server : mysql_localhost
+ Source Server Type : MySQL
+ Source Server Version : 50723
+ Source Host : localhost:3306
+ Source Schema : seata_storage
+
+ Target Server Type : MySQL
+ Target Server Version : 50723
+ File Encoding : 65001
+
+ Date: 13/11/2019 18:12:33
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for tb_storage
+-- ----------------------------
+DROP TABLE IF EXISTS `tb_storage`;
+CREATE TABLE `tb_storage` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `commodity_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `count` int(11) NULL DEFAULT 0,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `commodity_code`(`commodity_code`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci;
+
+-- ----------------------------
+-- Records of tb_storage
+-- ----------------------------
+BEGIN;
+INSERT INTO `tb_storage` VALUES (1, 'product-1', 9999999), (2, 'product-2', 0);
+COMMIT;
+
+-- ----------------------------
+-- Table structure for undo_log
+-- ----------------------------
+DROP TABLE IF EXISTS `undo_log`;
+CREATE TABLE `undo_log` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `branch_id` bigint(20) NOT NULL,
+ `xid` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `context` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `rollback_info` longblob NOT NULL,
+ `log_status` int(11) NOT NULL,
+ `log_created` datetime(0) NOT NULL,
+ `log_modified` datetime(0) NOT NULL,
+ `ext` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `ux_undo_log`(`xid`, `branch_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci;
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/pom.xml b/pom.xml
index 65536f5..3ea2d21 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,12 +5,12 @@
org.springblade
SpringBlade
- 2.5.3
+ 2.5.4
pom
- 2.5.3
- 2.5.3
+ 2.5.4
+ 2.5.4
1.8
2.9.2
diff --git a/script/docker/.env b/script/docker/.env
index 1c580e8..f05b10e 100644
--- a/script/docker/.env
+++ b/script/docker/.env
@@ -1,2 +1,2 @@
REGISTER=192.168.0.157/blade
-TAG=2.5.3
+TAG=2.5.4