@@ -370,7 +370,7 @@ protected function parseApiMethod($refClass,$refMethod,$routeGroup){
370
370
// 无url,自动生成
371
371
if (empty ($ methodItem ['url ' ])) {
372
372
$ methodItem ['url ' ] = $ this ->autoCreateUrl ($ refClass ->name ,$ refMethod );
373
- } else if (!empty ($ routeGroup ->value )) {
373
+ } else if (!empty ($ methodItem [ ' url ' ]) && $ methodItem [ ' isAnnotationUrl ' ]=== false && ! empty ( $ routeGroup ->value )) {
374
374
// 路由分组,url加上分组
375
375
$ methodItem ['url ' ] = '/ ' . $ routeGroup ->value . '/ ' . $ methodItem ['url ' ];
376
376
}else if (!empty ($ methodItem ['url ' ]) && substr ($ methodItem ['url ' ], 0 , 1 ) != "/ " ) {
@@ -541,6 +541,7 @@ protected function parseAnnotation($refMethod, bool $enableRefService = true,$so
541
541
$ returns = [];
542
542
$ before = [];
543
543
$ after = [];
544
+ $ isAnnotationUrl = false ;
544
545
545
546
foreach ($ annotations as $ annotation ) {
546
547
switch (true ) {
@@ -610,6 +611,7 @@ protected function parseAnnotation($refMethod, bool $enableRefService = true,$so
610
611
break ;
611
612
case $ annotation instanceof Url:
612
613
$ data ['url ' ] = $ annotation ->value ;
614
+ $ isAnnotationUrl =true ;
613
615
break ;
614
616
case $ annotation instanceof Method:
615
617
$ data ['method ' ] = $ annotation ->value ;
@@ -637,6 +639,7 @@ protected function parseAnnotation($refMethod, bool $enableRefService = true,$so
637
639
$ data ['return ' ] = $ returns ;
638
640
$ data ['before ' ] = $ before ;
639
641
$ data ['after ' ] = $ after ;
642
+ $ data ['isAnnotationUrl ' ] = $ isAnnotationUrl ;
640
643
}
641
644
return $ data ;
642
645
}
0 commit comments