Skip to content

Commit

Permalink
opslog: group literal fields
Browse files Browse the repository at this point in the history
  • Loading branch information
yousong committed Jun 18, 2020
1 parent fbc48c7 commit 50449ca
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pkg/cloudcommon/db/opslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,21 +374,23 @@ func (manager *SOpsLogManager) LogEvent(model IModel, action string, notes inter
}
}
opslog := &SOpsLog{
ObjType: model.Keyword(),
ObjId: model.GetId(),
ObjName: model.GetName(),
Action: action,
Notes: stringutils.Interface2String(notes),
OpsTime: time.Now().UTC(),
ObjType: model.Keyword(),
ObjId: model.GetId(),
ObjName: model.GetName(),
Action: action,
Notes: stringutils.Interface2String(notes),

ProjectId: userCred.GetProjectId(),
Project: userCred.GetProjectName(),
ProjectDomainId: userCred.GetProjectDomainId(),
ProjectDomain: userCred.GetProjectDomain(),
UserId: userCred.GetUserId(),
User: userCred.GetUserName(),
DomainId: userCred.GetDomainId(),
Domain: userCred.GetDomainName(),
Roles: strings.Join(userCred.GetRoles(), ","),
OpsTime: time.Now().UTC(),

UserId: userCred.GetUserId(),
User: userCred.GetUserName(),
DomainId: userCred.GetDomainId(),
Domain: userCred.GetDomainName(),
Roles: strings.Join(userCred.GetRoles(), ","),
}
opslog.SetModelManager(OpsLog, opslog)

Expand Down

0 comments on commit 50449ca

Please sign in to comment.