feat: refactor application to use Gin framework, update routing and middleware handling

This commit is contained in:
王锦强
2025-03-15 12:39:17 +08:00
parent cab289dabf
commit 6fa5c1f467
13 changed files with 314 additions and 279 deletions

View File

@@ -32,14 +32,14 @@ func NewApp(configPath string) (*App, error) {
return nil, fmt.Errorf("初始化服务失败: %w", err)
}
// 设置路由
handler, err := routes.SetupRoutes(cfg, ttsService)
// 设置Gin路由
router, err := routes.SetupRoutes(cfg, ttsService)
if err != nil {
return nil, fmt.Errorf("设置路由失败: %w", err)
}
// 创建HTTP服务器
server := New(cfg, handler)
server := New(cfg, router)
return &App{
server: server,