Compare commits
4 Commits
c10586ad10
...
v0.0.17
| Author | SHA1 | Date | |
|---|---|---|---|
| 518d45d296 | |||
| 09fe61defd | |||
| 7d2303e5e6 | |||
| 38f5d74f4a |
@@ -179,19 +179,23 @@ func insertHook(ctx context.Context, in *gdb.HookInsertInput) (result sql.Result
|
||||
in.Data[i]["id"] = node.Generate().Int64()
|
||||
}
|
||||
if _, ok := in.Data[i]["tenant_id"]; ok {
|
||||
if g.IsEmpty(in.Data[i]["tenant_id"]) {
|
||||
if !g.IsEmpty(userInfo.TenantId) {
|
||||
in.Data[i]["tenant_id"] = userInfo.TenantId
|
||||
} else {
|
||||
return nil, fmt.Errorf("tenantId cannot be empty")
|
||||
}
|
||||
}
|
||||
}
|
||||
if _, ok := in.Data[i]["creator"]; ok {
|
||||
if g.IsEmpty(in.Data[i]["tenant_id"]) {
|
||||
if !g.IsEmpty(userInfo.UserName) {
|
||||
in.Data[i]["creator"] = userInfo.UserName
|
||||
} else {
|
||||
return nil, fmt.Errorf("user info cannot be empty")
|
||||
}
|
||||
}
|
||||
}
|
||||
if _, ok := in.Data[i]["updater"]; ok {
|
||||
if !g.IsEmpty(userInfo.UserName) {
|
||||
in.Data[i]["updater"] = userInfo.UserName
|
||||
|
||||
Reference in New Issue
Block a user