diff --git a/pom.xml b/pom.xml index 3014488..1334620 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,17 @@ ganymed-ssh2 262 - + + + de.codecentric + spring-boot-admin-starter-client + 2.7.8 + + + + org.springframework.boot + spring-boot-starter-actuator + diff --git a/src/main/java/com/mzaxd/noodles/config/SecurityConfig.java b/src/main/java/com/mzaxd/noodles/config/SecurityConfig.java index 13e1fac..fdaf3a4 100644 --- a/src/main/java/com/mzaxd/noodles/config/SecurityConfig.java +++ b/src/main/java/com/mzaxd/noodles/config/SecurityConfig.java @@ -48,6 +48,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // 对于登录接口 允许匿名访问 .antMatchers("/auth/login").permitAll() .antMatchers("/ws/**").permitAll() + .antMatchers("/actuator/**").permitAll() .antMatchers("/system/isFirstUse").permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated(); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..ac50f61 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,55 @@ +server: + port: 6081 +spring: + #MySQL配置 + datasource: + url: jdbc:mysql://192.168.1.103:3307/noodles?characterEncoding=utf-8&serverTimezone=Asia/Shanghai + username: root + password: rootroot + driver-class-name: com.mysql.cj.jdbc.Driver + servlet: + multipart: + max-file-size: 2MB + max-request-size: 5MB + #Redis配置 + redis: + host: 192.168.1.103 + database: 3 + #RabbitMq配置 + rabbitmq: + host: 192.168.1.103 + port: 5672 + username: mzaxd + password: 200712 + #配置SpringBootAdmin + boot: + admin: + client: + url: http://192.168.1.90:8324 #配置 Admin Server的地址 + instance: + service-host-type: ip +# 开放健康检查接口 +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + #打印SQL日志 建议生产环境关掉 否则日志爆炸 + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-field: delFlag + logic-delete-value: 1 + logic-not-delete-value: 0 + id-type: auto +pagehelper: + auto-dialect: on + reasonable: true + support-methods-arguments: true + page-size-zero: true \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..b8cf2a1 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,55 @@ +server: + port: 6081 +spring: + #MySQL配置 + datasource: + url: jdbc:mysql://192.168.1.103:3307/noodles?characterEncoding=utf-8&serverTimezone=Asia/Shanghai + username: root + password: rootroot + driver-class-name: com.mysql.cj.jdbc.Driver + servlet: + multipart: + max-file-size: 2MB + max-request-size: 5MB + #Redis配置 + redis: + host: 192.168.1.103 + database: 3 + #RabbitMq配置 + rabbitmq: + host: 192.168.1.103 + port: 5672 + username: mzaxd + password: 200712 + #配置SpringBootAdmin + boot: + admin: + client: + url: http://192.168.1.90:8324 #配置 Admin Server的地址 + instance: + service-host-type: ip #显示ip地址而不是默认的主机名 +# 开放健康检查接口 +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + #打印SQL日志 建议生产环境关掉 否则日志爆炸 +# configuration: +# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-field: delFlag + logic-delete-value: 1 + logic-not-delete-value: 0 + id-type: auto +pagehelper: + auto-dialect: on + reasonable: true + support-methods-arguments: true + page-size-zero: true \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index d61d5ad..90385b2 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,39 +1,3 @@ -server: - port: 6081 spring: - #MySQL配置 - datasource: - url: jdbc:mysql://192.168.1.103:3307/noodles?characterEncoding=utf-8&serverTimezone=Asia/Shanghai - username: root - password: rootroot - driver-class-name: com.mysql.cj.jdbc.Driver - servlet: - multipart: - max-file-size: 2MB - max-request-size: 5MB - #Redis配置 - redis: - host: 192.168.1.103 - database: 3 - #RabbitMq配置 - rabbitmq: - host: 192.168.1.103 - port: 5672 - username: mzaxd - password: 200712 - -mybatis-plus: - #打印SQL日志 建议生产环境关掉 否则日志爆炸 -# configuration: -# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - global-config: - db-config: - logic-delete-field: delFlag - logic-delete-value: 1 - logic-not-delete-value: 0 - id-type: auto -pagehelper: - auto-dialect: on - reasonable: true - support-methods-arguments: true - page-size-zero: true \ No newline at end of file + profiles: + active: prod \ No newline at end of file