refactor: 重构项目结构,分离路由注册与主函数入口
- 将路由注册逻辑从主函数移至独立的 router 包 - 更新 main.go 以调用新的路由注册函数 - 删除旧的 digitalhuman/main.go 文件 - 简化常量文件中的注释
This commit is contained in:
23
main.go
Normal file
23
main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
digitalhuman "digital-human/digitalhuman/router"
|
||||
|
||||
_ "gitea.com/red-future/common/config"
|
||||
"gitea.com/red-future/common/jaeger"
|
||||
_ "gitea.com/red-future/common/ragflow"
|
||||
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
|
||||
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
defer jaeger.ShutDown(ctx)
|
||||
// 注册路由
|
||||
digitalhuman.Router()
|
||||
|
||||
// 保持应用运行
|
||||
select {}
|
||||
}
|
||||
Reference in New Issue
Block a user