code: public function rpcMiddles(Request $request): array
      {
          $beanName = 'serviceDispatcher';
          if (!\Swoft::hasBean($beanName)) {
              return [];
          }
  
          /** @var \Swoft\Rpc\Server\ServiceDispatcher $dispatcher */
          $dispatcher = \bean($beanName);
          $middleType = (int)$request->query('type');
  
          // 1 only return user's
          if ($middleType === 1) {
              return $dispatcher->getMiddlewares();
          }
  
          return $dispatcher->requestMiddleware();
      }
docs: get all registered rpc middleware list
  @RequestMapping(route="rpc/middles", method=RequestMethod::GET)
  @param Request $request
  @return array
  @throws \Throwable