12345678910111213141516171819202122232425262728293031323334353637 |
- package service
- import (
- "baize-demo/project/server/application/domain/identity"
- "baize-demo/project/server/application/domain/student"
- "git.sxidc.com/go-framework/baize/convenient/relation/many2many"
- "git.sxidc.com/go-framework/baize/framework/binding"
- "git.sxidc.com/go-framework/baize/framework/core/api"
- "git.sxidc.com/go-framework/baize/framework/core/application"
- )
- var studentAndIdentityService = &StudentAndIdentityService{}
- type StudentAndIdentityService struct{}
- func (svc *StudentAndIdentityService) Init(appInstance *application.App) error {
- svc.v1(appInstance)
- return nil
- }
- func (svc *StudentAndIdentityService) Destroy() error {
- return nil
- }
- func (svc *StudentAndIdentityService) v1(appInstance *application.App) {
- v1Binder := binding.NewBinder(appInstance.ChooseRouter(api.RouterPrefix, "v1"), appInstance.Infrastructure())
- many2many.BindSimple(v1Binder, &many2many.Simple[student.Info, identity.Info]{
- Left: &student.Entity{},
- Right: &identity.Entity{},
- Schema: dbSchema,
- LeftUpdateJsonBody: &student.UpdateIdentitiesOfStudentJsonBody{},
- LeftQueryQueryParams: &student.QueryIdentitiesOfStudentQueryParams{},
- RightUpdateJsonBody: &identity.UpdateStudentsOfIdentityJsonBody{},
- RightQueryQueryParams: &identity.QueryStudentsOfIdentityQueryParams{},
- })
- }
|