fix: 修复客户端实例记录问题并删除父应用功能
- 客户端实例唯一标识改为 app_config_id+appName+env+ip 四元组 - 新增 last_ping_at 字段,轮询即更新,拉取配置时更新 last_fetch_at - FetchChangedConfigs 无变更时也记录客户端实例 - 清理逻辑改为基于 last_ping_at 超过5分钟删除 - 删除父应用(ParentId)相关功能
This commit is contained in:
@@ -103,7 +103,6 @@ func (h *AppHandler) GetById(c *gin.Context) {
|
||||
type AddAppRequest struct {
|
||||
Id int `json:"id"`
|
||||
GroupId *int `json:"groupId"`
|
||||
ParentId *int `json:"parentId"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Code string `json:"code" binding:"required"`
|
||||
ServiceId string `json:"serviceId"`
|
||||
@@ -141,7 +140,6 @@ func (h *AppHandler) Add(c *gin.Context) {
|
||||
|
||||
app := model.Application{
|
||||
GroupId: req.GroupId,
|
||||
ParentId: req.ParentId,
|
||||
Name: req.Name,
|
||||
Code: req.Code,
|
||||
ServiceId: req.ServiceId,
|
||||
@@ -153,15 +151,6 @@ func (h *AppHandler) Add(c *gin.Context) {
|
||||
CreatedBy: userInfo.Name,
|
||||
}
|
||||
|
||||
if req.ParentId != nil {
|
||||
var parent model.Application
|
||||
if has, _ := dao.Engine.ID(*req.ParentId).Get(&parent); has {
|
||||
app.GroupId = parent.GroupId
|
||||
app.IsModule = true
|
||||
app.Code = parent.Code + "-" + req.Code
|
||||
}
|
||||
}
|
||||
|
||||
dao.Engine.Insert(&app)
|
||||
|
||||
c.JSON(http.StatusOK, model.WrapperResponse{Code: 0, Data: true})
|
||||
|
||||
Reference in New Issue
Block a user