123456789101112131415161718192021222324252627282930313233343536 |
- package service
- import (
- "baize-demo/project/server/application/domain/identity"
- "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 identityService = &IdentityService{}
- type IdentityService struct{}
- func (svc *IdentityService) Init(appInstance *application.App) error {
- svc.v1(appInstance)
- return nil
- }
- func (svc *IdentityService) Destroy() error {
- return nil
- }
- func (svc *IdentityService) v1(appInstance *application.App) {
- v1Binder := binding.NewBinder(appInstance.ChooseRouter(api.RouterPrefix, "v1"), appInstance.Infrastructure())
- entity_crud.BindSimple[identity.Info](v1Binder, &entity_crud.Simple[identity.Info]{
- Entity: &identity.Entity{},
- Schema: dbSchema,
- CreateJsonBody: &identity.CreateIdentityJsonBody{},
- DeleteQueryParams: &identity.DeleteIdentityQueryParams{},
- UpdateJsonBody: &identity.UpdateIdentityJsonBody{},
- QueryQueryParams: &identity.GetIdentitiesQueryParams{},
- GetByIDQueryParams: &identity.GetIdentityByIDQueryParams{},
- })
- }
|