File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ package db
1616
1717import (
1818 "context"
19+ "crypto/md5"
20+ "fmt"
1921 "strings"
2022
2123 "yunion.io/x/jsonutils"
@@ -52,6 +54,9 @@ type SStandaloneAnonResourceBase struct {
5254 // 是否是模拟资源, 部分从公有云上同步的资源并不真实存在, 例如宿主机
5355 // list 接口默认不会返回这类资源,除非显示指定 is_emulate=true 过滤参数
5456 IsEmulated bool `nullable:"false" default:"false" list:"admin" create:"admin_optional" json:"is_emulated"`
57+
58+ // 用以组织架构变更通知其他服务权限变更
59+ OrgNodeMd5 string `width:"32" charset:"ascii" nullable:"true"`
5560}
5661
5762func (model * SStandaloneAnonResourceBase ) BeforeInsert () {
@@ -365,6 +370,11 @@ func (model *SStandaloneAnonResourceBase) SetOrganizationMetadataAll(ctx context
365370 return errors .Wrap (err , "SetAllOrganization" )
366371 }
367372 }
373+ Update (model , func () error {
374+ model .OrgNodeMd5 = fmt .Sprintf ("%x" , md5 .Sum ([]byte (jsonutils .Marshal (meta ).String ())))
375+ return nil
376+ })
377+
368378 // 避免加入组织架构后,项目所在的层级会移除此项目
369379 //{
370380 // userTags := make(map[string]interface{})
You can’t perform that action at this time.
0 commit comments