role_and_user.go 875 B

1234567891011121314151617181920212223242526
  1. package relations
  2. import (
  3. "git.sxidc.com/go-framework/baize/convenient/domain/auth/role"
  4. "git.sxidc.com/go-framework/baize/convenient/domain/auth/user"
  5. "git.sxidc.com/go-framework/baize/convenient/relation/many2many"
  6. "git.sxidc.com/go-framework/baize/framework/binding"
  7. )
  8. // SimpleUserAndRole Bind参数
  9. type SimpleUserAndRole struct {
  10. // schema
  11. Schema string
  12. }
  13. func (simple *SimpleUserAndRole) Bind(binder *binding.Binder) {
  14. many2many.BindSimple(binder, &many2many.Simple[user.Info, role.Info]{
  15. Left: &user.Entity{},
  16. Right: &role.Entity{},
  17. Schema: simple.Schema,
  18. LeftUpdateJsonBody: &user.UpdateRolesOfUserJsonBody{},
  19. LeftQueryQueryParams: &user.GetRolesOfUserQueryParams{},
  20. RightUpdateJsonBody: &role.UpdateUsersOfRoleJsonBody{},
  21. RightQueryQueryParams: &role.GetUsersOfRoleQueryParams{},
  22. })
  23. }