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
3 weeks ago
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加apipost8导入模板
parent
424bb789
Changes
4
Expand all
Show 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
...
@@ -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
{
try
{
List
<
GentableEntity
>
tableList
=
new
ArrayList
<>();
List
<
GentableEntity
>
tableList
=
new
ArrayList
<>();
tableList
.
add
(
gentableEntity
);
tableList
.
add
(
gentableEntity
);
...
@@ -307,6 +307,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
...
@@ -307,6 +307,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
"api.md.ftl"
));
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
"api.md.ftl"
));
zipTemplate
(
"api.md.ftl"
,
"doc/api.md"
,
data
,
zip
);
zipTemplate
(
"api.md.ftl"
,
"doc/api.md"
,
data
,
zip
);
zipTemplate
(
"apipost.md.ftl"
,
String
.
format
(
"doc/%s.json"
,
appEntity
.
getName
()),
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
);
IOUtils
.
closeQuietly
(
zip
);
return
outputStream
.
toByteArray
();
return
outputStream
.
toByteArray
();
}
}
...
@@ -589,6 +590,9 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
...
@@ -589,6 +590,9 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
if
(
temp
.
equals
(
"apipost.md.ftl"
))
{
if
(
temp
.
equals
(
"apipost.md.ftl"
))
{
continue
;
continue
;
}
}
if
(
temp
.
equals
(
"apipost-8.md.ftl"
))
{
continue
;
}
try
{
try
{
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
temp
));
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
temp
));
StringWriter
sw
=
new
StringWriter
();
StringWriter
sw
=
new
StringWriter
();
...
...
This diff is collapsed.
Click to expand it.
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/FreeMarkerUtils.java
View file @
65b959aa
...
@@ -105,6 +105,7 @@ public class FreeMarkerUtils {
...
@@ -105,6 +105,7 @@ public class FreeMarkerUtils {
templates
.
add
(
"menu.sql.ftl"
);
templates
.
add
(
"menu.sql.ftl"
);
templates
.
add
(
"api.md.ftl"
);
templates
.
add
(
"api.md.ftl"
);
templates
.
add
(
"apipost.md.ftl"
);
templates
.
add
(
"apipost.md.ftl"
);
templates
.
add
(
"apipost-8.md.ftl"
);
if
(
GenConstants
.
TPL_CRUD
.
equals
(
tplCategory
))
{
if
(
GenConstants
.
TPL_CRUD
.
equals
(
tplCategory
))
{
templates
.
add
(
"service.java.ftl"
);
templates
.
add
(
"service.java.ftl"
);
...
...
This diff is collapsed.
Click to expand it.
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 @@
...
@@ -16,7 +16,13 @@
"uri": ""
"uri": ""
}
}
],
],
"env_var_list": {}
"env_var_list": {
"baseUrl": {
"value": "http://localhost",
"current_value": null,
"description": ""
}
}
},
},
{
{
"env_id": "2",
"env_id": "2",
...
@@ -107,109 +113,10 @@
...
@@ -107,109 +113,10 @@
"target_type": "folder",
"target_type": "folder",
"name": "系统服务",
"name": "系统服务",
"version": 4,
"version": 4,
"sort":
7
000,
"sort":
1
000,
"server_id": "0",
"server_id": "0",
"description": "",
"description": "",
"request": {
"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": [],
"pre_tasks": [],
"post_tasks": [],
"post_tasks": [],
"body": {
"body": {
...
@@ -909,7 +816,6 @@
...
@@ -909,7 +816,6 @@
},
},
{
{
"target_id": "24b21d697fe5d9",
"target_id": "24b21d697fe5d9",
"parent_id": "24b21d697fe5d3",
"parent_id": "24b21d697fe5d3",
"target_type": "api",
"target_type": "api",
"name": "用户修改密码",
"name": "用户修改密码",
...
@@ -1546,7 +1452,7 @@
...
@@ -1546,7 +1452,7 @@
"version": 4,
"version": 4,
"sort": 6000,
"sort": 6000,
"method": "POST",
"method": "POST",
"url": "{{baseUrl}}/param/list",
"url": "{{baseUrl}}/param/
inter
list",
"protocol": "http/1.1",
"protocol": "http/1.1",
"mark_id": "1",
"mark_id": "1",
"description": "字典参数列表查询",
"description": "字典参数列表查询",
...
@@ -1919,12 +1825,12 @@
...
@@ -1919,12 +1825,12 @@
},
},
<#list tableList as table>
<#list tableList as table>
{
{
"target_id": "${table_index}",
"target_id": "
1-
${table_index}",
"parent_id": "0",
"parent_id": "0",
"target_type": "folder",
"target_type": "folder",
"name": "${table.functionName}",
"name": "${table.functionName}",
"version": 5,
"version": 5,
"sort": ${table_index+2},
"sort": ${table_index+2}
000
,
"server_id": "0",
"server_id": "0",
"description": "",
"description": "",
"request": {
"request": {
...
@@ -1946,14 +1852,14 @@
...
@@ -1946,14 +1852,14 @@
}
}
},
},
{
{
"target_id": "${table_index}-1",
"target_id": "
1-
${table_index}-1",
"parent_id": "${table_index}",
"parent_id": "
1-
${table_index}",
"target_type": "api",
"target_type": "api",
"name": "查询${table.functionName}列表",
"name": "查询${table.functionName}列表",
"version": 5,
"version": 5,
"sort": 1000,
"sort": 1000,
"method": "POST",
"method": "POST",
"url": "{{baseUrl}}/${table.requestMapping}/list",
"url": "{{baseUrl}}/${table.requestMapping}/
inter
list",
"protocol": "http/1.1",
"protocol": "http/1.1",
"mark_id": "1",
"mark_id": "1",
"description": "",
"description": "",
...
@@ -2176,38 +2082,6 @@
...
@@ -2176,38 +2082,6 @@
"type": "object"
"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": [],
"headers": [],
"expect": {
"expect": {
...
@@ -2260,7 +2134,7 @@
...
@@ -2260,7 +2134,7 @@
"x-schema-mock": "@float( 1, 10, 2, 2 )",
"x-schema-mock": "@float( 1, 10, 2, 2 )",
<#elseif column.javaType == "Date">
<#elseif column.javaType == "Date">
"field_type":"integer",
"field_type":"integer",
"type":"integer"
"type":"integer"
,
"x-schema-mock": "@integer(1686120510000,1686120517127)",
"x-schema-mock": "@integer(1686120510000,1686120517127)",
<#else>
<#else>
"field_type":"string",
"field_type":"string",
...
@@ -2399,20 +2273,18 @@
...
@@ -2399,20 +2273,18 @@
"tags": []
"tags": []
},
},
{
{
"target_id": "${table_index}-2",
"target_id": "
1-
${table_index}-2",
"parent_id": "${table_index}",
"parent_id": "
1-
${table_index}",
"target_type": "api",
"target_type": "api",
"name": "${table.functionName}",
"name": "${table.functionName}",
"version": 5,
"version": 5,
"sort": 2000,
"sort": 2000,
"method": "GET",
"method": "GET",
"url": "{{baseUrl}}/${table.requestMapping}/info?id=1",
"url": "{{baseUrl}}/${table.requestMapping}/in
terin
fo?id=1",
"protocol": "http/1.1",
"protocol": "http/1.1",
"mark_id": "1",
"mark_id": "1",
"description": "",
"description": "",
"request": {
"request": {
},
"body": {
"body": {
"mode": "urlencoded",
"mode": "urlencoded",
"parameter": [
"parameter": [
...
@@ -2508,37 +2380,6 @@
...
@@ -2508,37 +2380,6 @@
"type": "object"
"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": [],
"headers": [],
"expect": {
"expect": {
...
@@ -2688,8 +2529,8 @@
...
@@ -2688,8 +2529,8 @@
"tags": []
"tags": []
},
},
{
{
"target_id": "${table_index}-3",
"target_id": "
1-
${table_index}-3",
"parent_id": "${table_index}",
"parent_id": "
1-
${table_index}",
"target_type": "api",
"target_type": "api",
"name": "${table.functionName}删除",
"name": "${table.functionName}删除",
"version": 5,
"version": 5,
...
@@ -2700,8 +2541,6 @@
...
@@ -2700,8 +2541,6 @@
"mark_id": "1",
"mark_id": "1",
"description": "",
"description": "",
"request": {
"request": {
},
"body": {
"body": {
"mode": "none",
"mode": "none",
"parameter": [],
"parameter": [],
...
@@ -2819,8 +2658,8 @@
...
@@ -2819,8 +2658,8 @@
"tags": []
"tags": []
},
},
{
{
"target_id": "${table_index}-4",
"target_id": "
1-
${table_index}-4",
"parent_id": "${table_index}",
"parent_id": "
1-
${table_index}",
"target_type": "api",
"target_type": "api",
"name": "${table.functionName}更新与保存",
"name": "${table.functionName}更新与保存",
"version": 5,
"version": 5,
...
...
This diff is collapsed.
Click to expand it.
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