123456789101112131415161718192021222324252627282930313233343536 |
- package service
- import (
- "baize-demo/project/server_ds/application/domain/student"
- "git.sxidc.com/go-framework/baize/convenient/entity_crud"
- "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 studentService = &StudentService{}
- type StudentService struct{}
- func (svc *StudentService) Init(appInstance *application.App) error {
- svc.v1(appInstance)
- return nil
- }
- func (svc *StudentService) Destroy() error {
- return nil
- }
- func (svc *StudentService) v1(appInstance *application.App) {
- v1Binder := binding.NewBinder(appInstance.ChooseRouter(api.RouterPrefix, "v1"), appInstance.Infrastructure())
- entity_crud.BindSimple[student.Info](v1Binder, &entity_crud.Simple[student.Info]{
- Entity: &student.Entity{},
- Schema: dbSchema,
- CreateJsonBody: &student.CreateStudentJsonBody{},
- DeleteQueryParams: &student.DeleteStudentQueryParams{},
- UpdateJsonBody: &student.UpdateStudentJsonBody{},
- QueryQueryParams: &student.GetStudentsQueryParams{},
- GetByIDQueryParams: &student.GetStudentByIDQueryParams{},
- })
- }
|