Browse Source

增加配置文件和启动代码

zhuoning 3 years ago
parent
commit
a4a82930e0

+ 20 - 0
huimv-farm-admin/src/main/java/com/huimv/admin/HuimvAdminApplication.java

@@ -0,0 +1,20 @@
+package com.huimv.admin;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvAdminApplication {
+    public static void main(String[] args) {
+        ApplicationContext applicationContext = SpringApplication.run(HuimvAdminApplication.class, args);
+    }
+}

+ 32 - 0
huimv-farm-admin/src/main/resources/application-dev.yml

@@ -0,0 +1,32 @@
+server:
+  port: 8097
+spring:
+  application:
+    name: pigfarm-local-device
+  #------DataSource-----
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-farm-device?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+#    driver-class-name: com.mysql.jdbc.Driver
+  jpa:
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+
+# Socket配置
+socket:
+  # 监听端口 9001
+#  listen:
+#    #ip: 192.168.16.3
+#    ip: 192.168.1.49
+#    port: 10020
+  # 线程池 - 保持线程数 20
+  #pool-keep: 20
+  # 线程池 - 核心线程数 10
+  #pool-core: 10
+  # 线程池 - 最大线程数 20
+  #pool-max: 30
+  # 线程队列容量 10
+  #pool-queue-init: 10

+ 20 - 0
huimv-farm-admin/src/main/resources/application.properties

@@ -0,0 +1,20 @@
+spring.profiles.active=dev
+#spring.profiles.active=prod
+
+#时间格式配置
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+
+# 数据中心数据推送地址
+dataCenter.ipAddr=http://115.238.57.190
+dataCenter.port=:10091
+# 日总称重数据服务
+dataCenter.service.dayWeight=/receiver/farm/weight/putDayWeight
+# 批次称重数据服务
+dataCenter.service.batchWeight=/receiver/farm/weight/putBatchWeight
+# 部署牧场ID(base_farm.id)
+local.farmID=1
+# 批次计算间隔
+weight.batch_interval=4
+weight.batch.prefix=W
+weight.batchCode.spacemark=-

+ 1 - 1
huimv-farm-environ/src/main/resources/application.properties

@@ -17,4 +17,4 @@ local.farmID=1
 # Åú´Î¼ÆËã¼ä¸ô
 weight.batch_interval=4
 weight.batch.prefix=W
-weight.batchCode.spacemark=-
+weight.batchCode.spacemark=-

+ 19 - 0
huimv-farm-gateway/src/main/java/com/huimv/gateway/HuimvGateway.java

@@ -0,0 +1,19 @@
+package com.huimv.gateway;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvGateway {
+    public static void main(String[] args) {
+        SpringApplication.run(HuimvGateway.class, args);
+    }
+}

+ 46 - 0
huimv-farm-gateway/src/main/resources/application-dev.yml

