增加服务分组管理,增加多个CPU架构支持

This commit is contained in:
刘祥超
2020-10-29 20:53:40 +08:00
parent 311f96ada7
commit 7a54655fbe
7 changed files with 216 additions and 9 deletions

View File

@@ -737,6 +737,15 @@ func (this *ServerDAO) CountAllEnabledServersWithNodeClusterId(clusterId int64)
Count()
}
// 计算使用某个分组的服务数量
func (this *ServerDAO) CountAllEnabledServersWithGroupId(groupId int64) (int64, error) {
return this.Query().
State(ServerStateEnabled).
Where("JSON_CONTAINS(groupIds, :groupId)").
Param("groupId", groupId).
Count()
}
// 创建事件
func (this *ServerDAO) createEvent() error {
return SharedSysEventDAO.CreateEvent(NewServerChangeEvent())