Skip to content

Commit 1ba4749

Browse files
committed
update5.2.0
1 parent b27b9d5 commit 1ba4749

15 files changed

Lines changed: 437 additions & 45 deletions

src/annotation/NotDebug.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 关闭接口调试
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD","CLASS"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotDebug extends AbstractAnnotation
16+
{
17+
18+
public function __construct(...$value)
19+
{
20+
parent::__construct(...$value);
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 不使用默认作者
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotDefaultAuthor extends AbstractAnnotation
16+
{
17+
18+
public function __construct(...$value)
19+
{
20+
parent::__construct(...$value);
21+
}
22+
}

src/annotation/NotHeaders.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 不使用配置中的全局请求Headers参数
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotHeaders extends AbstractAnnotation
16+
{
17+
18+
public function __construct(...$value)
19+
{
20+
parent::__construct(...$value);
21+
}
22+
}

src/annotation/NotParams.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 不使用配置中的全局请求Body参数
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotParams extends AbstractAnnotation
16+
{
17+
18+
public function __construct(...$value)
19+
{
20+
parent::__construct(...$value);
21+
}
22+
}

src/annotation/NotParse.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 标记不解析的控制器/方法
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD","CLASS"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotParse extends AbstractAnnotation
16+
{
17+
/**
18+
* @param string $value 不解析
19+
*/
20+
public function __construct(...$value)
21+
{
22+
parent::__construct(...$value);
23+
}
24+
}

src/annotation/NotQuerys.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 不使用配置中的全局请求Querys参数
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotQuerys extends AbstractAnnotation
16+
{
17+
18+
public function __construct(...$value)
19+
{
20+
parent::__construct(...$value);
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 不使用异常响应体返回数据
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotResponseError extends AbstractAnnotation
16+
{
17+
18+
public function __construct(...$value)
19+
{
20+
parent::__construct(...$value);
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 不使用成功响应体返回数据
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotResponseSuccess extends AbstractAnnotation
16+
{
17+
18+
public function __construct(...$value)
19+
{
20+
parent::__construct(...$value);
21+
}
22+
}

src/annotation/NotResponses.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
use hg\apidoc\utils\AbstractAnnotation;
7+
8+
/**
9+
* 不使用统一响应体返回数据
10+
* @package hg\apidoc\annotation
11+
* @Annotation
12+
* @Target({"METHOD"})
13+
*/
14+
#[Attribute(Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
15+
class NotResponses extends AbstractAnnotation
16+
{
17+
18+
public function __construct(...$value)
19+
{
20+
parent::__construct(...$value);
21+
}
22+
}

src/annotation/Property.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
namespace hg\apidoc\annotation;
4+
5+
use Attribute;
6+
7+
/**
8+
* 类的属性
9+
* @Annotation
10+
* @Target({"METHOD","ANNOTATION","PROPERTY"})
11+
*/
12+
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE | Attribute::TARGET_PROPERTY)]
13+
class Property extends ParamBase
14+
{
15+
16+
/**
17+
* mock
18+
* @var string
19+
*/
20+
public $mock;
21+
22+
/**
23+
* @param string $name 字段名
24+
* @param string $type 字段类型
25+
* @param bool $require 是否必须
26+
* @param string|int|bool $default 默认值
27+
* @param string|array $ref 引用注解/模型
28+
* @param string $table 引用数据表
29+
* @param string|array $field 指定Ref引入的字段
30+
* @param string|array $withoutField 排除Ref引入的字段
31+
* @param string $desc 字段名称
32+
* @param string $md Md文本内容
33+
* @param string $mock Mock规则
34+
* @param array $children 子参数
35+
* @param string $childrenField 为tree类型时指定children字段
36+
* @param string $childrenDesc 为tree类型时指定children字段说明
37+
* @param string $childrenType 为array类型时指定子节点类型
38+
*/
39+
public function __construct(
40+
$name = '',
41+
string $type = '',
42+
bool $require = false,
43+
$default = "",
44+
$ref = "",
45+
$table = "",
46+
$field = "",
47+
$withoutField = "",
48+
string $desc = '',
49+
string $md = "",
50+
string $mock = "",
51+
array $children = [],
52+
string $childrenField = "",
53+
string $childrenDesc = "children",
54+
string $childrenType = "",
55+
...$attrs
56+
)
57+
{
58+
parent::__construct(...func_get_args());
59+
}
60+
61+
62+
}

0 commit comments

Comments
 (0)