未验证 提交 b21957f8 编写于 作者: X X.Mo 提交者: GitHub

Merge pull request #52 from fieldhood/master

update 适配最新的前端文档页面
......@@ -81,9 +81,9 @@ class ApiDocController extends MineApi
// 注解与数据库定义的合并
$apis = array_merge($appAndInterfaceList['apis'], $apis);
$data['apis'] = $apis;
$appAndInterfaceList['apis'] = $apis;
return $this->success($data);
return $this->success($appAndInterfaceList);
}
/**
......
......@@ -60,7 +60,8 @@ class DemoApi
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[MApi(accessName: "getUserList", name: "获取用户列表接口", description: "获取用户列表接口", appId: "a7ccdef6d7")]
// appId 换成自己的 groupId 换成自己的 (前端更新,这两个必须有,后台才能看到文档
#[MApi(accessName: "getUserList", name: "获取用户列表接口", description: "获取用户列表接口", appId: "a7ccdef6d7", groupId: 3)]
# 响应出参 以下注解暂时仅仅用于生成文档
#[MApiResponseParam(name: 'data.items', description: "用户信息", dataType: 'Array')]
......@@ -77,7 +78,8 @@ class DemoApi
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[MApi(accessName: "getDeptList", name: "获取部门列表接口", description: "获取部门列表接口", appId: "a7ccdef6d7")]
// appId 换成自己的 groupId 换成自己的 (前端更新,这两个必须有,后台才能看到文档
#[MApi(accessName: "getDeptList", name: "获取部门列表接口", description: "获取部门列表接口", appId: "a7ccdef6d7", groupId: 3)]
# 响应出参 以下注解暂时仅仅用于生成文档
#[MApiResponseParam(name: 'data', description: "部门信息", dataType: 'Array')]
......@@ -93,7 +95,8 @@ class DemoApi
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[MApi(accessName: "getUserInfo", name: "获取用户信息", description: "获取用户信息", appId: "a7ccdef6d7")]
// appId 换成自己的 groupId 换成自己的 (前端更新,这两个必须有,后台才能看到文档
#[MApi(accessName: "getUserInfo", name: "获取用户信息", description: "获取用户信息", appId: "a7ccdef6d7", groupId: 3)]
# 请求入参 以下注解暂时仅仅用于生成文档 仅仅作为示例,可以没有
#[MApiRequestParam(name: 'id', description: "用户id", dataType: 'Integer')]
......
......@@ -18,11 +18,13 @@ class MApi extends AbstractAnnotation
public string $description,
// appId
public string $appId,
// 是否启用
public int $status = 1,
// 验证模式 1 简单 2 复杂;
public int $authMode = SystemApi::AUTH_MODE_EASY,
// 请求方式 A, P, G, U, D
public string $requestMode = SystemApi::METHOD_ALL,
// 所属分组 可以不用
// api的所属分组id
public int $groupId = 0,
// 备注
public string $remark = '',
......
......@@ -59,6 +59,7 @@ class MApiCollector extends MetadataCollector
'class_name' => $data['class'],
'method_name' => $data['method'],
'name' => $data['annotation']->name,
'status' => $data['annotation']->status,
'access_name' => $data['annotation']->accessName,
'request_mode' => $data['annotation']->requestMode,
'remark' => $data['annotation']->remark,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册