fix: 修复客户端实例记录问题并删除父应用功能

- 客户端实例唯一标识改为 app_config_id+appName+env+ip 四元组
- 新增 last_ping_at 字段,轮询即更新,拉取配置时更新 last_fetch_at
- FetchChangedConfigs 无变更时也记录客户端实例
- 清理逻辑改为基于 last_ping_at 超过5分钟删除
- 删除父应用(ParentId)相关功能
This commit is contained in:
2026-04-30 21:06:36 +08:00
parent ed94f53306
commit 8957286bb5
5 changed files with 54 additions and 59 deletions
-4
View File
@@ -5,12 +5,10 @@ import "time"
type Application struct {
Id int `xorm:"int autoincr pk" json:"id"`
GroupId *int `xorm:"int" json:"groupId"`
ParentId *int `xorm:"int" json:"parentId"`
Name string `xorm:"varchar(32)" json:"name"`
Code string `xorm:"varchar(32)" json:"code"`
ServiceId string `xorm:"varchar(64)" json:"serviceId"`
Token string `xorm:"varchar(64)" json:"token"`
IsModule bool `xorm:"tinyint(1) default 1" json:"isModule"`
OwnerId *int `xorm:"int" json:"ownerId"`
OwnerName string `xorm:"varchar(16)" json:"ownerName"`
Remarks string `xorm:"text" json:"remarks"`
@@ -19,7 +17,5 @@ type Application struct {
CreatedBy string `xorm:"varchar(32)" json:"createdBy"`
UpdatedAt *time.Time `xorm:"datetime" json:"updatedAt"`
UpdatedBy string `xorm:"varchar(32)" json:"updatedBy"`
ParentName string `xorm:"-" json:"parentName,omitempty"`
FullName string `xorm:"-" json:"fullName,omitempty"`
GroupName string `xorm:"-" json:"groupName,omitempty"`
}