12345678910111213141516171819202122232425262728293031323334353637 |
- package service
- import (
- "baize-demo/project/server/application/domain/hobby"
- "baize-demo/project/server/application/domain/student"
- "git.sxidc.com/go-framework/baize/convenient/relation/remote"
- "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 studentAndHobbyService = &StudentAndHobbyService{}
- type StudentAndHobbyService struct{}
- func (svc *StudentAndHobbyService) Init(appInstance *application.App) error {
- svc.v1(appInstance)
- return nil
- }
- func (svc *StudentAndHobbyService) Destroy() error {
- return nil
- }
- func (svc *StudentAndHobbyService) v1(appInstance *application.App) {
- v1Binder := binding.NewBinder(appInstance.ChooseRouter(api.RouterPrefix, "v1"), appInstance.Infrastructure())
- remote.BindSimple(v1Binder, &remote.Simple[student.Info, string]{
- Left: &student.Entity{},
- Right: &hobby.Entity{},
- Schema: dbSchema,
- LeftUpdateJsonBody: &student.UpdateHobbiesOfStudentJsonBody{},
- LeftQueryQueryParams: &student.QueryHobbiesOfStudentQueryParams{},
- RightUpdateJsonBody: &hobby.UpdateStudentsOfHobbyJsonBody{},
- RightQueryQueryParams: &hobby.QueryStudentsOfHobbyQueryParams{},
- })
- }
|