Files
AIGC/src/main/java/com/example/demo/DemoApplication.java
blandarebiter 90b5118e45 perf(backend+frontend): 列表API响应体积优化 3.1MB→145KB (↓95.4%)
- 后端: JPQL构造器投影排除LONGTEXT大字段(uploadedImages/videoReferenceImages)
- 后端: DTO层过滤非分镜图类型的base64内联resultUrl
- 前端: 列表缩略图从video改为img loading=lazy,消除172并发请求
- 前端: download函数增加resultUrl懒加载(详情接口兜底)
- 文档: 新增性能优化报告 docs/performance-optimization-report.md
2026-04-10 18:46:37 +08:00

31 lines
1.5 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication(exclude = {RedisAutoConfiguration.class, RedisRepositoriesAutoConfiguration.class})
@EnableScheduling
public class DemoApplication {
public static void main(String[] args) {
// 在应用启动时立即设置HTTP超时时间支付宝API调用可能需要更长时间
// 连接超时30秒读取超时120秒
// 必须在SpringApplication.run()之前设置确保在所有HTTP客户端创建之前生效
System.setProperty("sun.net.client.defaultConnectTimeout", "30000");
System.setProperty("sun.net.client.defaultReadTimeout", "120000");
// 增加HTTP缓冲区大小以支持大请求体Base64编码的图片可能很大
// 设置Socket缓冲区大小为10MB
System.setProperty("java.net.preferIPv4Stack", "true");
// Apache HttpClient 使用系统属性
System.setProperty("org.apache.http.client.connection.timeout", "30000");
System.setProperty("org.apache.http.socket.timeout", "300000");
SpringApplication.run(DemoApplication.class, args);
}
}