api.go 880 B

1234567891011121314151617181920212223242526272829
  1. package permission_group
  2. import (
  3. "git.sxidc.com/go-framework/baize/convenient/entity_crud"
  4. "git.sxidc.com/go-framework/baize/framework/binding"
  5. )
  6. // Simple Bind参数
  7. type Simple struct {
  8. // schema
  9. Schema string
  10. // 鉴权中间件
  11. AuthMiddleware binding.Middleware
  12. }
  13. func (simple *Simple) Bind(binder *binding.Binder) {
  14. entity_crud.BindSimple(binder, &entity_crud.Simple[Info]{
  15. Entity: &Entity{},
  16. Schema: simple.Schema,
  17. CreateJsonBody: &CreatePermissionGroupJsonBody{},
  18. DeleteQueryParams: &DeletePermissionGroupQueryParams{},
  19. UpdateJsonBody: &UpdatePermissionGroupJsonBody{},
  20. QueryQueryParams: &GetPermissionGroupsQueryParams{},
  21. GetByIDQueryParams: &GetPermissionGroupQueryParams{},
  22. }, entity_crud.WithGlobalMiddlewares(simple.AuthMiddleware),
  23. entity_crud.WithCreateUserID(),
  24. entity_crud.WithLastUpdateUserID())
  25. }