Browse Source

修改bug

yjp 1 year ago
parent
commit
e9f4bfa661

+ 0 - 1
project/mono/application/application.go

@@ -21,7 +21,6 @@ func NewApp() {
 	// 注册Router
 	appInstance.Api().PrefixRouter().RegisterVersionedRouter("v1").
 		AddMiddlewares(service.AuthMiddleware(appInstance.Infrastructure()))
-
 }
 
 func DestroyApp() {

+ 13 - 0
project/mono/application/domain/class/entity.go

@@ -28,6 +28,7 @@ type Entity struct {
 	Name       string   `sqlmapping:"column:name" sqlresult:"column:name" check:"required,lte=128"`
 	StudentNum int      `sqlmapping:"column:student_num;updateClear;" sqlresult:"column:student_num"`
 	StudentIDs []string `sqlmapping:"-" sqlresult:"-"`
+	entity.UserIDFields
 	entity.TimeFields
 }
 
@@ -52,6 +53,13 @@ func (e *Entity) ForCreate() error {
 		return err
 	}
 
+	err = entity.CheckFieldCreateUserIDResult(checkResult)
+	if err != nil {
+		return err
+	}
+
+	e.LastUpdateUserID = e.CreateUserID
+
 	return nil
 }
 
@@ -79,6 +87,11 @@ func (e *Entity) ForUpdate() error {
 		return err
 	}
 
+	err = entity.CheckFieldLastUpdateUserIDResult(checkResult)
+	if err != nil {
+		return err
+	}
+
 	return nil
 }
 

+ 8 - 0
project/mono/deployment/data_service/data_containers/class.yaml

@@ -20,6 +20,14 @@ spec:
         comment: 学生数量
         not_null: true
         index: true
+      - name: create_user_id
+        type: "varchar(32)"
+        comment: 创建用户ID
+        not_null: true
+      - name: last_update_user_id
+        type: "varchar(32)"
+        comment: 最近更新用户ID
+        not_null: true
       - name: created_time
         type: "timestamp with time zone"
         comment: 创建时间