初始化项目

This commit is contained in:
2025-12-09 13:32:43 +08:00
parent 46af4c6734
commit 2ccbf71b60
19 changed files with 784 additions and 621 deletions

16
main.go
View File

@@ -2,6 +2,9 @@ package main
import (
"cidservice/controller"
"cidservice/service"
"fmt"
"time"
"gitee.com/red-future---jilin-g/common/http"
"gitee.com/red-future---jilin-g/common/jaeger"
@@ -13,13 +16,22 @@ import (
)
func main() {
defer jaeger.ShutDown(context.Background())
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)
}
}()
http.RouteRegister([]interface{}{
controller.Advertisement,
controller.Advertiser,
controller.AdPosition,
controller.AdStatistics,
controller.Report,
controller.RateLimit,
controller.Application,
controller.StatReport,