Yangyz 11 月之前
父節點
當前提交
020e7898be

+ 4 - 3
Dockerfile

@@ -1,6 +1,7 @@
 FROM openjdk:8-alpine
 MAINTAINER Yyz
-COPY ./target/dist /root/server
-WORKDIR /root/server/burialPoint
-ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","burialPoint-1.0-SNAPSHOT.jar"]
+RUN mkdir -p  /data
+COPY ./target/dist /data
+WORKDIR /data/burialPoint
+ENTRYPOINT ["java","-jar","burialPoint-1.0-SNAPSHOT.jar"]
 

+ 1 - 0
src/main/java/com/benyun/controller/ApplyController.java

@@ -19,6 +19,7 @@ import java.util.List;
 @RestController
 @RequestMapping("apply")
 @RequiredArgsConstructor(onConstructor_ = {@Autowired})
+@CrossOrigin
 public class ApplyController {
     /**
      * 服务对象

+ 1 - 0
src/main/java/com/benyun/controller/EventController.java

@@ -20,6 +20,7 @@ import java.util.List;
 @RestController
 @RequestMapping("event")
 @RequiredArgsConstructor(onConstructor_ = {@Autowired})
+@CrossOrigin
 public class EventController {
     /**
      * 服务对象

+ 1 - 0
src/main/java/com/benyun/controller/EventLogController.java

@@ -24,6 +24,7 @@ import java.util.Map;
 @RestController
 @RequestMapping("eventLog")
 @RequiredArgsConstructor(onConstructor_ = {@Autowired})
+@CrossOrigin
 public class EventLogController {
     /**
      * 服务对象

+ 1 - 0
src/main/java/com/benyun/controller/UserController.java

@@ -18,6 +18,7 @@ import java.util.List;
 @RestController
 @RequestMapping("user")
 @RequiredArgsConstructor(onConstructor_ = {@Autowired})
+@CrossOrigin
 public class UserController {
     /**
      * 服务对象

+ 2 - 2
src/main/resources/application-dev.yml

@@ -48,7 +48,7 @@ spring:
   # redis 配置
   redis:
     database: 5
-    host: 192.168.2.64
+    host: 192.168.2.241
     lettuce:
       pool:
         max-active: 8   # 最大连接数据库连接数,设 0 为没有限制
@@ -56,7 +56,7 @@ spring:
         max-wait: -1ms  # 最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
         min-idle: 0     # 最小等待连接中的数量,设 0 为没有限制
       shutdown-timeout: 100ms
-    password: 123456
+#    password: 123456
     port: 6379
 
 # swagger

+ 11 - 28
src/main/resources/application-prod.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8081
+  port: 9098
   tomcat:
     max-swallow-size: -1
   undertow:
@@ -7,7 +7,7 @@ server:
     # 对于 bufferSize,最好和你系统的 TCP Socket Buffer 配置一样
     # `/proc/sys/net/ipv4/tcp_rmem` (对于读取)
     # `/proc/sys/net/ipv4/tcp_wmem` (对于写入)
-    # 在内存大于 128 MB 时,bufferSize 默认为 16 KB 减去 20 字节,这 20 字节用于协议头
+    # 在内存大于 128 MB 时,bufferSize 为 16 KB 减去 20 字节,这 20 字节用于协议头
     buffer-size: 16364
     # 是否分配的直接内存(NIO直接分配的堆外内存),这里开启,所以java启动参数需要配置下直接内存大小,减少不必要的GC
     # 在内存大于 128 MB 时,默认就是使用直接内存的
@@ -15,10 +15,10 @@ server:
     threads:
       # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个读线程和一个写线程
       # 不要设置过大,如果过大,启动项目会报错:打开文件数过多
-      io: 16
+      io: 8
       # 阻塞任务线程池, 当执行类似servlet请求阻塞IO操作, undertow会从这个线程池中取得线程
       # 它的值设置取决于系统线程执行任务的阻塞系数,默认值是IO线程数*8
-      worker: 256
+      worker: 128
   error:
     include-exception: true
     include-stacktrace: ALWAYS
@@ -41,14 +41,14 @@ spring:
       strict: false     #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
       datasource:
         master:
-          url: jdbc:mysql://localhost:3306/master?characterEncoding=UTF-8&autoReconnect=true&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://192.168.0.31:3306/burial_point?characterEncoding=UTF-8&autoReconnect=true&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
           username: root
-          password: 123456
+          password: LongX@321
           driver-class-name: com.mysql.cj.jdbc.Driver
   # redis 配置
   redis:
-    database: 0
-    host: 127.0.0.1
+    database: 5
+    host: 192.168.0.34
     lettuce:
       pool:
         max-active: 8   # 最大连接数据库连接数,设 0 为没有限制
@@ -56,31 +56,14 @@ spring:
         max-wait: -1ms  # 最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
         min-idle: 0     # 最小等待连接中的数量,设 0 为没有限制
       shutdown-timeout: 100ms
-    password: ''
+    password: lsf@12345
     port: 6379
 
-# mybatis plus 设置
-mybatis-plus:
-  type-aliases-package: com.benyun.**.entity
-  mapper-locations: classpath*:/mapper/**/*.xml
-  global-config:
-    # 关闭MP3.0自带的banner
-    banner: false
-    db-config:
-      # 主键类型
-      id-type: AUTO
-      # 默认数据库表下划线命名
-      table-underline: true
-  configuration:
-    # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
-    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-    # 返回类型为Map,显示null对应的字段
-    call-setters-on-nulls: true
-
 # swagger
 knife4j:
   production: true
   basic:
     enable: true
     username: admin
-    password: benyun
+    password: benyun
+

+ 69 - 0
src/main/resources/application-prod2.yml

@@ -0,0 +1,69 @@
+server:
+  port: 9098
+  tomcat:
+    max-swallow-size: -1
+  undertow:
+    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作
+    # 对于 bufferSize,最好和你系统的 TCP Socket Buffer 配置一样
+    # `/proc/sys/net/ipv4/tcp_rmem` (对于读取)
+    # `/proc/sys/net/ipv4/tcp_wmem` (对于写入)
+    # 在内存大于 128 MB 时,bufferSize 为 16 KB 减去 20 字节,这 20 字节用于协议头
+    buffer-size: 16364
+    # 是否分配的直接内存(NIO直接分配的堆外内存),这里开启,所以java启动参数需要配置下直接内存大小,减少不必要的GC
+    # 在内存大于 128 MB 时,默认就是使用直接内存的
+    direct-buffers: true
+    threads:
+      # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个读线程和一个写线程
+      # 不要设置过大,如果过大,启动项目会报错:打开文件数过多
+      io: 8
+      # 阻塞任务线程池, 当执行类似servlet请求阻塞IO操作, undertow会从这个线程池中取得线程
+      # 它的值设置取决于系统线程执行任务的阻塞系数,默认值是IO线程数*8
+      worker: 128
+  error:
+    include-exception: true
+    include-stacktrace: ALWAYS
+    include-message: ALWAYS
+  servlet:
+    context-path: /
+  compression:
+    enabled: true
+    min-response-size: 1024
+    mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
+
+spring:
+  servlet:
+    multipart:
+      max-file-size: 10MB
+      max-request-size: 10MB
+  datasource:
+    dynamic:
+      primary: master   #设置默认的数据源或者数据源组,默认值即为master
+      strict: false     #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+      datasource:
+        master:
+          url: jdbc:mysql://172.16.118.1:3306/burial_point?characterEncoding=UTF-8&autoReconnect=true&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          username: root
+          password: LongX@321
+          driver-class-name: com.mysql.cj.jdbc.Driver
+  # redis 配置
+  redis:
+    database: 5
+    host: 172.16.118.4
+    lettuce:
+      pool:
+        max-active: 8   # 最大连接数据库连接数,设 0 为没有限制
+        max-idle: 8     # 最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  # 最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     # 最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
+    password: LongX@321
+    port: 6379
+
+# swagger
+knife4j:
+  production: true
+  basic:
+    enable: true
+    username: admin
+    password: benyun
+

+ 1 - 1
src/main/resources/application.yml

@@ -1,3 +1,3 @@
 spring:
   profiles:
-    active: dev
+    active: prod