Skip to content

Commit 0a05397

Browse files
committed
增加ContentType接口注解
1 parent 6251dde commit 0a05397

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/annotation/ContentType.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Doctrine\Common\Annotations\Annotation;
6+
7+
/**
8+
* 调试时请求内容
9+
* @package hg\apidoc\annotation
10+
* @Annotation
11+
* @Target({"METHOD"})
12+
*/
13+
class ContentType extends Annotation
14+
{}

src/parseApi/ParseAnnotation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use hg\apidoc\annotation\Method;
2727
use hg\apidoc\annotation\Before;
2828
use hg\apidoc\annotation\After;
29+
use hg\apidoc\annotation\ContentType;
2930
use think\annotation\route\Group as RouteGroup;
3031
use think\facade\App;
3132
use think\facade\Config;
@@ -613,6 +614,9 @@ protected function parseAnnotation($refMethod, bool $enableRefService = true,$so
613614
case $annotation instanceof Tag:
614615
$data['tag'] = $annotation->value;
615616
break;
617+
case $annotation instanceof ContentType:
618+
$data['contentType'] = $annotation->value;
619+
break;
616620
case $annotation instanceof Before:
617621
$beforeAnnotation = $this->handleEventAnnotation($annotation,'before');
618622
$before = array_merge($before,$beforeAnnotation);

0 commit comments

Comments
 (0)