refactor: 重构项目结构,分离路由注册与主函数入口
- 将路由注册逻辑从主函数移至独立的 router 包 - 更新 main.go 以调用新的路由注册函数 - 删除旧的 digitalhuman/main.go 文件 - 简化常量文件中的注释
This commit is contained in:
18
digitalhuman/router/router.go
Normal file
18
digitalhuman/router/router.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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, // 异步任务相关接口
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user