Merge pull request #12654 from swordqiu/automated-cherry-pick-of-#12641-upstream-release-3.7

Automated cherry pick of #12641: fix: false delted field for deleted resources
This commit is contained in:
Zexi Li
2021-11-09 20:52:45 +08:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -39,9 +39,9 @@ type SResourceBase struct {
// 资源被更新次数
UpdateVersion int `default:"0" nullable:"false" auto_version:"true" list:"user" json:"update_version"`
// 资源删除时间
DeletedAt time.Time `json:"deleted_at" list:"admin"`
DeletedAt time.Time `json:"deleted_at" list:"user"`
// 资源是否被删除
Deleted bool `nullable:"false" default:"false" json:"deleted" list:"admin"`
Deleted bool `nullable:"false" default:"false" json:"deleted" list:"user"`
}
type SResourceBaseManager struct {

View File

@@ -239,6 +239,8 @@ type BaseListOptions struct {
PagingMarker string `help:"Marker for pagination" json:"paging_marker"`
OrderByTag string `help:"Order results by tag values, composed by a tag key and order, e.g user:部门:ASC"`
Delete string `help:"show deleted records"`
}
func (opts *BaseListOptions) addTag(prefix, tag string, idx int, params *jsonutils.JSONDict) error {