35 lines
518 B
Go
35 lines
518 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log/slog"
|
|
"zzman/actions"
|
|
"zzman/clients"
|
|
"zzman/model"
|
|
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
func main() {
|
|
// 初始化环境
|
|
slog.Debug("初始化环境变量")
|
|
err := godotenv.Load()
|
|
if err != nil {
|
|
slog.Error(fmt.Errorf("初始化变量失败:%w", err).Error())
|
|
}
|
|
|
|
// 初始化数据库和 Redis
|
|
model.Init()
|
|
defer model.Close()
|
|
|
|
clients.InitRedis()
|
|
defer clients.CloseRedis()
|
|
|
|
// 测试功能
|
|
actions.Update(actions.UpdateArgs{
|
|
Mock: true,
|
|
})
|
|
|
|
// actions.Sync()
|
|
}
|