package service import ( "baize-demo/project/server/application/domain/family" "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 familyService = &FamilyService{} type FamilyService struct{} func (svc *FamilyService) Init(appInstance *application.App) error { svc.v1(appInstance) return nil } func (svc *FamilyService) Destroy() error { return nil } func (svc *FamilyService) v1(appInstance *application.App) { v1Binder := binding.NewBinder(appInstance.ChooseRouter(api.RouterPrefix, "v1"), appInstance.Infrastructure()) entity_crud.BindSimple[family.Info](v1Binder, &entity_crud.Simple[family.Info]{ Entity: &family.Entity{}, Schema: dbSchema, CreateJsonBody: &family.CreateFamilyJsonBody{}, DeleteQueryParams: &family.DeleteFamilyQueryParams{}, UpdateJsonBody: &family.UpdateFamilyJsonBody{}, QueryQueryParams: &family.GetFamiliesQueryParams{}, GetByIDQueryParams: &family.GetFamilyByIDQueryParams{}, }) }