20220406
This commit is contained in:
44
vendor/hg/apidoc/src/annotation/AddField.php
vendored
Normal file
44
vendor/hg/apidoc/src/annotation/AddField.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 添加模型的字段
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class AddField extends Annotation
|
||||
{
|
||||
/**
|
||||
* 字段名
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* 类型
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'string';
|
||||
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
* @var string
|
||||
*/
|
||||
public $default;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* @var string
|
||||
*/
|
||||
public $desc;
|
||||
|
||||
/**
|
||||
* 必须
|
||||
* @var bool
|
||||
*/
|
||||
public $require = false;
|
||||
}
|
||||
14
vendor/hg/apidoc/src/annotation/Author.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Author.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 作者
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class Author extends Annotation
|
||||
{}
|
||||
14
vendor/hg/apidoc/src/annotation/Desc.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Desc.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD","CLASS"})
|
||||
*/
|
||||
class Desc extends Annotation
|
||||
{}
|
||||
14
vendor/hg/apidoc/src/annotation/Field.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Field.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 指定获取模型的字段
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class Field extends Annotation
|
||||
{}
|
||||
14
vendor/hg/apidoc/src/annotation/Group.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Group.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 分组
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"CLASS"})
|
||||
*/
|
||||
class Group extends Annotation
|
||||
{}
|
||||
40
vendor/hg/apidoc/src/annotation/Header.php
vendored
Normal file
40
vendor/hg/apidoc/src/annotation/Header.php
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
|
||||
/**
|
||||
* 请求头
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class Header extends ParamBase
|
||||
{
|
||||
/**
|
||||
* 必须
|
||||
* @var bool
|
||||
*/
|
||||
public $require = false;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
* @var string
|
||||
*/
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* 引入
|
||||
* @var string
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* @var string
|
||||
*/
|
||||
public $desc;
|
||||
|
||||
|
||||
}
|
||||
14
vendor/hg/apidoc/src/annotation/Method.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Method.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* Url
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class Method extends Annotation
|
||||
{}
|
||||
27
vendor/hg/apidoc/src/annotation/Param.php
vendored
Normal file
27
vendor/hg/apidoc/src/annotation/Param.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD","ANNOTATION"})
|
||||
*/
|
||||
final class Param extends ParamBase
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* 必须
|
||||
* @var bool
|
||||
*/
|
||||
public $require = false;
|
||||
|
||||
/**
|
||||
* 引入
|
||||
* @var string
|
||||
*/
|
||||
public $ref;
|
||||
}
|
||||
62
vendor/hg/apidoc/src/annotation/ParamBase.php
vendored
Normal file
62
vendor/hg/apidoc/src/annotation/ParamBase.php
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
abstract class ParamBase extends Annotation
|
||||
{
|
||||
|
||||
/**
|
||||
* 类型
|
||||
* @Enum({"string", "integer", "int", "boolean", "array", "double", "object", "tree", "file","float","date","time","datetime"})
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'string';
|
||||
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
* @var string
|
||||
*/
|
||||
public $default;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* @var string
|
||||
*/
|
||||
public $desc;
|
||||
|
||||
/**
|
||||
* 为tree类型时指定children字段
|
||||
* @var string
|
||||
*/
|
||||
public $childrenField = '';
|
||||
|
||||
/**
|
||||
* 为tree类型时指定children字段说明
|
||||
* @var string
|
||||
*/
|
||||
public $childrenDesc = 'children';
|
||||
|
||||
/**
|
||||
* 为array类型时指定子节点类型
|
||||
* @Enum({"string", "int", "boolean", "array", "object"})
|
||||
* @var string
|
||||
*/
|
||||
public $childrenType = '';
|
||||
|
||||
/**
|
||||
* 指定引入的字段
|
||||
* @var string
|
||||
*/
|
||||
public $field;
|
||||
|
||||
/**
|
||||
* 指定从引入中过滤的字段
|
||||
* @var string
|
||||
*/
|
||||
public $withoutField;
|
||||
|
||||
|
||||
}
|
||||
14
vendor/hg/apidoc/src/annotation/ParamType.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/ParamType.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class ParamType extends Annotation
|
||||
{}
|
||||
34
vendor/hg/apidoc/src/annotation/Returned.php
vendored
Normal file
34
vendor/hg/apidoc/src/annotation/Returned.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 返回参数
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD","ANNOTATION"})
|
||||
*/
|
||||
final class Returned extends ParamBase
|
||||
{
|
||||
|
||||
/**
|
||||
* 必须
|
||||
* @var bool
|
||||
*/
|
||||
public $require = false;
|
||||
|
||||
/**
|
||||
* 引入
|
||||
* @var string
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
/**
|
||||
* 是否替换全局响应体中的参数
|
||||
* @var bool
|
||||
*/
|
||||
public $replaceGlobal = false;
|
||||
|
||||
}
|
||||
17
vendor/hg/apidoc/src/annotation/Route.php
vendored
Normal file
17
vendor/hg/apidoc/src/annotation/Route.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation\Enum;
|
||||
|
||||
|
||||
final class Route extends Rule
|
||||
{
|
||||
/**
|
||||
* 请求类型
|
||||
* @Enum({"GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD"})
|
||||
* @var string
|
||||
*/
|
||||
public $method = "GET";
|
||||
|
||||
}
|
||||
77
vendor/hg/apidoc/src/annotation/Rule.php
vendored
Normal file
77
vendor/hg/apidoc/src/annotation/Rule.php
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
abstract class Rule extends Annotation
|
||||
{
|
||||
/**
|
||||
* @var string|array
|
||||
*/
|
||||
public $middleware;
|
||||
|
||||
/**
|
||||
* 后缀
|
||||
* @var string
|
||||
*/
|
||||
public $ext;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $deny_ext;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $https;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $domain;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $complete_match;
|
||||
|
||||
/**
|
||||
* @var string|array
|
||||
*/
|
||||
public $cache;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $ajax;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $pjax;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $json;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $filter;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $append;
|
||||
|
||||
public function getOptions()
|
||||
{
|
||||
return array_intersect_key(get_object_vars($this), array_flip([
|
||||
'middleware', 'ext', 'deny_ext', 'https', 'domain', 'complete_match', 'cache', 'ajax', 'pjax', 'json', 'filter', 'append',
|
||||
]));
|
||||
}
|
||||
|
||||
}
|
||||
14
vendor/hg/apidoc/src/annotation/Sort.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Sort.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"CLASS"})
|
||||
*/
|
||||
class Sort extends Annotation
|
||||
{}
|
||||
14
vendor/hg/apidoc/src/annotation/Tag.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Tag.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* Tag
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class Tag extends Annotation
|
||||
{}
|
||||
14
vendor/hg/apidoc/src/annotation/Title.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Title.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD","CLASS"})
|
||||
*/
|
||||
class Title extends Annotation
|
||||
{}
|
||||
14
vendor/hg/apidoc/src/annotation/Url.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/Url.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* Url
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class Url extends Annotation
|
||||
{}
|
||||
14
vendor/hg/apidoc/src/annotation/WithoutField.php
vendored
Normal file
14
vendor/hg/apidoc/src/annotation/WithoutField.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace hg\apidoc\annotation;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation;
|
||||
|
||||
/**
|
||||
* 排除模型的字段
|
||||
* @package hg\apidoc\annotation
|
||||
* @Annotation
|
||||
* @Target({"METHOD"})
|
||||
*/
|
||||
class WithoutField extends Annotation
|
||||
{}
|
||||
Reference in New Issue
Block a user