更新项目配置,修改 Go 版本至 1.24,添加依赖项,重构主程序以加载配置和初始化服务,删除不再使用的远程目标配置文件。
This commit is contained in:
27
cmii-uav-watchdog/models/auth_model.go
Normal file
27
cmii-uav-watchdog/models/auth_model.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// AuthorizationFile 授权文件模型
|
||||
type AuthorizationFile struct {
|
||||
EncryptedHosts []string `json:"encrypted_hosts"` // 加密后的主机信息列表
|
||||
TOTPCode string `json:"totp_code"` // TOTP验证码
|
||||
CurrentTime time.Time `json:"current_time"` // 当前系统时间
|
||||
FirstAuthTime time.Time `json:"first_auth_time"` // 初次授权时间
|
||||
TimeOffset int64 `json:"time_offset"` // 授权时间偏移
|
||||
}
|
||||
|
||||
// AuthorizationCode 授权码模型
|
||||
type AuthorizationCode struct {
|
||||
TOTPCode string `json:"totp_code"` // TOTP验证码
|
||||
CurrentTime time.Time `json:"current_time"` // 当前系统时间
|
||||
EncryptedHosts []string `json:"encrypted_hosts"` // 授权主机的加密字符串列表
|
||||
}
|
||||
|
||||
// AuthorizationStorage 授权存储信息
|
||||
type AuthorizationStorage struct {
|
||||
EncryptedCode string `json:"encrypted_code"` // 加密后的授权码
|
||||
FirstAuthTime time.Time `json:"first_auth_time"` // 初次授权时间
|
||||
TimeOffset int64 `json:"time_offset"` // 授权时间偏移
|
||||
AuthorizedHosts []string `json:"authorized_hosts"` // 已授权主机列表
|
||||
}
|
||||
8
cmii-uav-watchdog/models/response.go
Normal file
8
cmii-uav-watchdog/models/response.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package models
|
||||
|
||||
// Response 通用响应模型
|
||||
type Response struct {
|
||||
Code int `json:"code"` // 状态码
|
||||
Message string `json:"message"` // 响应消息
|
||||
Data interface{} `json:"data"` // 响应数据
|
||||
}
|
||||
Reference in New Issue
Block a user