diff --git a/src/Utility/AnnotationDoc.php b/src/Utility/AnnotationDoc.php index 9384829..2a3363d 100644 --- a/src/Utility/AnnotationDoc.php +++ b/src/Utility/AnnotationDoc.php @@ -126,6 +126,11 @@ function buildAnnotationHtml(string $dirOrFile): array $methods = $objectAnnotation->getMethod(); ksort($methods); $controllerAnnotation = $objectAnnotation->getController(); + if(!$controllerAnnotation){ + $controllerName = 'default'; + }else{ + $controllerName = $controllerAnnotation->value; + } foreach ($methods as $methodName => $method) { //仅仅渲染有api标记的方法 $apiTag = $method->getApiTag(); @@ -135,12 +140,12 @@ function buildAnnotationHtml(string $dirOrFile): array $globalInfo = ''; } - $groupList[$currentGroupName][$method->getMethodName()] = $method; + $groupList[$currentGroupName][$controllerName.'-'.$method->getMethodName()] = $method; $deprecated = ''; if ($apiTag->deprecated) { $deprecated .= "已废弃"; } - $html .= "

{$apiTag->name}{$deprecated}

{$this->CLRF}"; + $html .= "

{$apiTag->name}{$deprecated}

{$this->CLRF}"; $html .= "

基本信息

{$this->CLRF}"; //兼容api指定