refactor(client): 重构服务类继承关系并统一使用QueryService

重构所有服务类,使其继承自QueryService接口,统一数据查询逻辑。同时为服务类添加@Service注解,确保Spring容器管理。更新相关FXML文件的控制器路径,从manager.ds调整为controller目录结构。调整pom.xml版本号至0.0.84-SNAPSHOT。新增MessageNotitfication和SimpleMessage消息类,提供基础消息结构支持。
This commit is contained in:
2025-09-11 00:06:22 +08:00
parent 23e1f98ae5
commit 375de610ef
163 changed files with 2085 additions and 578 deletions

View File

@@ -51,8 +51,8 @@ public class SecurityConfig {
http
.authorizeHttpRequests(authorize -> authorize
.requestMatchers("/login.html", "/css/**", "/js/**", "/images/**", "/webjars/**", "/login",
"/error", "/api/login")
.permitAll() // 允许静态资源、登录页面、错误页面和JSON登录API访问
"/error", "/api/login", "/ws/**")
.permitAll() // 允许静态资源、登录页面、错误页面和JSON登录API访问以及WebSocket连接
.anyRequest().authenticated() // 其他所有请求需要认证
)
.csrf(AbstractHttpConfigurer::disable) // 禁用CSRF保护适合开发环境

View File

@@ -0,0 +1,37 @@
package com.ecep.contract.config;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;
import com.ecep.contract.handler.WebSocketHandler;
/**
* WebSocket配置类
* 启用WebSocket支持并注册WebSocket处理器
*/
@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {
private final WebSocketHandler webSocketHandler;
@Autowired
public WebSocketConfig(WebSocketHandler webSocketHandler) {
this.webSocketHandler = webSocketHandler;
}
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
// 注册WebSocket处理器指定路径为/ws允许跨域请求
registry.addHandler(webSocketHandler, "/ws")
.addInterceptors(
new HttpSessionHandshakeInterceptor(List.of("JSESSIONID", "loginHistoryId", "employeeId")))
.setAllowedOrigins("*");
}
}