版本封存

This commit is contained in:
zeaslity
2025-12-06 11:26:05 +08:00
parent 13949e1ba8
commit c0ae5e30c4
57 changed files with 2443 additions and 1428 deletions

View File

@@ -0,0 +1,37 @@
package main
import (
"cmii-uav-watchdog-center/config"
"cmii-uav-watchdog-center/router"
"cmii-uav-watchdog-common/wdd_log"
"os"
"path/filepath"
"strconv"
)
func main() {
// 获取执行目录
execDir, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
wdd_log.Fatal("获取执行目录失败: %v", err)
}
// 配置文件路径
configPath := filepath.Join(execDir, "config.json")
// 加载配置
config, err := config.LoadConfig(configPath)
if err != nil {
wdd_log.Fatal("加载配置失败: %v", err)
}
// 设置路由
r := router.SetupRouter()
// 启动服务器
port := config.Server.Port
wdd_log.Info("服务器正在监听端口: %d", port)
if err := r.Run(":" + strconv.Itoa(port)); err != nil {
wdd_log.Error("启动服务器失败: %v", err)
}
}