refactor: 重构并优化项目多项功能

1. 调整CORS中间件挂载位置,重构CORS处理逻辑
2. 重写IP获取逻辑,增加私有网络IP信任校验
3. 优化日志中间件,移除/health接口单独日志逻辑
4. 改进API密钥未配置时的提示信息
5. 重构volcano TTS调用,新增voice参数支持
6. 优化请求体过大错误处理
7. 完善统计服务,修复环形缓冲区遍历逻辑,新增去重错误日志功能
This commit is contained in:
sun
2026-06-26 19:12:50 +08:00
parent 3d50b6c69d
commit 61431e00ba
9 changed files with 161 additions and 82 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ func main() {
server := &http.Server{
Addr: ":" + port,
Handler: r,
Handler: middleware.CORS(r),
ReadTimeout: 30 * time.Second,
WriteTimeout: 120 * time.Second,
IdleTimeout: 60 * time.Second,