|
@@ -4,9 +4,12 @@ import (
|
|
|
"git.sxidc.com/go-framework/baize/convenient/relation/many2many"
|
|
"git.sxidc.com/go-framework/baize/convenient/relation/many2many"
|
|
|
"git.sxidc.com/go-framework/baize/examples/examples/project/application/domain/identity"
|
|
"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/examples/examples/project/application/domain/student"
|
|
|
|
|
+ "git.sxidc.com/go-framework/baize/framwork/binding"
|
|
|
"git.sxidc.com/go-framework/baize/framwork/core/application"
|
|
"git.sxidc.com/go-framework/baize/framwork/core/application"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+var studentAndIdentityService = &StudentAndIdentityService{}
|
|
|
|
|
+
|
|
|
type StudentAndIdentityService struct{}
|
|
type StudentAndIdentityService struct{}
|
|
|
|
|
|
|
|
func (svc *StudentAndIdentityService) Init(appInstance *application.App) error {
|
|
func (svc *StudentAndIdentityService) Init(appInstance *application.App) error {
|
|
@@ -19,7 +22,7 @@ func (svc *StudentAndIdentityService) Destroy() error {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (svc *StudentAndIdentityService) v1(appInstance *application.App) {
|
|
func (svc *StudentAndIdentityService) v1(appInstance *application.App) {
|
|
|
- v1Binder := appInstance.Binder(application.RouterPrefix, "v1")
|
|
|
|
|
|
|
+ v1Binder := binding.NewBinder(appInstance.ChooseRouter(application.RouterPrefix, "v1"), appInstance.Infrastructure())
|
|
|
|
|
|
|
|
many2many.BindSimple(v1Binder, &many2many.Simple[student.Info, identity.Info]{
|
|
many2many.BindSimple(v1Binder, &many2many.Simple[student.Info, identity.Info]{
|
|
|
Left: &student.Entity{},
|
|
Left: &student.Entity{},
|