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
bf933e77
Commit
bf933e77
authored
Jun 08, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加apipost生成接口文档逻辑
parent
93d93ef0
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
2927 additions
and
140 deletions
+2927
-140
appbuild-manage-ui/admin/src/components/SearchForm.vue
appbuild-manage-ui/admin/src/components/SearchForm.vue
+1
-1
appbuild-manage-ui/admin/src/views/system/gentable/list.vue
appbuild-manage-ui/admin/src/views/system/gentable/list.vue
+0
-1
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/model/GentableEntityExt.java
...als/xhx/base/system/gentable/model/GentableEntityExt.java
+9
-4
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java
...ase/system/gentable/service/impl/GentableServiceImpl.java
+28
-9
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/web/GentableController.java
...tals/xhx/base/system/gentable/web/GentableController.java
+0
-1
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/ApiPostBuild.java
.../main/java/com/mortals/xhx/common/utils/ApiPostBuild.java
+7
-0
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/FreeMarkerUtils.java
...in/java/com/mortals/xhx/common/utils/FreeMarkerUtils.java
+19
-18
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/GenUtils.java
.../src/main/java/com/mortals/xhx/common/utils/GenUtils.java
+0
-6
appbuild-manager/src/main/resources/template/doc/api.md.ftl
appbuild-manager/src/main/resources/template/doc/api.md.ftl
+76
-73
appbuild-manager/src/main/resources/template/doc/apipost.md.ftl
...ld-manager/src/main/resources/template/doc/apipost.md.ftl
+2776
-0
appbuild-manager/src/main/resources/template/java/entity.java.ftl
...-manager/src/main/resources/template/java/entity.java.ftl
+11
-0
appbuild-manager/src/main/resources/template/java/httpclient.test.ftl
...ager/src/main/resources/template/java/httpclient.test.ftl
+0
-3
appbuild-manager/src/main/resources/template/java/vo.java.ftl
...uild-manager/src/main/resources/template/java/vo.java.ftl
+0
-24
No files found.
appbuild-manage-ui/admin/src/components/SearchForm.vue
View file @
bf933e77
...
...
@@ -202,7 +202,6 @@
import
Qs
from
"
qs
"
;
import
{
type
,
download
,
downloadWithCustName
,
getUserListByQuery
,
}
from
"
@/assets/utils
"
;
...
...
@@ -358,6 +357,7 @@ export default {
path
:
path
,
query
:
Object
.
assign
({},
query
,
data
),
});
},
// 解析url字符串,去除query字段
encode
(
data
,
formTemp
)
{
...
...
appbuild-manage-ui/admin/src/views/system/gentable/list.vue
View file @
bf933e77
...
...
@@ -257,7 +257,6 @@ export default {
mixins
:
[
table
],
created
()
{
const
appId
=
this
.
$route
.
query
[
"
query.appId
"
];
console
.
log
(
"
appId
"
,
appId
);
this
.
appId
=
appId
;
this
.
upload
.
url
=
this
.
upload
.
url
+
this
.
appId
//this.query={ appId: appId }
...
...
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/model/GentableEntityExt.java
View file @
bf933e77
...
...
@@ -29,7 +29,13 @@ public class GentableEntityExt extends BaseEntityLong {
private
String
requestMapping
;
private
String
code
;
private
String
name
;
private
String
desc
;
/**
* 项目应用访问path
*/
private
String
path
;
private
List
<
Long
>
idList
;
...
...
@@ -42,8 +48,8 @@ public class GentableEntityExt extends BaseEntityLong {
public
static
boolean
isSuperColumn
(
String
javaField
)
{
return
StringUtils
.
equalsAnyIgnoreCase
(
javaField
,
// BaseEntity
"id"
,
"createUser"
,
"createTime"
,
"updateUser"
,
"updateTime"
,
"createUserId"
,
"updateUserId"
"id"
,
"createUser"
,
"createTime"
,
"updateUser"
,
"updateTime"
,
"createUserId"
,
"updateUserId"
// TreeEntity
//"parentName", "parentId", "orderNum", "ancestors"
...
...
@@ -51,5 +57,4 @@ public class GentableEntityExt extends BaseEntityLong {
}
}
\ No newline at end of file
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java
View file @
bf933e77
...
...
@@ -31,6 +31,7 @@ import com.mortals.xhx.module.app.service.AppService;
import
freemarker.template.Template
;
import
lombok.SneakyThrows
;
import
org.apache.commons.io.IOUtils
;
import
org.apiguardian.api.API
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.stereotype.Service
;
...
...
@@ -42,6 +43,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.StringWriter
;
import
java.util.*
;
import
java.util.List
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.zip.ZipEntry
;
...
...
@@ -170,7 +172,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
}
if
(
gentableEntity
.
getIsShowControl
()
!=
null
)
{
if
(
gentableEntity
.
getIsShowControl
()
==
2
)
{
if
(
temp
.
contains
(
"webForm.java.ftl"
)
||
temp
.
contains
(
"web.java.ftl"
))
{
if
(
temp
.
contains
(
"webForm.java.ftl"
)
||
temp
.
contains
(
"web.java.ftl"
))
{
continue
;
}
// if (temp.contains("entity.java.ftl")||temp.contains("entityQuery.java.ftl")) {
...
...
@@ -182,7 +184,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
}
}
}
else
{
if
(
temp
.
contains
(
"webForm.java.ftl"
)
||
temp
.
contains
(
"web.java.ftl"
))
{
if
(
temp
.
contains
(
"webForm.java.ftl"
)
||
temp
.
contains
(
"web.java.ftl"
))
{
continue
;
}
}
...
...
@@ -213,7 +215,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"
))
{
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"
))
{
try
{
List
<
GentableEntity
>
tableList
=
new
ArrayList
<>();
tableList
.
add
(
gentableEntity
);
...
...
@@ -273,6 +275,8 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
zipTemplate
(
"dm_db.sql.ftl"
,
"db/dm_db.sql"
,
data
,
zip
);
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
"api.md.ftl"
));
zipTemplate
(
"api.md.ftl"
,
"doc/api.md"
,
data
,
zip
);
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
"apipost.md.ftl"
));
zipTemplate
(
"apipost.ftl"
,
"doc/apipost.json"
,
data
,
zip
);
IOUtils
.
closeQuietly
(
zip
);
return
outputStream
.
toByteArray
();
...
...
@@ -288,14 +292,22 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
GentableEntity
gentableEntity
=
generatorCode
(
tableId
,
genTypes
,
zip
);
tableList
.
add
(
gentableEntity
);
}
AppEntity
appEntity
=
new
AppEntity
();
appEntity
.
setName
(
tableList
.
get
(
0
).
getName
());
appEntity
.
setCode
(
tableList
.
get
(
0
).
getCode
());
appEntity
.
setPath
(
tableList
.
get
(
0
).
getPath
());
Map
data
=
new
HashMap
();
data
.
put
(
"tableList"
,
tableList
);
data
.
put
(
"appInfo"
,
appEntity
);
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
"menu.sql.ftl"
));
zipTemplate
(
"menu.sql.ftl"
,
"db/menu.sql"
,
data
,
zip
);
zipTemplate
(
"db.sql.ftl"
,
"db/db.sql"
,
data
,
zip
);
zipTemplate
(
"dm_db.sql.ftl"
,
"db/dm_db.sql"
,
data
,
zip
);
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
"api.md.ftl"
));
zipTemplate
(
"api.md.ftl"
,
"doc/api.md"
,
data
,
zip
);
zipTemplate
(
"apipost.md.ftl"
,
"doc/apipost.json"
,
data
,
zip
);
IOUtils
.
closeQuietly
(
zip
);
return
outputStream
.
toByteArray
();
}
...
...
@@ -522,7 +534,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
}
if
(
gentableEntity
.
getIsShowControl
()
!=
null
)
{
if
(
gentableEntity
.
getIsShowControl
()
==
2
)
{
if
(
temp
.
contains
(
"webForm.java.ftl"
)
||
temp
.
contains
(
"web.java.ftl"
))
{
if
(
temp
.
contains
(
"webForm.java.ftl"
)
||
temp
.
contains
(
"web.java.ftl"
))
{
continue
;
}
}
else
if
(
gentableEntity
.
getIsShowControl
()
==
0
)
{
...
...
@@ -531,7 +543,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
}
}
}
else
{
if
(
temp
.
contains
(
"webForm.java.ftl"
)
||
temp
.
contains
(
"web.java.ftl"
))
{
if
(
temp
.
contains
(
"webForm.java.ftl"
)
||
temp
.
contains
(
"web.java.ftl"
))
{
continue
;
}
}
...
...
@@ -573,6 +585,9 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
if
(
temp
.
equals
(
"api.md.ftl"
))
{
continue
;
}
if
(
temp
.
equals
(
"apipost.md.ftl"
))
{
continue
;
}
try
{
FreeMarkerUtils
.
initFreeMarker
(
genFreePath
(
temp
));
StringWriter
sw
=
new
StringWriter
();
...
...
@@ -594,10 +609,14 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
private
void
buildAppInfo
(
GentableEntity
gentableEntity
)
{
AppEntity
appEntity
=
appService
.
get
(
gentableEntity
.
getAppId
());
gentableEntity
.
setCode
(
appEntity
.
getCode
());
gentableEntity
.
setPath
(
appEntity
.
getPath
());
gentableEntity
.
setCode
(
appEntity
.
getCode
()
==
null
?
""
:
appEntity
.
getCode
());
gentableEntity
.
setPath
(
appEntity
.
getPath
()
==
null
?
""
:
appEntity
.
getPath
());
gentableEntity
.
setName
(
appEntity
.
getName
()
==
null
?
""
:
appEntity
.
getName
());
gentableEntity
.
setDesc
(
appEntity
.
getRemark
()
==
null
?
""
:
appEntity
.
getRemark
());
}
/**
* 生成文档
*/
...
...
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/web/GentableController.java
View file @
bf933e77
...
...
@@ -171,7 +171,6 @@ public class GentableController extends BaseCRUDJsonMappingController<GentableSe
Map
<
String
,
Object
>
model
=
new
HashMap
<>();
String
busiDesc
=
"生成单表代码"
;
try
{
byte
[]
bytes
=
this
.
service
.
downloadCode
(
tableId
,
genTypes
);
genCode
(
response
,
bytes
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
...
...
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/ApiPostBuild.java
0 → 100644
View file @
bf933e77
package
com.mortals.xhx.common.utils
;
public
class
ApiPostBuild
{
}
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/FreeMarkerUtils.java
View file @
bf933e77
...
...
@@ -8,6 +8,7 @@ import com.mortals.xhx.base.system.gentable.model.GentableColumnEntity;
import
com.mortals.xhx.base.system.gentable.model.GentableEntity
;
import
com.mortals.xhx.base.system.gentable.model.ProjectInfoEntity
;
import
com.mortals.xhx.common.key.GenConstants
;
import
com.mortals.xhx.module.app.model.AppEntity
;
import
freemarker.template.Configuration
;
import
freemarker.template.Template
;
import
freemarker.template.TemplateException
;
...
...
@@ -103,6 +104,7 @@ public class FreeMarkerUtils {
templates
.
add
(
"dm_db.sql.ftl"
);
templates
.
add
(
"menu.sql.ftl"
);
templates
.
add
(
"api.md.ftl"
);
templates
.
add
(
"apipost.md.ftl"
);
if
(
GenConstants
.
TPL_CRUD
.
equals
(
tplCategory
))
{
templates
.
add
(
"service.java.ftl"
);
...
...
@@ -187,10 +189,15 @@ public class FreeMarkerUtils {
data
.
put
(
"importList"
,
getImportList
(
genTable
));
data
.
put
(
"columns"
,
genTable
.
getColumns
());
data
.
put
(
"table"
,
genTable
);
data
.
put
(
"code"
,
genTable
.
getCode
()==
null
?
""
:
genTable
.
getCode
());
data
.
put
(
"path"
,
genTable
.
getPath
()==
null
?
""
:
genTable
.
getPath
());
//com.mortals.xhx.feign.area
data
.
put
(
"packageFeignName"
,
"com.mortals.xhx.feign."
+
businessName
);
data
.
put
(
"code"
,
genTable
.
getCode
()
==
null
?
""
:
genTable
.
getCode
());
data
.
put
(
"path"
,
genTable
.
getPath
()
==
null
?
""
:
genTable
.
getPath
());
data
.
put
(
"packageFeignName"
,
"com.mortals.xhx.feign."
+
businessName
);
AppEntity
appEntity
=
new
AppEntity
();
appEntity
.
setName
(
genTable
.
getName
());
appEntity
.
setPath
(
genTable
.
getPath
());
appEntity
.
setCode
(
genTable
.
getCode
());
data
.
put
(
"appInfo"
,
appEntity
);
String
RequestMapping
=
Arrays
.
stream
(
getBusinessNameExt
(
genTable
.
getTableName
()).
split
(
"\\."
)).
collect
(
Collectors
.
joining
(
"/"
));
data
.
put
(
"RequestMapping"
,
RequestMapping
);
...
...
@@ -244,13 +251,13 @@ public class FreeMarkerUtils {
String
treeParentCode
=
getTreeParentCode
(
paramsObj
);
//获取树编码父节点类型 todo
String
treeParentCodeType
=
"String"
;
String
treeParentCodeType
=
"String"
;
List
<
GentableColumnEntity
>
columns
=
genTable
.
getColumns
();
for
(
GentableColumnEntity
column
:
columns
)
{
if
(
treeParentCode
.
equals
(
column
.
getColumnName
()))
{
treeParentCodeType
=
column
.
getJavaType
();
if
(
treeParentCode
.
equals
(
column
.
getColumnName
()))
{
treeParentCodeType
=
column
.
getJavaType
();
break
;
}
}
...
...
@@ -463,19 +470,15 @@ public class FreeMarkerUtils {
String
businessNameExt
=
getBusinessNameExt
(
genTable
.
getTableName
());
businessNameExt
=
StringUtils
.
replace
(
businessNameExt
,
"."
,
"/"
);
fileName
=
StringUtils
.
format
(
"{}/views/{}/list.vue"
,
vuePath
,
businessNameExt
);
}
else
if
(
template
.
contains
(
"webVueShow.vue.ftl"
))
{
}
else
if
(
template
.
contains
(
"webVueShow.vue.ftl"
))
{
String
businessNameExt
=
getBusinessNameExt
(
genTable
.
getTableName
());
businessNameExt
=
StringUtils
.
replace
(
businessNameExt
,
"."
,
"/"
);
fileName
=
StringUtils
.
format
(
"{}/views/{}/show.vue"
,
vuePath
,
businessNameExt
);
}
else
if
(
template
.
contains
(
"webVueView.vue.ftl"
))
{
}
else
if
(
template
.
contains
(
"webVueView.vue.ftl"
))
{
String
businessNameExt
=
getBusinessNameExt
(
genTable
.
getTableName
());
businessNameExt
=
StringUtils
.
replace
(
businessNameExt
,
"."
,
"/"
);
fileName
=
StringUtils
.
format
(
"{}/views/{}/view.vue"
,
vuePath
,
businessNameExt
);
}
else
if
(
template
.
contains
(
"webVueTreeList.vue.ftl"
))
{
}
else
if
(
template
.
contains
(
"webVueTreeList.vue.ftl"
))
{
String
businessNameExt
=
getBusinessNameExt
(
genTable
.
getTableName
());
businessNameExt
=
StringUtils
.
replace
(
businessNameExt
,
"."
,
"/"
);
fileName
=
StringUtils
.
format
(
"{}/views/{}/list.vue"
,
vuePath
,
businessNameExt
);
...
...
@@ -491,8 +494,7 @@ public class FreeMarkerUtils {
String
businessNameExt
=
getBusinessNameExt
(
genTable
.
getTableName
());
businessNameExt
=
StringUtils
.
replace
(
businessNameExt
,
"."
,
"/"
);
fileName
=
StringUtils
.
format
(
"{}/views/{}/drawershow.vue"
,
vuePath
,
businessNameExt
);
}
else
if
(
template
.
contains
(
"db.doc.ftl"
))
{
}
else
if
(
template
.
contains
(
"db.doc.ftl"
))
{
fileName
=
StringUtils
.
format
(
"doc/alldoc.docx"
);
}
else
if
(
template
.
contains
(
"api.doc.ftl"
))
{
fileName
=
StringUtils
.
format
(
"doc/api.md"
);
...
...
@@ -545,7 +547,6 @@ public class FreeMarkerUtils {
* @param destFile 目标文件地址
*/
public
static
String
printFile
(
String
templateName
,
Map
dataModel
,
String
destFile
)
{
System
.
out
.
println
(
destFile
);
Template
template
=
getTemplate
(
templateName
);
try
{
template
.
process
(
dataModel
,
new
FileWriter
(
new
File
(
destFile
)));
...
...
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/GenUtils.java
View file @
bf933e77
...
...
@@ -263,10 +263,7 @@ public class GenUtils {
if
(
tableName
.
indexOf
(
"_"
)
!=
-
1
)
{
businessName
=
StringUtils
.
substring
(
tableName
,
0
,
tableName
.
indexOf
(
"_"
));
}
//业务名称 保留两位
return
businessName
;
}
...
...
@@ -369,10 +366,7 @@ public class GenUtils {
public
static
void
main
(
String
[]
args
)
{
String
name
=
"aaa"
;
System
.
out
.
println
(
Arrays
.
stream
(
name
.
split
(
"_"
)).
collect
(
Collectors
.
joining
(
"."
)));
System
.
out
.
println
(
Arrays
.
stream
(
"data"
.
split
(
"."
)).
collect
(
Collectors
.
joining
(
"/"
)));
}
}
appbuild-manager/src/main/resources/template/doc/api.md.ftl
View file @
bf933e77
...
...
@@ -15,6 +15,7 @@ object|对象类型|{"name":"zhang3"}
arrays|数组类型|[{"name":"zhang3"},{"name":"zhang2"}]
<#if (tableList?size > 1) >
## 系统服务
### 登录
...
...
@@ -212,12 +213,14 @@ Content-Type: multipart/form-data
```
</#if>
<#list tableList as table>
## ${table.functionName}
### 查询${table.functionName}列表
**请求URL:** ${table.requestMapping}/list
**请求URL:** ${table.
path}/${table.
requestMapping}/list
**请求方式:** POST
...
...
@@ -243,7 +246,7 @@ ${column.javaField}|${column.javaType}|否|${column.columnComment}
**请求样例:**
```
{
{
<#list table.columns as column>
<#if column.isQuery == 1>
<#if column.javaType=="String" ||column.javaType=="Date">
...
...
@@ -256,7 +259,7 @@ ${column.javaField}|${column.javaType}|否|${column.columnComment}
</#list>
"page":1,
"size":10
}
}
```
**响应参数:**
...
...
@@ -292,7 +295,7 @@ dict|object|字典对象
### 查看${table.functionName}
**请求URL:** ${table.requestMapping}/info
**请求URL:** ${table.
path}/${table.
requestMapping}/info
**请求方式:** GET
...
...
@@ -308,7 +311,7 @@ ${table.pkColumn.javaField}|${table.pkColumn.javaType}|是|ID
**请求样例:**
```
http://localhost
/${table.requestMapping}/info?id=549
http://localhost/${table.path}
/${table.requestMapping}/info?id=549
```
**响应参数:**
...
...
@@ -346,7 +349,7 @@ dict|object|字典对象
### 保存更新${table.functionName}
**请求URL:** ${table.requestMapping}/save
**请求URL:** ${table.
path}/${table.
requestMapping}/save
**请求方式:** POST
...
...
@@ -410,7 +413,7 @@ data|object|数据对象
### 删除${table.functionName}
**请求URL:** ${table.requestMapping}/delete
**请求URL:** ${table.
path}/${table.
requestMapping}/delete
**请求方式:** GET
...
...
@@ -426,7 +429,7 @@ ${table.pkColumn.javaField}|String|是|数组
**请求样例:**
```
http://localhost:8080
/${table.requestMapping}/delete?id=1&id=2'
http://localhost:8080/${table.path}
/${table.requestMapping}/delete?id=1&id=2'
```
**响应参数:**
...
...
@@ -447,7 +450,7 @@ msg|String|消息|-
### 导入${table.functionName}模板下载
**请求URL:** ${table.requestMapping}/downloadTemplate
**请求URL:** ${table.
path}/${table.
requestMapping}/downloadTemplate
**请求方式:** POST
...
...
@@ -457,7 +460,7 @@ msg|String|消息|-
**请求样例:**
```
http://localhost
/${table.requestMapping}/downloadTemplate
http://localhost/${table.path}
/${table.requestMapping}/downloadTemplate
```
**Response-example:**
...
...
@@ -468,7 +471,7 @@ msg|String|消息|-
### 导入${table.functionName}
**请求URL:** ${table.requestMapping}/importData
**请求URL:** ${table.
path}/${table.
requestMapping}/importData
**请求方式:** POST
...
...
@@ -484,7 +487,7 @@ file|file|是|文件流
**请求样例:**
```
http://localhost
/${table.requestMapping}/importData --data 'updateSupport=true'
http://localhost/${table.path}
/${table.requestMapping}/importData --data 'updateSupport=true'
```
...
...
@@ -496,7 +499,7 @@ file|file|是|文件流
### 导出${table.functionName}
**请求URL:** ${table.requestMapping}/exportExcel
**请求URL:** ${table.
path}/${table.
requestMapping}/exportExcel
**请求方式:** POST
...
...
appbuild-manager/src/main/resources/template/doc/apipost.md.ftl
0 → 100644
View file @
bf933e77
This source diff could not be displayed because it is too large. You can
view the blob
instead.
appbuild-manager/src/main/resources/template/java/entity.java.ftl
View file @
bf933e77
...
...
@@ -58,6 +58,17 @@ public class ${ClassName}Entity extends ${ClassName}Vo {
/**
*
${
column
.
columnComment
}
*/
<#
if
column
.
isExport
==
1
>
<#
assign
comment
=
column
.
subComment
(
column
.
columnComment
)
/>
<#
assign
parentheseIndex
=
column
.
columnComment
?
index_of
(
"("
)>
<#
if
parentheseIndex
!= -1>
@
Excel
(
name
=
"${comment}"
,
readConverterExp
=
"${column.readConverterExp()}"
)
<#
elseif
column
.
javaType
==
"Date"
>
@
Excel
(
name
=
"${comment}"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
<#
else
>
@
Excel
(
name
=
"${comment}"
)
</#
if
>
</#
if
>
<#
if
column
.
isSerialize
==
1
>
@
JSONField
(
serialize
=
false
)
</#
if
>
...
...
appbuild-manager/src/main/resources/template/java/httpclient.test.ftl
View file @
bf933e77
...
...
@@ -15,7 +15,6 @@ client.global.set("authToken", JSON.parse(response.body).data.token);
###${functionName}列表
POST {{baseUrl}}/${RequestMapping}/list
Authorization: {{authToken}}
Content-Type: application/json
{
...
...
@@ -58,12 +57,10 @@ client.global.set("${ClassName}_id", JSON.parse(response.body).data.id);
###${functionName}查看
GET {{baseUrl}}/${RequestMapping}/info?id={{${ClassName}_id}}
Authorization: {{authToken}}
Accept: application/json
###${functionName}编辑
GET {{baseUrl}}/${RequestMapping}/edit?id={{${ClassName}_id}}
Authorization: {{authToken}}
Accept: application/json
...
...
appbuild-manager/src/main/resources/template/java/vo.java.ftl
View file @
bf933e77
...
...
@@ -41,30 +41,6 @@ import java.util.Date;
@
Data
public
class
${
ClassName
}
Vo
extends
${
Entity
}
{
<#
list
columns
as
column
>
<#
if
!column.isSuperColumn(column.javaField) && column.isExport==1>
/**
*
${
column
.
columnComment
}
*/
<#
if
column
.
isExport
==
1
>
<#
assign
comment
=
column
.
subComment
(
column
.
columnComment
)
/>
<#
assign
parentheseIndex
=
column
.
columnComment
?
index_of
(
"("
)>
<#
if
parentheseIndex
!= -1>
@
Excel
(
name
=
"${comment}"
,
readConverterExp
=
"${column.readConverterExp()}"
)
<#
elseif
column
.
javaType
==
"Date"
>
@
Excel
(
name
=
"${comment}"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
<#
else
>
@
Excel
(
name
=
"${comment}"
)
</#
if
>
</#
if
>
<#
if
column
.
isSerialize
==
1
>
@
JSONField
(
serialize
=
false
)
</#
if
>
private
${
column
.
javaType
}
${
column
.
javaField
};
</#
if
>
</#
list
>
<#
if
table
.
tplCategory
==
"tree"
>
/**
子
${
functionName
}
*/
private
List
<${
ClassName
}
Entity
>
children
=
new
ArrayList
<>();
...
...
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