api.go 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package permission_group
  2. import (
  3. "git.sxidc.com/go-framework/baize/convenient/domain/auth/middlewares"
  4. "git.sxidc.com/go-framework/baize/convenient/entity_crud"
  5. "git.sxidc.com/go-framework/baize/framework/binding"
  6. )
  7. // Simple Bind参数
  8. type Simple struct {
  9. // schema
  10. Schema string
  11. }
  12. func (simple *Simple) Bind(binder *binding.Binder) {
  13. entity_crud.BindSimple(binder, &entity_crud.Simple[Info]{
  14. Entity: &Entity{},
  15. Schema: simple.Schema,
  16. CreateJsonBody: &CreatePermissionGroupJsonBody{},
  17. DeleteQueryParams: &DeletePermissionGroupQueryParams{},
  18. UpdateJsonBody: &UpdatePermissionGroupJsonBody{},
  19. QueryQueryParams: &GetPermissionGroupsQueryParams{},
  20. GetByIDQueryParams: &GetPermissionGroupQueryParams{},
  21. }, entity_crud.WithCreateMiddlewares(middlewares.Authentication()),
  22. entity_crud.WithDeleteMiddlewares(middlewares.Authentication()),
  23. entity_crud.WithUpdateMiddlewares(middlewares.Authentication()),
  24. entity_crud.WithQueryMiddlewares[Info](middlewares.Authentication()),
  25. entity_crud.WithGetByIDMiddlewares[Info](middlewares.Authentication()))
  26. }