permission_group_and_permission.go 1.2 KB

1234567891011121314151617181920212223242526272829
  1. package relations
  2. import (
  3. "git.sxidc.com/go-framework/baize/convenient/domain/auth/permission"
  4. "git.sxidc.com/go-framework/baize/convenient/domain/auth/permission_group"
  5. "git.sxidc.com/go-framework/baize/convenient/relation/many2many"
  6. "git.sxidc.com/go-framework/baize/framework/binding"
  7. )
  8. // SimplePermissionGroupAndPermission Bind参数
  9. type SimplePermissionGroupAndPermission struct {
  10. // schema
  11. Schema string
  12. // 鉴权中间件
  13. AuthMiddleware binding.Middleware
  14. }
  15. func (simple *SimplePermissionGroupAndPermission) Bind(binder *binding.Binder) {
  16. many2many.BindSimple(binder, &many2many.Simple[permission_group.Info, permission.Info]{
  17. Left: &permission_group.Entity{},
  18. Right: &permission.Entity{},
  19. Schema: simple.Schema,
  20. LeftUpdateJsonBody: &permission_group.UpdatePermissionsOfPermissionGroupJsonBody{},
  21. LeftQueryQueryParams: &permission_group.GetPermissionsOfPermissionGroupQueryParams{},
  22. RightUpdateJsonBody: &permission.UpdatePermissionGroupsOfPermissionJsonBody{},
  23. RightQueryQueryParams: &permission.GetPermissionGroupsOfPermissionQueryParams{},
  24. }, many2many.WithGlobalMiddlewares(simple.AuthMiddleware))
  25. }