-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathwiki.php
More file actions
executable file
·111 lines (105 loc) · 3.21 KB
/
wiki.php
File metadata and controls
executable file
·111 lines (105 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
include_once('config/config.php'); //加载配置文件
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WIKI<?php echo ' | '.PRODUCT_NAME;?></title>
<link rel="stylesheet" href="assets/css/semantic.min.css">
</head>
<body>
<div class="ui large top fixed menu transition visible" style="display: flex !important;">
<div class="ui container">
<div class="header item">API_DOC<code>(1.0)</code></div>
<a class="item" href="list_class.php">文件列表</a>
<a class="item">接口列表</a>
<a class="item">文档详情</a>
<a class="active item">使用说明</a>
</div>
</div>
<div class="ui text container" style="max-width: none !important; margin-top: 50px;">
<div class="ui floating message">
<span class='ui teal tag label'>配置</span>
<div class="ui message">
<p>1. 将文件夹复制到到项目根目录即可。</p>
<p>2. 设置 api_doc/config/config.php 中 SYSTEM_CLASS_DIR 。</p>
<p>3. 赋予 api_doc/class 777 权限。</p>
</div>
<span class='ui teal tag label'>方法注释</span>
<div class="ui message">
事例一:
<pre>
/**
* 批量获取用户基本信息
* @desc 用于获取多个用户基本信息
* @return int code 操作码,0表示成功
* @return array list 用户列表
* @return int list[].id 用户ID
* @return string list[].name 用户名字
* @return string list[].note 用户来源
* @return string msg 提示信息
*/
public function getMultiBaseInfo()
{
return [];
}
</pre>
事例二:
<pre>
/**
* 获取用户基本信息
* @desc 用于获取单个用户基本信息
* @return int code 操作码,0表示成功, 1表示用户不存在
* @return object info 用户信息对象
* @return int info.id 用户ID
* @return string info.name 用户名字
* @return string info.note 用户来源
* @return string msg 提示信息
*/
public function getBaseInfo()
{
return [];
}
</pre>
</div>
<span class='ui teal tag label'>传递参数注释</span>
<div class="ui message">
在文件头部或底部配置每个方法的传入参数
<pre>
/**
* API_DOC 设置方法传参
* @return array
*/
public function getRules()
{
return [
'getBaseInfo' => [
'userId' => [
'name' => 'user_id',
'type' => 'int',
'min' => 1,
'require' => true,
'desc' => '用户ID'
],
],
'getMultiBaseInfo' => [
'userIds' => [
'name' => 'user_ids',
'type' => 'array',
'format' => 'explode',
'require' => true,
'default' => '10',
'range' => [10,100],
'desc' => '用户ID,多个以逗号分割'
],
],
];
}
</pre>
</div>
</div>
<p><?php echo COPYRIGHT?><p>
</div>
</body>
</html>