yjp пре 1 година
родитељ
комит
4668871d10

+ 19 - 1
examples/examples/project/application/domain/hobby/entity.go

@@ -2,13 +2,31 @@ package hobby
 
 import (
 	"git.sxidc.com/go-framework/baize/framwork/domain/entity"
+	"git.sxidc.com/go-tools/utils/strutils"
 )
 
 type Entity struct {
-	entity.Base
+	ID         string   `sqlmapping:"-" sqlresult:"-"`
 	StudentIDs []string `sqlmapping:"-" sqlresult:"-"`
 }
 
+func (e *Entity) DBSchema() string {
+	return ""
+}
+
+func (e *Entity) GenerateID() error {
+	e.ID = strutils.SimpleUUID()
+	return nil
+}
+
+func (e *Entity) GetID() string {
+	return e.ID
+}
+
+func (e *Entity) CheckFieldID(domainCNName string) error {
+	return entity.CheckID(domainCNName, "ID", e.ID)
+}
+
 func (e *Entity) DomainCNName() string {
 	return "爱好"
 }

+ 2 - 3
examples/examples/project/application/service/student_and_hobby.go

@@ -3,7 +3,6 @@ package service
 import (
 	"git.sxidc.com/go-framework/baize/convenient/relation/remote"
 	"git.sxidc.com/go-framework/baize/examples/examples/project/application/domain/hobby"
-	"git.sxidc.com/go-framework/baize/examples/examples/project/application/domain/identity"
 	"git.sxidc.com/go-framework/baize/examples/examples/project/application/domain/student"
 	"git.sxidc.com/go-framework/baize/framwork/application"
 )
@@ -30,7 +29,7 @@ func (app *StudentAndHobby) v1(appInstance *application.App) {
 		Schema:                dbSchema,
 		LeftUpdateJsonBody:    &student.UpdateHobbiesOfStudentJsonBody{},
 		LeftQueryQueryParams:  &student.QueryHobbiesOfStudentQueryParams{},
-		RightUpdateJsonBody:   &identity.UpdateStudentsOfIdentityJsonBody{},
-		RightQueryQueryParams: &identity.QueryStudentsOfIdentityQueryParams{},
+		RightUpdateJsonBody:   &hobby.UpdateStudentsOfHobbyJsonBody{},
+		RightQueryQueryParams: &hobby.QueryStudentsOfHobbyQueryParams{},
 	})
 }