mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
Merge pull request #5498 from swordqiu/hotfix/qj-keystone-file-list-support-array
fix: keystone resources list filter should support array
This commit is contained in:
@@ -286,13 +286,13 @@ type IdentityProviderListInput struct {
|
||||
apis.EnabledStatusStandaloneResourceListInput
|
||||
|
||||
// 以驱动类型过滤
|
||||
Driver string `json:"driver"`
|
||||
Driver []string `json:"driver"`
|
||||
|
||||
// 以模板过滤
|
||||
Template string `json:"template"`
|
||||
Template []string `json:"template"`
|
||||
|
||||
// 以同步状态过滤
|
||||
SyncStatus string `json:"sync_status"`
|
||||
SyncStatus []string `json:"sync_status"`
|
||||
}
|
||||
|
||||
type CredentialListInput struct {
|
||||
@@ -301,7 +301,7 @@ type CredentialListInput struct {
|
||||
UserFilterListInput
|
||||
ProjectFilterListInput
|
||||
|
||||
Type string `json:"type"`
|
||||
Type []string `json:"type"`
|
||||
|
||||
Enabled *bool `json:"enabled"`
|
||||
}
|
||||
@@ -311,7 +311,7 @@ type PolicyListInput struct {
|
||||
apis.SharableResourceBaseListInput
|
||||
|
||||
// 以类型查询
|
||||
Type string `json:"type"`
|
||||
Type []string `json:"type"`
|
||||
}
|
||||
|
||||
type RegionFilterListInput struct {
|
||||
@@ -330,7 +330,7 @@ type ServiceListInput struct {
|
||||
apis.StandaloneResourceListInput
|
||||
|
||||
// 以Service Type过滤
|
||||
Type string `json:"type"`
|
||||
Type []string `json:"type"`
|
||||
|
||||
// 是否启用/禁用
|
||||
Enabled *bool `json:"enabled"`
|
||||
|
||||
@@ -1140,9 +1140,8 @@ func (manager *SImageManager) ListItemFilter(
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "SSharableVirtualResourceBaseManager.ListItemFilter")
|
||||
}
|
||||
fmtJsonArray := query.DiskFormats
|
||||
if len(fmtJsonArray) > 0 {
|
||||
q = q.In("disk_format", fmtJsonArray)
|
||||
if len(query.DiskFormats) > 0 {
|
||||
q = q.In("disk_format", query.DiskFormats)
|
||||
}
|
||||
if query.Uefi != nil && *query.Uefi {
|
||||
imagePropertyQ := ImagePropertyManager.Query().
|
||||
|
||||
@@ -310,7 +310,7 @@ func (manager *SCredentialManager) ListItemFilter(
|
||||
}
|
||||
}
|
||||
if len(query.Type) > 0 {
|
||||
q = q.Equals("type", query.Type)
|
||||
q = q.In("type", query.Type)
|
||||
}
|
||||
return q, nil
|
||||
}
|
||||
|
||||
@@ -843,13 +843,13 @@ func (manager *SIdentityProviderManager) ListItemFilter(
|
||||
return nil, errors.Wrap(err, "SEnabledStatusStandaloneResourceBaseManager.ListItemFilter")
|
||||
}
|
||||
if len(query.Driver) > 0 {
|
||||
q = q.Equals("driver", query.Driver)
|
||||
q = q.In("driver", query.Driver)
|
||||
}
|
||||
if len(query.Template) > 0 {
|
||||
q = q.Equals("template", query.Template)
|
||||
q = q.In("template", query.Template)
|
||||
}
|
||||
if len(query.SyncStatus) > 0 {
|
||||
q = q.Equals("sync_status", query.SyncStatus)
|
||||
q = q.In("sync_status", query.SyncStatus)
|
||||
}
|
||||
return q, nil
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ func (manager *SPolicyManager) ListItemFilter(
|
||||
return nil, errors.Wrap(err, "SSharableBaseResourceManager.ListItemFilter")
|
||||
}
|
||||
if len(query.Type) > 0 {
|
||||
q = q.Equals("type", query.Type)
|
||||
q = q.In("type", query.Type)
|
||||
}
|
||||
return q, nil
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ func (manager *SServiceManager) ListItemFilter(
|
||||
return nil, errors.Wrap(err, "SStandaloneResourceBaseManager.ListItemFilter")
|
||||
}
|
||||
if len(query.Type) > 0 {
|
||||
q = q.Equals("type", query.Type)
|
||||
q = q.In("type", query.Type)
|
||||
}
|
||||
if query.Enabled != nil {
|
||||
if *query.Enabled {
|
||||
|
||||
Reference in New Issue
Block a user