package relations import ( "git.sxidc.com/go-framework/baize/convenient/domain/auth/permission" "git.sxidc.com/go-framework/baize/convenient/domain/auth/role" "git.sxidc.com/go-framework/baize/convenient/relation/many2many" "git.sxidc.com/go-framework/baize/framework/binding" ) // SimpleRoleAndPermission Bind参数 type SimpleRoleAndPermission struct { // schema Schema string // 鉴权中间件 AuthMiddleware binding.Middleware } func (simple *SimpleRoleAndPermission) Bind(binder *binding.Binder) { many2many.BindSimple(binder, &many2many.Simple[role.Info, permission.Info]{ Left: &role.Entity{}, Right: &permission.Entity{}, Schema: simple.Schema, LeftUpdateJsonBody: &role.UpdatePermissionsOfRoleJsonBody{}, LeftQueryQueryParams: &role.GetPermissionsOfRoleQueryParams{}, RightUpdateJsonBody: &permission.UpdateRolesOfPermissionJsonBody{}, RightQueryQueryParams: &permission.GetRolesOfPermissionQueryParams{}, }, many2many.WithGlobalMiddlewares(simple.AuthMiddleware)) }