docs 补充项目注释
This commit is contained in:
+5
@@ -13,6 +13,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@SpringBootApplication
|
||||
public class MonitorAdminApplication {
|
||||
|
||||
/**
|
||||
* Admin 监控服务启动入口。
|
||||
*
|
||||
* @param args 启动参数
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MonitorAdminApplication.class, args);
|
||||
System.out.println("Admin 监控启动成功");
|
||||
|
||||
+8
@@ -21,8 +21,16 @@ import org.springframework.security.web.servlet.util.matcher.PathPatternRequestM
|
||||
@Configuration
|
||||
public class SecurityConfig {
|
||||
|
||||
/**
|
||||
* 监控后台上下文路径。
|
||||
*/
|
||||
private final String adminContextPath;
|
||||
|
||||
/**
|
||||
* 创建监控后台安全配置。
|
||||
*
|
||||
* @param adminServerProperties 监控后台配置
|
||||
*/
|
||||
public SecurityConfig(AdminServerProperties adminServerProperties) {
|
||||
this.adminContextPath = adminServerProperties.getContextPath();
|
||||
}
|
||||
|
||||
+5
@@ -20,6 +20,11 @@ import static de.codecentric.boot.admin.server.domain.values.StatusInfo.*;
|
||||
@Component
|
||||
public class CustomNotifier extends AbstractEventNotifier {
|
||||
|
||||
/**
|
||||
* 初始化自定义事件通知处理器。
|
||||
*
|
||||
* @param repository 实例仓库
|
||||
*/
|
||||
protected CustomNotifier(InstanceRepository repository) {
|
||||
super(repository);
|
||||
}
|
||||
|
||||
+23
@@ -20,7 +20,13 @@ import java.util.Base64;
|
||||
*/
|
||||
public class ActuatorAuthFilter implements Filter {
|
||||
|
||||
/**
|
||||
* 认证用户名。
|
||||
*/
|
||||
private final String username;
|
||||
/**
|
||||
* 认证密码。
|
||||
*/
|
||||
private final String password;
|
||||
|
||||
/**
|
||||
@@ -34,6 +40,15 @@ public class ActuatorAuthFilter implements Filter {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验 Actuator Basic Auth 请求。
|
||||
*
|
||||
* @param servletRequest 原始请求
|
||||
* @param servletResponse 原始响应
|
||||
* @param filterChain 过滤器链
|
||||
* @throws IOException IO 异常
|
||||
* @throws ServletException Servlet 异常
|
||||
*/
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
@@ -63,10 +78,18 @@ public class ActuatorAuthFilter implements Filter {
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化过滤器。
|
||||
*
|
||||
* @param filterConfig 过滤器配置
|
||||
*/
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁过滤器。
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
+6
@@ -13,8 +13,14 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration
|
||||
public class SecurityConfig {
|
||||
|
||||
/**
|
||||
* 认证用户名。
|
||||
*/
|
||||
@Value("${spring.boot.admin.client.username}")
|
||||
private String username;
|
||||
/**
|
||||
* 认证密码。
|
||||
*/
|
||||
@Value("${spring.boot.admin.client.password}")
|
||||
private String password;
|
||||
|
||||
|
||||
+5
@@ -11,6 +11,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@SpringBootApplication
|
||||
public class SnailAiServerApplication {
|
||||
|
||||
/**
|
||||
* Snail AI 服务启动入口。
|
||||
*
|
||||
* @param args 启动参数
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
com.aizuda.snail.ai.starter.SnailAiSpringbootApplication.main(args);
|
||||
}
|
||||
|
||||
+23
@@ -15,7 +15,13 @@ import java.util.Base64;
|
||||
*/
|
||||
public class ActuatorAuthFilter implements Filter {
|
||||
|
||||
/**
|
||||
* 认证用户名。
|
||||
*/
|
||||
private final String username;
|
||||
/**
|
||||
* 认证密码。
|
||||
*/
|
||||
private final String password;
|
||||
|
||||
/**
|
||||
@@ -29,6 +35,15 @@ public class ActuatorAuthFilter implements Filter {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验 Actuator Basic Auth 请求。
|
||||
*
|
||||
* @param servletRequest 原始请求
|
||||
* @param servletResponse 原始响应
|
||||
* @param filterChain 过滤器链
|
||||
* @throws IOException IO 异常
|
||||
* @throws ServletException Servlet 异常
|
||||
*/
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
@@ -64,10 +79,18 @@ public class ActuatorAuthFilter implements Filter {
|
||||
filterChain.doFilter(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化过滤器。
|
||||
*
|
||||
* @param filterConfig 过滤器配置
|
||||
*/
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁过滤器。
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
+6
@@ -13,8 +13,14 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration
|
||||
public class SecurityConfig {
|
||||
|
||||
/**
|
||||
* 认证用户名。
|
||||
*/
|
||||
@Value("${spring.boot.admin.client.username}")
|
||||
private String username;
|
||||
/**
|
||||
* 认证密码。
|
||||
*/
|
||||
@Value("${spring.boot.admin.client.password}")
|
||||
private String password;
|
||||
|
||||
|
||||
+5
@@ -12,6 +12,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@SpringBootApplication
|
||||
public class SnailJobServerApplication {
|
||||
|
||||
/**
|
||||
* SnailJob 服务启动入口。
|
||||
*
|
||||
* @param args 启动参数
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(com.aizuda.snailjob.server.SnailJobServerApplication.class, args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user