瀏覽代碼

提交地磅配置

chenxiaofei 1 月之前
父節點
當前提交
5851a02b14

+ 9 - 9
iot-platform-manager/pom.xml

@@ -50,16 +50,16 @@
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
         <!-- Nacos Discovery -->
-<!--        <dependency>-->
-<!--            <groupId>com.alibaba.cloud</groupId>-->
-<!--            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
-<!--        </dependency>-->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
 
         <!-- Nacos Config -->
-<!--        <dependency>-->
-<!--            <groupId>com.alibaba.cloud</groupId>-->
-<!--            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
-<!--        </dependency>-->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter</artifactId>
@@ -94,4 +94,4 @@
 
     </dependencies>
 
-</project>
+</project>

+ 2 - 0
iot-platform-manager/src/main/java/com/platform/IotPlatformManagerApplication.java

@@ -1,6 +1,7 @@
 package com.platform;
 
 import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.scheduling.annotation.EnableAsync;
@@ -17,6 +18,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @MapperScan("com.platform.mapper")
 @EnableScheduling
 @EnableAsync
+@EnableDiscoveryClient
 public class IotPlatformManagerApplication {
     public static void main(String[] args) {
         SpringApplication.run(IotPlatformManagerApplication.class, args);

+ 29 - 0
iot-platform-manager/src/main/resources/bootstrap-cxf.yml

@@ -0,0 +1,29 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+        # 服务注册地址
+        server-addr: 118.116.4.155:8848
+        # 命名空间
+        namespace: sckw-ng-service-platform-xf
+        # 共享配置
+        group: sckw-ng-service-platform
+      config:
+        # 配置中心地址
+        server-addr: 118.116.4.155:8848
+        # 命名空间
+        namespace: sckw-ng-service-platform-xf
+        # 共享配置
+        group: sckw-ng-service-platform
+        # 配置文件格式
+        file-extension: yaml
+        shared-configs:
+          - data-id: sckw-common.yml
+            group: sckw-ng-common
+            refresh: true
+
+        #可以读多个配置文件 需要在同一个命名空间下面可以是不同的组
+        extension-configs:
+          - dataId: sckw-common.yml
+            group: sckw-ng-service-platform
+            refresh: true

+ 12 - 47
iot-platform-manager/src/main/resources/bootstrap.yml

@@ -1,49 +1,14 @@
+server:
+  port: 10800
+
 spring:
   application:
-    name: iot-platform
-
-  datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://10.10.10.221:3306/iot_manage
-    username: root
-    password: TFGhA6AkJesRP4ZT
-
-    druid: # Druid 【监控】相关配置
-      web-stat-filter:
-        enabled: true
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        allow:           # 不配置表示全部允许
-        login-username:  # 未配置表示不启用登录
-        login-password:
-      filter:
-        stat:
-          enabled: true
-          log-slow-sql: true
-          slow-sql-millis: 100
-          merge-sql: true
-        wall:
-          config:
-            multi-statement-allow: true
-  servlet:
-    multipart:
-      max-file-size: 10MB
-      max-request-size: 50MB
-mybatis-plus:
-  configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-
-file:
-  list:
-    oss: pdf,gif,jpg,jpeg,png,doc,docx,xls,xlsx,heic
-    aliyun: pdf,gif,jpg,jpeg,png,doc,docx,xls,xlsx
-    qiniu: pdf,gif,jpg,jpeg,png,doc,docx,xls,xlsx
-
-aliyun:
-  oss:
-    endpoint: oss-cn-chengdu.aliyuncs.com
-    accessKeyId: LTAI5tHq44Cn3p8qqPN7DKc1
-    secret: nQaRrRwlcIWD5jNBu9CZ14YZhaRbTG
-    bucket: saas-four
+    name: sckw-ng-weighbridge
+  profiles:
+    active: @profiles.active@
+  main:
+    allow-bean-definition-overriding: true
+
+logging:
+  level:
+    root: info

+ 40 - 0
pom.xml

@@ -154,6 +154,46 @@
 
 		</dependencies>
 	</dependencyManagement>
+
+	<profiles>
+		<profile>
+			<id>cxf</id>
+			<properties>
+				<profiles.active>cxf</profiles.active>
+				<nacos.server>118.116.4.155:8848</nacos.server>
+				<nacos.namespace>sckw-ng-service-platform-cxf</nacos.namespace>
+			</properties>
+		</profile>
+		<profile>
+			<id>dev</id>
+			<properties>
+				<profiles.active>dev</profiles.active>
+				<nacos.server>nacos-server:8848</nacos.server>
+				<nacos.namespace>sckw-ng-service-platform</nacos.namespace>
+			</properties>
+		</profile>
+		<!--测试环境-->
+		<profile>
+			<id>test</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<properties>
+				<profiles.active>test</profiles.active>
+				<nacos.server>nacos-server:8848</nacos.server>
+				<nacos.namespace>sckw-ng-service-platform</nacos.namespace>
+			</properties>
+		</profile>
+		<!--生产环境-->
+		<profile>
+			<id>prod</id>
+			<properties>
+				<profiles.active>prod</profiles.active>
+				<nacos.server>172.17.0.4:8848</nacos.server>
+				<nacos.namespace>sckw-ng-service-platform</nacos.namespace>
+			</properties>
+		</profile>
+	</profiles>
 	<build>
 		<resources>
 			<resource>

+ 50 - 0
sql/iot-platform.yaml

@@ -0,0 +1,50 @@
+spring:
+  application:
+    name: iot-platform
+
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://10.10.10.221:3306/iot_manage
+    username: root
+    password: TFGhA6AkJesRP4ZT
+    druid:
+      web-stat-filter:
+        enabled: true
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        allow:
+        login-username:
+        login-password:
+      filter:
+        stat:
+          enabled: true
+          log-slow-sql: true
+          slow-sql-millis: 100
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+
+  servlet:
+    multipart:
+      max-file-size: 10MB
+      max-request-size: 50MB
+
+mybatis-plus:
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+file:
+  list:
+    oss: pdf,gif,jpg,jpeg,png,doc,docx,xls,xlsx,heic
+    aliyun: pdf,gif,jpg,jpeg,png,doc,docx,xls,xlsx
+    qiniu: pdf,gif,jpg,jpeg,png,doc,docx,xls,xlsx
+
+aliyun:
+  oss:
+    endpoint: oss-cn-chengdu.aliyuncs.com
+    accessKeyId: LTAI5tHq44Cn3p8qqPN7DKc1
+    secret: nQaRrRwlcIWD5jNBu9CZ14YZhaRbTG
+    bucket: saas-four