student.go 958 B

1234567891011121314151617181920212223242526272829303132
  1. package service
  2. import (
  3. "git.sxidc.com/go-framework/baize/convenient/entity"
  4. "git.sxidc.com/go-framework/baize/examples/examples/project/application/domain/student"
  5. "git.sxidc.com/go-framework/baize/framwork/application"
  6. )
  7. type StudentService struct{}
  8. func (svc *StudentService) Init(appInstance *application.App) error {
  9. svc.v1(appInstance)
  10. return nil
  11. }
  12. func (svc *StudentService) Destroy() error {
  13. return nil
  14. }
  15. func (svc *StudentService) v1(appInstance *application.App) {
  16. v1Binder := appInstance.Binder(application.RouterPrefix, "v1")
  17. entity.BindSimple[student.Info](v1Binder, &entity.Simple[student.Info]{
  18. Entity: &student.Entity{},
  19. Schema: dbSchema,
  20. CreateJsonBody: &student.CreateJsonBody{},
  21. DeleteQueryParams: &student.DeleteQueryParams{},
  22. UpdateJsonBody: &student.UpdateJsonBody{},
  23. QueryQueryParams: &student.QueryQueryParams{},
  24. GetByIDQueryParams: &student.GetByIDQueryParams{},
  25. })
  26. }