2025-12-05 14:40:33 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2025-12-06 15:24:30 +08:00
|
|
|
"cidservice/controller"
|
2025-12-09 13:32:43 +08:00
|
|
|
"cidservice/service"
|
|
|
|
|
"fmt"
|
|
|
|
|
"time"
|
2025-12-05 14:40:33 +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"
|
|
|
|
|
"golang.org/x/net/context"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2025-12-09 13:32:43 +08:00
|
|
|
ctx := context.Background()
|
|
|
|
|
defer jaeger.ShutDown(ctx)
|
|
|
|
|
|
|
|
|
|
// 启动统计报表定时任务调度器
|
|
|
|
|
go func() {
|
|
|
|
|
time.Sleep(5 * time.Second) // 等待数据库连接初始化完成
|
|
|
|
|
if err := service.StatReportSchedulerInstance.StartScheduler(ctx); err != nil {
|
|
|
|
|
fmt.Printf("启动统计报表定时任务失败: %v\n", err)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
|
2025-12-05 14:40:33 +08:00
|
|
|
http.RouteRegister([]interface{}{
|
2025-12-06 09:10:24 +08:00
|
|
|
controller.Advertisement,
|
|
|
|
|
controller.Advertiser,
|
|
|
|
|
controller.AdPosition,
|
|
|
|
|
controller.AdStatistics,
|
2025-12-08 16:56:38 +08:00
|
|
|
controller.RateLimit,
|
|
|
|
|
controller.Application,
|
2025-12-06 18:36:43 +08:00
|
|
|
controller.StatReport,
|
2025-12-05 14:40:33 +08:00
|
|
|
})
|
|
|
|
|
select {}
|
|
|
|
|
}
|