@@ -0,0 +1,46 @@
+server:
+  port: 8010
+
+spring:
+  application:
+    name: gateway
+  cloud:
+    gateway:
+      enabled: true
+      routes:
+        - id: admin
+          uri: http://127.0.0.1:8082
+          predicates:
+            - Path=/admin/**
+          filters:
+            - StripPrefix=1
+        - id: video
+          uri: http://127.0.0.1:8092
+          predicates:
+            - Path=/video/**
+          filters:
+            - StripPrefix=1
+        - id: env
+          uri: http://127.0.0.1:8085
+          predicates:
+            - Path=/env/**
+          filters:
+            - StripPrefix=1
+        - id: produce
+          uri: http://127.0.0.1:8089
+          predicates:
+            - Path=/produce/**
+          filters:
+            - StripPrefix=1
+        - id: device
+          uri: http://127.0.0.1:10093
+          predicates:
+            - Path=/device/**
+          filters:
+            - StripPrefix=1
+
+logging:
+  level:
+    org.springframework.cloud.gateway: debug  # Gateway调试模式
+
+

+ 1 - 0
huimv-farm-gateway/src/main/resources/application.properties

@@ -0,0 +1 @@
+spring.profiles.active=dev

+ 20 - 0
huimv-farm-produce/src/main/java/com/huimv/produce/HuimvProduceApplication.java

@@ -0,0 +1,20 @@
+package com.huimv.produce;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvProduceApplication {
+    public static void main(String[] args) {
+        ApplicationContext applicationContext = SpringApplication.run(HuimvProduceApplication.class, args);
+    }
+}

+ 32 - 0
huimv-farm-produce/src/main/resources/application-dev.yml

@@ -0,0 +1,32 @@
+server:
+  port: 8097
+spring:
+  application:
+    name: pigfarm-local-device
+  #------DataSource-----
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-farm-device?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+#    driver-class-name: com.mysql.jdbc.Driver
+  jpa:
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+
+# Socket配置
+socket:
+  # 监听端口 9001
+#  listen:
+#    #ip: 192.168.16.3
+#    ip: 192.168.1.49
+#    port: 10020
+  # 线程池 - 保持线程数 20
+  #pool-keep: 20
+  # 线程池 - 核心线程数 10
+  #pool-core: 10
+  # 线程池 - 最大线程数 20
+  #pool-max: 30
+  # 线程队列容量 10
+  #pool-queue-init: 10

+ 20 - 0
huimv-farm-produce/src/main/resources/application.properties

@@ -0,0 +1,20 @@
+spring.profiles.active=dev
+#spring.profiles.active=prod
+
+#时间格式配置
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+
+# 数据中心数据推送地址
+dataCenter.ipAddr=http://115.238.57.190
+dataCenter.port=:10091
+# 日总称重数据服务
+dataCenter.service.dayWeight=/receiver/farm/weight/putDayWeight
+# 批次称重数据服务
+dataCenter.service.batchWeight=/receiver/farm/weight/putBatchWeight
+# 部署牧场ID(base_farm.id)
+local.farmID=1
+# 批次计算间隔
+weight.batch_interval=4
+weight.batch.prefix=W
+weight.batchCode.spacemark=-

+ 20 - 0
huimv-farm-receiver/src/main/java/com/huimv/receiver/HuimvReceiverApplication.java

@@ -0,0 +1,20 @@
+package com.huimv.receiver;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvReceiverApplication {
+    public static void main(String[] args) {
+        ApplicationContext applicationContext = SpringApplication.run(HuimvReceiverApplication.class, args);
+    }
+}

+ 32 - 0
huimv-farm-receiver/src/main/resources/application-dev.yml

@@ -0,0 +1,32 @@
+server:
+  port: 8097
+spring:
+  application:
+    name: pigfarm-local-device
+  #------DataSource-----
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-farm-device?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+#    driver-class-name: com.mysql.jdbc.Driver
+  jpa:
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+
+# Socket配置
+socket:
+  # 监听端口 9001
+#  listen:
+#    #ip: 192.168.16.3
+#    ip: 192.168.1.49
+#    port: 10020
+  # 线程池 - 保持线程数 20
+  #pool-keep: 20
+  # 线程池 - 核心线程数 10
+  #pool-core: 10
+  # 线程池 - 最大线程数 20
+  #pool-max: 30
+  # 线程队列容量 10
+  #pool-queue-init: 10

+ 20 - 0
huimv-farm-receiver/src/main/resources/application.properties

@@ -0,0 +1,20 @@
+spring.profiles.active=dev
+#spring.profiles.active=prod
+
+#时间格式配置
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+
+# 数据中心数据推送地址
+dataCenter.ipAddr=http://115.238.57.190
+dataCenter.port=:10091
+# 日总称重数据服务
+dataCenter.service.dayWeight=/receiver/farm/weight/putDayWeight
+# 批次称重数据服务
+dataCenter.service.batchWeight=/receiver/farm/weight/putBatchWeight
+# 部署牧场ID(base_farm.id)
+local.farmID=1
+# 批次计算间隔
+weight.batch_interval=4
+weight.batch.prefix=W
+weight.batchCode.spacemark=-

+ 20 - 0
huimv-farm-video/src/main/java/com/huimv/video/HuimvVideoApplication.java

@@ -0,0 +1,20 @@
+package com.huimv.video;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvVideoApplication {
+    public static void main(String[] args) {
+        ApplicationContext applicationContext = SpringApplication.run(HuimvVideoApplication.class, args);
+    }
+}

+ 32 - 0
huimv-farm-video/src/main/resources/application-dev.yml

@@ -0,0 +1,32 @@
+server:
+  port: 8097
+spring:
+  application:
+    name: pigfarm-local-device
+  #------DataSource-----
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-farm-device?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+#    driver-class-name: com.mysql.jdbc.Driver
+  jpa:
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+
+# Socket配置
+socket:
+  # 监听端口 9001
+#  listen:
+#    #ip: 192.168.16.3
+#    ip: 192.168.1.49
+#    port: 10020
+  # 线程池 - 保持线程数 20
+  #pool-keep: 20
+  # 线程池 - 核心线程数 10
+  #pool-core: 10
+  # 线程池 - 最大线程数 20
+  #pool-max: 30
+  # 线程队列容量 10
+  #pool-queue-init: 10

+ 20 - 0
huimv-farm-video/src/main/resources/application.properties

@@ -0,0 +1,20 @@
+spring.profiles.active=dev
+#spring.profiles.active=prod
+
+#时间格式配置
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+
+# 数据中心数据推送地址
+dataCenter.ipAddr=http://115.238.57.190
+dataCenter.port=:10091
+# 日总称重数据服务
+dataCenter.service.dayWeight=/receiver/farm/weight/putDayWeight
+# 批次称重数据服务
+dataCenter.service.batchWeight=/receiver/farm/weight/putBatchWeight
+# 部署牧场ID(base_farm.id)
+local.farmID=1
+# 批次计算间隔
+weight.batch_interval=4
+weight.batch.prefix=W
+weight.batchCode.spacemark=-