Compare commits

...

2 Commits

Author SHA1 Message Date
曹鹏飞 d679fd47bd feat: 优化404错误返回 2025-09-25 11:54:21 +08:00
曹鹏飞 67623100b0 feat: 添加actuator支持 2025-09-25 11:49:59 +08:00
10 changed files with 85 additions and 6 deletions

View File

@ -33,4 +33,12 @@ management:
web:
exposure:
include: '*'
enabled-by-default: on
enabled-by-default: on
endpoint:
health:
show-details: always
health:
db:
enabled: true
redis:
enabled: true

View File

@ -44,6 +44,10 @@
<groupId>com.github.loki4j</groupId>
<artifactId>loki-logback-appender</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>

View File

@ -33,4 +33,18 @@ sa-token:
jwt-secret-key: asdasdasifhueuiwyurfewbfjsdafjk
logging:
level:
root: info
root: info
management:
endpoints:
web:
exposure:
include: '*'
enabled-by-default: on
endpoint:
health:
show-details: always
health:
db:
enabled: true
redis:
enabled: true

View File

@ -31,4 +31,13 @@ management:
endpoints:
web:
exposure:
include: "*"
include: '*'
enabled-by-default: on
endpoint:
health:
show-details: always
health:
db:
enabled: true
redis:
enabled: true

View File

@ -50,6 +50,10 @@
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -19,4 +19,18 @@ spring:
group: ${spring.profiles.active}
logging:
level:
root: info
root: info
management:
endpoints:
web:
exposure:
include: '*'
enabled-by-default: on
endpoint:
health:
show-details: always
health:
db:
enabled: true
redis:
enabled: true

View File

@ -34,6 +34,10 @@
<groupId>com.github.loki4j</groupId>
<artifactId>loki-logback-appender</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>

View File

@ -23,4 +23,18 @@ spring:
group: ${spring.profiles.active}
logging:
level:
root: info
root: info
management:
endpoints:
web:
exposure:
include: '*'
enabled-by-default: on
endpoint:
health:
show-details: always
health:
db:
enabled: true
redis:
enabled: true

View File

@ -17,6 +17,7 @@ import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.resource.NoResourceFoundException;
import java.util.ArrayList;
import java.util.List;
@ -66,4 +67,11 @@ public class GlobalRestControllerAdvice {
public String handleNotLoginException(NotLoginException e) {
return "请重新登录";
}
@ExceptionHandler(NoResourceFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public ApiResult<Void> handleNoResourceFoundException(NoResourceFoundException ex) {
log.error("请求的地址无效: ", ex);
return ApiResult.error(STATE.BusinessError, "请求的地址无效:" + ex.getResourcePath());
}
}

View File

@ -30,7 +30,7 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lombok.version>1.18.34</lombok.version>
<lombok.version>1.18.38</lombok.version>
<spring-cloud.version>2023.0.1</spring-cloud.version>
<spring-cloud-alibaba.version>2023.0.1.0</spring-cloud-alibaba.version>
<hutool-all.version>5.8.36</hutool-all.version>