Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Skyeye云
Skyeye
提交
d53be064
S
Skyeye
项目概览
Skyeye云
/
Skyeye
通知
1431
Star
162
Fork
130
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d53be064
编写于
2月 09, 2022
作者:
Skyeye云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
API中心新增导出MD文档的功能
上级
9fcce7c2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
48 addition
and
2 deletion
+48
-2
api/src/main/resources/template/js/apiPage/apiPage.js
api/src/main/resources/template/js/apiPage/apiPage.js
+17
-0
api/src/main/resources/template/tpl/apiPage/apiPage.html
api/src/main/resources/template/tpl/apiPage/apiPage.html
+4
-2
api/src/main/resources/template/tpl/apiPage/mdModelFile.tpl
api/src/main/resources/template/tpl/apiPage/mdModelFile.tpl
+27
-0
未找到文件。
api/src/main/resources/template/js/apiPage/apiPage.js
浏览文件 @
d53be064
...
...
@@ -295,6 +295,23 @@ layui.config({
}});
}
// 导出为MD文档
$
(
"
body
"
).
on
(
"
click
"
,
"
#exportMD
"
,
function
(){
var
params
=
{
appId
:
$
(
"
#apiMicroservicesId
"
).
val
(),
rowId
:
$
(
this
).
attr
(
"
apiId
"
)
};
var
fileName
=
$
(
"
#apiMicroservicesId
"
).
find
(
"
option:selected
"
).
text
()
+
"
-
"
+
$
(
this
).
attr
(
"
fileName
"
);
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
queryApiDetails
"
,
params
:
params
,
type
:
'
json
'
,
method
:
"
GET
"
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
var
str
=
getDataUseHandlebars
(
getFileContent
(
'
tpl/apiPage/mdModelFile.tpl
'
),
json
);
sysFileUtil
.
saveAs
(
new
Blob
([
str
]),
fileName
);
}
else
{
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}});
});
// 获取前端限制条件
function
getReceptionLimitMation
(){
var
list
=
new
Array
();
...
...
api/src/main/resources/template/tpl/apiPage/apiPage.html
浏览文件 @
d53be064
...
...
@@ -191,6 +191,8 @@
{{
#
bean
}}
<
div
class
=
"
api-right-title
"
>
接口
:
{{
val
}}
<
button
class
=
"
layui-btn layui-btn-xs layui-btn-normal
"
type
=
"
button
"
id
=
"
exportMD
"
style
=
"
float: right; margin-top: 20px;
"
apiId
=
"
{{requestId}}
"
fileName
=
"
{{modelName}}-{{groupName}}-{{val}}.md
"
>
导出为MD
<
/button
>
<
/div
>
<
div
class
=
"
api-right-power
"
>
权限
:
{{
sq
}}
...
...
@@ -206,9 +208,9 @@
<
table
lay
-
filter
=
"
parse-table-demo
"
>
<
thead
>
<
tr
>
<
th
lay
-
data
=
"
{field:'number', width:50}
"
>
序号
<
/th
>
<
th
lay
-
data
=
"
{field:'id', width:150}
"
>
前端参数
<
/th
>
<
th
lay
-
data
=
"
{field:'name', width:150}
"
>
后端参数
<
/th
>
<
th
lay
-
data
=
"
{field:'name', width:100}
"
>
字段类型
<
/th
>
<
th
lay
-
data
=
"
{field:'var', width:200}
"
>
参数描述
<
/th
>
<
th
lay
-
data
=
"
{field:'ref', minWidth: 100}
"
>
限制条件
<
/th
>
<
th
lay
-
data
=
"
{field:'default', width: 150}
"
>
默认值
<
/th
>
...
...
@@ -218,9 +220,9 @@
<
tbody
>
{{
#
each
list
}}
<
tr
>
<
td
>
{{
number
}}
<
/td
>
<
td
>
{{
id
}}
<
/td
>
<
td
>
{{
name
}}
<
/td
>
<
td
>
{{
type
}}
<
/td
>
<
td
>
{{
var
}}
<
/td
>
<
td
>
{{
ref
}}
<
/td
>
<
td
>
{{
default
}}
<
/td
>
...
...
api/src/main/resources/template/tpl/apiPage/mdModelFile.tpl
0 → 100644
浏览文件 @
d53be064
{{
#
bean
}}
# 接口:{
{
val
}
}
###### 权限:{
{
sq
}
}
### 请求地址:/{
{
requestId
}
}
### 映射地址:{
{
path
}
}
### 参数(Parameters):
| 前端参数 | 后端参数 | 字段类型 | 参数描述 | 限制条件 | 默认值 | 示例值 |
| -------- | -------- | -------- | -------- | -------- | -------- | -------- |
{
{
#
each
list
}
}
| {
{
id
}
} | {
{
name
}
} | {
{
type
}
} | {
{
var
}
} | {
{
ref
}
} | {
{
default
}
} | {
{
exampleDefault
}
} |
{
{/
each
}
}
### 接口返回结果(Result):
| 参数 | 示例值 | 描述 |
| -------- | -------- | -------- |
|returnCode|0|接口的调用状态,成功是0,失败是-9999,系统已做封装。|
|returnMessage|成功|单独调用后台接口,如果后台处理失败或者数据有误,后台会给出提示。|
|total|15|记录一个数字,常用于分页加载时记录数据总条数。|
|rows|集合|后台返回的集合。|
|bean|实体|后台返回的实体。|
{
{/
bean
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录