src/Http/Controller/AppController.php
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();
    }
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();
    }
get all registered rpc middleware list
@RequestMapping(route="rpc/middles", method=RequestMethod::GET)
@param Request $request
@return array
@throws \Throwable