Commit 9b7c838b by 邓实川

SpringBoot actuator 监控

parent 5a568472
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
</parent> </parent>
<groupId>cn.8timer</groupId> <groupId>cn.8timer</groupId>
<artifactId>8timerV200</artifactId> <artifactId>8timerV200</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>v0.4-beta</version>
<name>8timerV200</name> <name>8timerV200</name>
<description>Demo project for Spring Boot</description> <description>8小时人事管家2.0</description>
<profiles> <profiles>
<profile> <profile>
...@@ -79,6 +79,16 @@ ...@@ -79,6 +79,16 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
</dependency> -->
<!-- 添加MySQL依赖 --> <!-- 添加MySQL依赖 -->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
...@@ -309,16 +319,16 @@ ...@@ -309,16 +319,16 @@
</dependency> </dependency>
<!--springboot-quartz --> <!--springboot-quartz -->
<dependency> <!-- <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId> <artifactId>spring-boot-starter-quartz</artifactId>
</dependency> </dependency> -->
<!--Quartz 使用的连接池 这里Quartz在持久化任务时使用该jar --> <!--Quartz 使用的连接池 这里Quartz在持久化任务时使用该jar -->
<dependency> <!-- <dependency>
<groupId>com.mchange</groupId> <groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId> <artifactId>c3p0</artifactId>
<version>0.9.5.2</version> <version>0.9.5.2</version>
</dependency> </dependency> -->
<!-- pdf --> <!-- pdf -->
......
...@@ -35,6 +35,7 @@ public class WebSecurityConfig implements WebMvcConfigurer { ...@@ -35,6 +35,7 @@ public class WebSecurityConfig implements WebMvcConfigurer {
//.excludePathPatterns("/") //.excludePathPatterns("/")
registry.addInterceptor(getSessionInterceptor()) registry.addInterceptor(getSessionInterceptor())
.addPathPatterns("/**") .addPathPatterns("/**")
.excludePathPatterns("/actuator/*")
.excludePathPatterns("/doc*") .excludePathPatterns("/doc*")
.excludePathPatterns("/v2/**") .excludePathPatterns("/v2/**")
.excludePathPatterns("/**/*.js") .excludePathPatterns("/**/*.js")
......
package cn.timer.api.config.quartz; package cn.timer.api.config.quartz;
import org.quartz.Job; //import org.quartz.Job;
import org.quartz.JobExecutionContext; //import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException; //import org.quartz.JobExecutionException;
//
public interface BaseJob extends Job { //public interface BaseJob extends Job {
public void execute(JobExecutionContext context) throws JobExecutionException; // public void execute(JobExecutionContext context) throws JobExecutionException;
} //}
...@@ -10,7 +10,6 @@ import javax.servlet.http.HttpSession; ...@@ -10,7 +10,6 @@ import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -54,9 +53,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -54,9 +53,6 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping(value = "/login", produces = { "application/json" }) @RequestMapping(value = "/login", produces = { "application/json" })
public class LoginController { public class LoginController {
@Autowired
private Environment env;
@Value("${configtest.patht}") @Value("${configtest.patht}")
public String port; public String port;
......
...@@ -86,6 +86,26 @@ spring: ...@@ -86,6 +86,26 @@ spring:
margin: 2 # Left hand image margin in chars. margin: 2 # Left hand image margin in chars.
invert: false # Whether images should be inverted for dark terminal themes. invert: false # Whether images should be inverted for dark terminal themes.
######### Spring boot应用健康监控
management:
endpoints:
web:
exposure:
include: "*" # 开启暴露所有的endpoint
endpoint:
health:
show-details: always # 显示健康具体信息 默认不会显示详细信息
# INFO ENDPOINT CONFIGURATION
info:
app:
name: '@project.name@'
description: '@project.description@'
version: '@project.version@'
encoding: '@project.build.sourceEncoding@'
java:
version: '@java.version@'
##############################
# mybatis-plus # mybatis-plus
mybatis-plus: mybatis-plus:
mapper-locations: classpath:mapping/**/*Mapper.xml # dao到xml文件映射 mapper-locations: classpath:mapping/**/*Mapper.xml # dao到xml文件映射
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment