2025-12-09 14:24:40 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2025-12-10 09:02:41 +08:00
|
|
|
"context"
|
2025-12-09 14:24:40 +08:00
|
|
|
"gitee.com/red-future---jilin-g/common/http"
|
|
|
|
|
"gitee.com/red-future---jilin-g/common/jaeger"
|
|
|
|
|
_ "gitee.com/red-future---jilin-g/common/mongo"
|
|
|
|
|
_ "gitee.com/red-future---jilin-g/common/ragflow" // RAGFlow 客户端自动初始化
|
|
|
|
|
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
|
|
|
|
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
2025-12-10 09:02:41 +08:00
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
|
|
"order/controller"
|
2025-12-09 14:24:40 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
defer jaeger.ShutDown(context.Background())
|
2025-12-10 09:02:41 +08:00
|
|
|
|
|
|
|
|
// 初始化服务
|
|
|
|
|
if err := initServices(); err != nil {
|
|
|
|
|
g.Log().Fatal(context.Background(), "初始化服务失败:", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化路由
|
|
|
|
|
initRoutes()
|
|
|
|
|
|
|
|
|
|
// 注册路由
|
|
|
|
|
http.RouteRegister([]interface{}{
|
|
|
|
|
controller.OrderController,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 启动服务
|
|
|
|
|
g.Server().Run()
|
2025-12-09 14:24:40 +08:00
|
|
|
}
|