Skip to content

Commit

Permalink
Fix: mogodb adds data model to set update time
Browse files Browse the repository at this point in the history
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
  • Loading branch information
nuclearwu committed May 8, 2023
1 parent 847af3b commit 6f9de9e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/server/infrastructure/datastore/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (m *mongodb) Add(ctx context.Context, entity datastore.Entity) error {
return datastore.ErrTableNameEmpty
}
entity.SetCreateTime(time.Now())
entity.SetUpdateTime(time.Now())
if err := m.Get(ctx, entity); err == nil {
return datastore.ErrRecordExist
}
Expand Down

0 comments on commit 6f9de9e

Please sign in to comment.