重构项目结构:迁移到单体架构并优化代码组织

- 删除分布式架构相关文件和配置
- 将backend-distributed重命名为backend保留分布式代码作为参考
- 优化backend-single单体架构实现
- 添加Coze API集成相关文档和测试
- 清理项目根目录的部署脚本和配置文件
- 更新WebSocket和消息服务实现
- 完善认证服务和密码加密功能
This commit is contained in:
2025-07-24 22:16:27 +08:00
parent 847f5126cf
commit ca42a7d9a4
308 changed files with 1263 additions and 13496 deletions
@@ -0,0 +1,20 @@
package com.emotionmuseum.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* 网关服务启动类
*
* @author emotion-museum
* @since 2025-07-12
*/
@SpringBootApplication
@EnableDiscoveryClient
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}
@@ -0,0 +1,39 @@
package com.emotionmuseum.gateway.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.reactive.CorsWebFilter;
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
/**
* CORS配置
*/
@Configuration
public class CorsConfig {
@Bean
public CorsWebFilter corsWebFilter() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
// 允许所有来源
corsConfiguration.addAllowedOriginPattern("*");
// 允许所有请求头
corsConfiguration.addAllowedHeader("*");
// 允许所有请求方法
corsConfiguration.addAllowedMethod("*");
// 不允许携带凭证(这样就可以使用 * 作为来源)
corsConfiguration.setAllowCredentials(false);
// 预检请求的缓存时间
corsConfiguration.setMaxAge(3600L);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", corsConfiguration);
return new CorsWebFilter(source);
}
}