refactor: 移除router包并将路由注册直接移至main.go

This commit is contained in:
2026-04-27 12:05:22 +08:00
parent 8679832019
commit 151e0bcd7d
2 changed files with 10 additions and 22 deletions

View File

@@ -1,18 +0,0 @@
package router
import (
"digital-human/digitalhuman/controller"
"gitea.com/red-future/common/http"
)
func Router() {
// 注册路由
http.RouteRegister([]interface{}{
controller.Audio, // 语音相关接口
controller.CustomVoice, // 自定义语音相关接口
controller.DigitalHuman, // 数字人相关接口
controller.Video, // 视频相关接口
controller.AsyncTask, // 异步任务相关接口
})
}

14
main.go
View File

@@ -2,10 +2,10 @@ package main
import (
"context"
digitalhuman "digital-human/digitalhuman/router"
"digital-human/digitalhuman/controller"
_ "gitea.com/red-future/common/config"
"gitea.com/red-future/common/http"
"gitea.com/red-future/common/jaeger"
_ "gitea.com/red-future/common/ragflow"
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
@@ -16,8 +16,14 @@ func main() {
ctx := context.Background()
defer jaeger.ShutDown(ctx)
// 注册路由
digitalhuman.Router()
http.RouteRegister([]interface{}{
//digitalhuman相关接口
controller.Audio, // 语音相关接口
controller.CustomVoice, // 自定义语音相关接口
controller.DigitalHuman, // 数字人相关接口
controller.Video, // 视频相关接口
controller.AsyncTask, // 异步任务相关接口
})
// 保持应用运行
select {}
}