src/Leevel/Router/OpenApiRouter.php
protected function parseRouterPath(string $path, array $groupPaths, array $groups): array
    {
        $routerPath = $this->normalizePath($path);
        $pathPrefix = '';

        if ($groupPaths) {
            foreach ($groupPaths as $key => $item) {
                if (0 === strpos($routerPath, $key)) {
                    $pathPrefix = $key;
                    $routerPath = substr($routerPath, strlen($key));

                    break;
                }
            }
        }

        $prefix = $routerPath[1];
        $groupPrefix = '_';

        foreach ($groups as $g) {
            if (0 === strpos($routerPath, $g)) {
                $groupPrefix = $g;

                break;
            }
        }

        $routerPath = $pathPrefix.$routerPath;

        return [$prefix, $groupPrefix, $routerPath];
    }
protected function parseRouterPath(string $path, array $groupPaths, array $groups): array
    {
        $routerPath = $this->normalizePath($path);
        $pathPrefix = '';

        if ($groupPaths) {
            foreach ($groupPaths as $key => $item) {
                if (0 === strpos($routerPath, $key)) {
                    $pathPrefix = $key;
                    $routerPath = substr($routerPath, strlen($key));

                    break;
                }
            }
        }

        $prefix = $routerPath[1];
        $groupPrefix = '_';

        foreach ($groups as $g) {
            if (0 === strpos($routerPath, $g)) {
                $groupPrefix = $g;

                break;
            }
        }

        $routerPath = $pathPrefix.$routerPath;

        return [$prefix, $groupPrefix, $routerPath];
    }
解析基础路径和分组.
基础路径如 /api/v1、/web/v2 等等.
分组例如 goods、orders.

@param string $path
@param array  $groupPaths
@param array  $groups

@return array