|
@@ -53,6 +53,18 @@ func Create(tableName string, needCreateUserID bool, callbacks *CreateCallbacks)
|
|
|
return callbackOnCreateErrorReturn(callbacks, c, e, make(map[string]any), err, i)
|
|
|
}
|
|
|
|
|
|
+ if domain.HasField(e, entity.FieldCreateUserID) && domain.HasField(e, entity.FieldLastUpdateUserID) {
|
|
|
+ createUserID, err := domain.Field[string](e, entity.FieldCreateUserID)
|
|
|
+ if err != nil {
|
|
|
+ return callbackOnCreateErrorReturn(callbacks, c, e, make(map[string]any), err, i)
|
|
|
+ }
|
|
|
+
|
|
|
+ err = domain.SetField(e, entity.FieldLastUpdateUserID, createUserID)
|
|
|
+ if err != nil {
|
|
|
+ return callbackOnCreateErrorReturn(callbacks, c, e, make(map[string]any), err, i)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
err = callbackBeforeCreate(callbacks, c, e, prepared, i, nil)
|
|
|
if err != nil {
|
|
|
return callbackOnCreateErrorReturn(callbacks, c, e, prepared, err, i)
|