Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
appbuild
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
appbuild
Commits
65b959aa
Commit
65b959aa
authored
May 12, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加apipost8导入模板
parent
424bb789
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
272 deletions
+39
-272
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java
...ase/system/gentable/service/impl/GentableServiceImpl.java
+5
-1
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/FreeMarkerUtils.java
...in/java/com/mortals/xhx/common/utils/FreeMarkerUtils.java
+1
-0
appbuild-manager/src/main/resources/template/doc/apipost-8.md.ftl
...-manager/src/main/resources/template/doc/apipost-8.md.ftl
+22
-183
appbuild-manager/src/main/resources/template/doc/apipost.ftl
appbuild-manager/src/main/resources/template/doc/apipost.ftl
+11
-88
No files found.
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java
View file @
65b959aa
...
...
@@ -213,7 +213,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
}
if
(
temp
.
equals
(
"menu.sql.ftl"
)
||
temp
.
equals
(
"db.sql.ftl"
)
||
temp
.
equals
(
"dm_db.sql.ftl"
)
||
temp
.
equals
(
"api.md.ftl"
)
||
temp
.
equals
(
"apipost.md.ftl"
))
{
if
(
temp
.
equals
(
"menu.sql.ftl"
)
||
temp
.
equals
(
"db.sql.ftl"
)
||
temp
.
equals
(
"dm_db.sql.ftl"
)
||
temp
.
equals
(
"api.md.ftl"
)
||
temp
.
equals
(
"apipost.md.ftl"
)
||
temp
.
equals
(
"apipost-8.md.ftl"
)
)
{
try
{
List
<
GentableEntity
>
tableList
=
new
ArrayList
<>();
tableList
.
add
(
gentableEntity
);
...
...
@@ -307,6 +307,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
"api.md.ftl"
));
zipTemplate
(
"api.md.ftl"
,
"doc/api.md"
,
data
,
zip
);
zipTemplate
(
"apipost.md.ftl"
,
String
.
format
(
"doc/%s.json"
,
appEntity
.
getName
()),
data
,
zip
);
zipTemplate
(
"apipost-8.md.ftl"
,
String
.
format
(
"doc/%s-8.json"
,
appEntity
.
getName
()),
data
,
zip
);
IOUtils
.
closeQuietly
(
zip
);
return
outputStream
.
toByteArray
();
}
...
...
@@ -589,6 +590,9 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
if
(
temp
.
equals
(
"apipost.md.ftl"
))
{
continue
;
}
if
(
temp
.
equals
(
"apipost-8.md.ftl"
))
{
continue
;
}
try
{
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
temp
));
StringWriter
sw
=
new
StringWriter
();
...
...
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/FreeMarkerUtils.java
View file @
65b959aa
...
...
@@ -105,6 +105,7 @@ public class FreeMarkerUtils {
templates
.
add
(
"menu.sql.ftl"
);
templates
.
add
(
"api.md.ftl"
);
templates
.
add
(
"apipost.md.ftl"
);
templates
.
add
(
"apipost-8.md.ftl"
);
if
(
GenConstants
.
TPL_CRUD
.
equals
(
tplCategory
))
{
templates
.
add
(
"service.java.ftl"
);
...
...
appbuild-manager/src/main/resources/template/doc/apipost-8.ftl
→
appbuild-manager/src/main/resources/template/doc/apipost-8.
md.
ftl
View file @
65b959aa
...
...
@@ -16,7 +16,13 @@
"uri": ""
}
],
"env_var_list": {}
"env_var_list": {
"baseUrl": {
"value": "http://localhost",
"current_value": null,
"description": ""
}
}
},
{
"env_id": "2",
...
...
@@ -107,109 +113,10 @@
"target_type": "folder",
"name": "系统服务",
"version": 4,
"sort":
7
000,
"sort":
1
000,
"server_id": "0",
"description": "",
"request": {
"auth": {
"type": "noauth",
"kv": {
"key": "",
"value": "",
"in": "header"
},
"bearer": {
"key": ""
},
"basic": {
"username": "",
"password": ""
},
"digest": {
"username": "",
"password": "",
"realm": "",
"nonce": "",
"algorithm": "",
"qop": "",
"nc": "",
"cnonce": "",
"opaque": ""
},
"hawk": {
"authId": "",
"authKey": "",
"algorithm": "",
"user": "",
"nonce": "",
"extraData": "",
"default": "",
"delegation": "",
"timestamp": "",
"includePayloadHash": false
},
"awsv4": {
"accessKey": "",
"secretKey": "",
"region": "",
"service": "",
"sessionToken": "",
"addAuthDataToQuery": false
},
"ntlm": {
"username": "",
"password": "",
"entity": "",
"workstation": "",
"disableRetryRequest": false
},
"edgegrid": {
"accessToken": "",
"clientToken": "",
"clientSecret": "",
"nonce": "",
"timestamp": "",
"baseURi": "",
"headersToSign": ""
},
"oauth1": {
"consumerKey": "",
"consumerSecret": "",
"signatureMethod": "HMAC-SHA1",
"addEmptyParamsToSign": true,
"includeBodyHash": true,
"addParamsToHeader": false,
"disableHeaderEncoding": false,
"realm": "",
"version": "1.0",
"nonce": "",
"timestamp": "",
"verifier": "",
"callback": "",
"tokenSecret": "",
"token": ""
},
"jwt": {
"addTokenTo": "header",
"algorithm": "HS256",
"secret": "",
"isSecretBase64Encoded": false,
"payload": "",
"headerPrefix": "Bearer",
"queryParamKey": "token",
"header": ""
},
"asap": {
"alg": "HS256",
"iss": "",
"aud": "",
"kid": "",
"privateKey": "",
"sub": "",
"claims": "",
"exp": ""
}
},
"pre_tasks": [],
"post_tasks": [],
"body": {
...
...
@@ -909,7 +816,6 @@
},
{
"target_id": "24b21d697fe5d9",
"parent_id": "24b21d697fe5d3",
"target_type": "api",
"name": "用户修改密码",
...
...
@@ -1546,7 +1452,7 @@
"version": 4,
"sort": 6000,
"method": "POST",
"url": "{{baseUrl}}/param/list",
"url": "{{baseUrl}}/param/
inter
list",
"protocol": "http/1.1",
"mark_id": "1",
"description": "字典参数列表查询",
...
...
@@ -1919,12 +1825,12 @@
},
<#list tableList as table>
{
"target_id": "${table_index}",
"target_id": "
1-
${table_index}",
"parent_id": "0",
"target_type": "folder",
"name": "${table.functionName}",
"version": 5,
"sort": ${table_index+2},
"sort": ${table_index+2}
000
,
"server_id": "0",
"description": "",
"request": {
...
...
@@ -1946,14 +1852,14 @@
}
},
{
"target_id": "${table_index}-1",
"parent_id": "${table_index}",
"target_id": "
1-
${table_index}-1",
"parent_id": "
1-
${table_index}",
"target_type": "api",
"name": "查询${table.functionName}列表",
"version": 5,
"sort": 1000,
"method": "POST",
"url": "{{baseUrl}}/${table.requestMapping}/list",
"url": "{{baseUrl}}/${table.requestMapping}/
inter
list",
"protocol": "http/1.1",
"mark_id": "1",
"description": "",
...
...
@@ -2176,38 +2082,6 @@
"type": "object"
}
}
<#list table.columns as column>
,
{
"description":"${column.columnComment}",
"is_checked":1,
"key":"data.data.0.${column.javaField}",
"not_null":true,
<#if column.javaType=="String">
"field_type":"string",
"type":"string",
"value":"${column.randomStr(column.javaType)}"
<#elseif column.javaType == "Long"|| column.javaType=="Integer">
"field_type":"integer",
"type":"integer",
"value":${column.randomStr(column.javaType)}
<#elseif column.javaType == "BigDecimal">
"field_type":"number",
"type":"number",
"value":"${column.randomStr(column.javaType)}"
<#elseif column.javaType == "Date">
"field_type":"integer",
"type":"integer",
"value":1686117130116
<#else>
"field_type":"string",
"type":"string",
"value":"${column.randomStr(column.javaType)}"
</#if>
}
</#list>
],
"headers": [],
"expect": {
...
...
@@ -2260,7 +2134,7 @@
"x-schema-mock": "@float( 1, 10, 2, 2 )",
<#elseif column.javaType == "Date">
"field_type":"integer",
"type":"integer"
"type":"integer"
,
"x-schema-mock": "@integer(1686120510000,1686120517127)",
<#else>
"field_type":"string",
...
...
@@ -2399,20 +2273,18 @@
"tags": []
},
{
"target_id": "${table_index}-2",
"parent_id": "${table_index}",
"target_id": "
1-
${table_index}-2",
"parent_id": "
1-
${table_index}",
"target_type": "api",
"name": "${table.functionName}",
"version": 5,
"sort": 2000,
"method": "GET",
"url": "{{baseUrl}}/${table.requestMapping}/info?id=1",
"url": "{{baseUrl}}/${table.requestMapping}/in
terin
fo?id=1",
"protocol": "http/1.1",
"mark_id": "1",
"description": "",
"request": {
},
"body": {
"mode": "urlencoded",
"parameter": [
...
...
@@ -2508,37 +2380,6 @@
"type": "object"
}
}
<#list table.columns as column>
,
{
"description": "${column.columnComment}",
<#if column.javaType=="String">
"field_type":"string",
"type": "string",
"value":"${column.randomStr(column.javaType)}",
<#elseif column.javaType == "Long"|| column.javaType=="Integer">
"field_type":"integer",
"type": "integer",
"value":${column.randomStr(column.javaType)},
<#elseif column.javaType == "BigDecimal">
"field_type":"number",
"type": "number",
"value":${column.randomStr(column.javaType)},
<#elseif column.javaType == "Date">
"field_type":"integer",
"type": "integer",
"value":1686117130116,
<#else>
"field_type":"string",
"type": "string",
"value":"${column.randomStr(column.javaType)}",
</#if>
"is_checked": 1,
"key": "data.${column.javaField}",
"not_null": true
}
</#list>
],
"headers": [],
"expect": {
...
...
@@ -2688,8 +2529,8 @@
"tags": []
},
{
"target_id": "${table_index}-3",
"parent_id": "${table_index}",
"target_id": "
1-
${table_index}-3",
"parent_id": "
1-
${table_index}",
"target_type": "api",
"name": "${table.functionName}删除",
"version": 5,
...
...
@@ -2700,8 +2541,6 @@
"mark_id": "1",
"description": "",
"request": {
},
"body": {
"mode": "none",
"parameter": [],
...
...
@@ -2819,8 +2658,8 @@
"tags": []
},
{
"target_id": "${table_index}-4",
"parent_id": "${table_index}",
"target_id": "
1-
${table_index}-4",
"parent_id": "
1-
${table_index}",
"target_type": "api",
"name": "${table.functionName}更新与保存",
"version": 5,
...
...
appbuild-manager/src/main/resources/template/doc/apipost.ftl
View file @
65b959aa
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment