package admin import ( "fmt" "jiacrontab/models" "jiacrontab/pkg/proto" "time" ) // GetNodeList 获得任务节点列表 // 支持获得所属分组节点,指定分组节点(超级管理员) func GetNodeList(ctx *myctx) { var ( err error nodeList []models.Node reqBody GetNodeListReqParams count int64 ) if err = ctx.Valid(&reqBody); err != nil { ctx.respParamError(err) return } if reqBody.QueryGroupID != ctx.claims.GroupID && !ctx.isSuper() { ctx.respNotAllowed() return } cfg := ctx.adm.getOpts() maxClientAliveInterval := -1 * cfg.App.MaxClientAliveInterval currentTime := time.Now().Add(time.Second * time.Duration(maxClientAliveInterval)).Format("2006-01-02 15:04:05") //失联列表更新为已断开状态 models.DB().Unscoped().Model(&models.Node{}).Where("updated_at