|
14 | 14 | use hg\apidoc\annotation\Param; |
15 | 15 | use hg\apidoc\annotation\Query; |
16 | 16 | use hg\apidoc\annotation\ResponseSuccess; |
| 17 | +use hg\apidoc\annotation\ResponseSuccessMd; |
17 | 18 | use hg\apidoc\annotation\ResponseError; |
| 19 | +use hg\apidoc\annotation\ResponseErrorMd; |
18 | 20 | use hg\apidoc\annotation\Title; |
19 | 21 | use hg\apidoc\annotation\Desc; |
20 | 22 | use hg\apidoc\annotation\Md; |
@@ -387,16 +389,22 @@ public static function autoCreateUrl($classPath,$method,$config): string |
387 | 389 | $classUrlArr = []; |
388 | 390 | foreach ($pathArr as $item) { |
389 | 391 | if (!in_array($item, $filterPathNames)) { |
390 | | - if (!empty($config['auto_url']) && !empty($config['auto_url']['letter_rule'])){ |
391 | | - switch ($config['auto_url']['letter_rule']) { |
392 | | - case 'lcfirst': |
393 | | - $classUrlArr[] = lcfirst($item); |
394 | | - break; |
395 | | - case 'ucfirst': |
396 | | - $classUrlArr[] = ucfirst($item); |
397 | | - break; |
398 | | - default: |
399 | | - $classUrlArr[] = $item; |
| 392 | + if (!empty($config['auto_url'])){ |
| 393 | + $key = $item; |
| 394 | + if (!empty($config['auto_url']['letter_rule'])){ |
| 395 | + switch ($config['auto_url']['letter_rule']) { |
| 396 | + case 'lcfirst': |
| 397 | + $key = lcfirst($item); |
| 398 | + break; |
| 399 | + case 'ucfirst': |
| 400 | + $key = ucfirst($item); |
| 401 | + break; |
| 402 | + default: |
| 403 | + $key = $item; |
| 404 | + } |
| 405 | + } |
| 406 | + if (!empty($config['auto_url']['handle_key'])){ |
| 407 | + $classUrlArr[] = $config['auto_url']['handle_key']($key); |
400 | 408 | } |
401 | 409 | }else{ |
402 | 410 | $classUrlArr[] = $item; |
@@ -565,6 +573,7 @@ protected function parseAnnotation($refMethod, bool $enableRefService = true,$so |
565 | 573 | case $annotation instanceof ResponseSuccess: |
566 | 574 | $responseSuccess = $this->handleParamAndReturned($responseSuccess,$annotation,'responseSuccess',$enableRefService); |
567 | 575 | break; |
| 576 | + |
568 | 577 | case $annotation instanceof Query: |
569 | 578 | $querys = $this->handleParamAndReturned($querys,$annotation,'query',$enableRefService); |
570 | 579 | break; |
@@ -615,18 +624,18 @@ protected function parseAnnotation($refMethod, bool $enableRefService = true,$so |
615 | 624 | $data['md'] = ParseMarkdown::getContent("",$annotation->ref); |
616 | 625 | } |
617 | 626 | break; |
618 | | -// case $annotation instanceof ParamMd: |
619 | | -// $data['paramMd'] = $annotation->value; |
620 | | -// if (!empty($annotation->ref)){ |
621 | | -// $data['paramMd'] = ParseMarkdown::getContent("",$annotation->ref); |
622 | | -// } |
623 | | -// break; |
624 | | -// case $annotation instanceof ReturnedMd: |
625 | | -// $data['returnMd'] = $annotation->value; |
626 | | -// if (!empty($annotation->ref)){ |
627 | | -// $data['returnMd'] = ParseMarkdown::getContent("",$annotation->ref); |
628 | | -// } |
629 | | -// break; |
| 627 | + case $annotation instanceof ResponseSuccessMd: |
| 628 | + $data['responseSuccessMd'] = $annotation->value; |
| 629 | + if (!empty($annotation->ref)){ |
| 630 | + $data['responseSuccessMd'] = ParseMarkdown::getContent("",$annotation->ref); |
| 631 | + } |
| 632 | + break; |
| 633 | + case $annotation instanceof ResponseErrorMd: |
| 634 | + $data['responseErrorMd'] = $annotation->value; |
| 635 | + if (!empty($annotation->ref)){ |
| 636 | + $data['responseErrorMd'] = ParseMarkdown::getContent("",$annotation->ref); |
| 637 | + } |
| 638 | + break; |
630 | 639 | case $annotation instanceof ParamType: |
631 | 640 | $data['paramType'] = $annotation->value; |
632 | 641 | break; |
|
0 commit comments