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
2a062e0b
Commit
2a062e0b
authored
Sep 08, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加apipost生成接口文档逻辑
parent
da9c3b16
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
202 deletions
+52
-202
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/model/GentableColumnEntityExt.java
...x/base/system/gentable/model/GentableColumnEntityExt.java
+40
-7
appbuild-manager/src/main/java/com/mortals/xhx/common/code/OneThingRespCodeEnum.java
...ava/com/mortals/xhx/common/code/OneThingRespCodeEnum.java
+0
-29
appbuild-manager/src/main/java/com/mortals/xhx/common/code/OneThingStatusEnum.java
.../java/com/mortals/xhx/common/code/OneThingStatusEnum.java
+0
-64
appbuild-manager/src/main/java/com/mortals/xhx/common/code/OneThingTypeEnum.java
...in/java/com/mortals/xhx/common/code/OneThingTypeEnum.java
+0
-75
appbuild-manager/src/main/resources/template/java/entity.java.ftl
...-manager/src/main/resources/template/java/entity.java.ftl
+4
-27
appbuild-manager/src/main/resources/template/java/vo.java.ftl
...uild-manager/src/main/resources/template/java/vo.java.ftl
+4
-0
appbuild-manager/src/main/resources/template/vue/webVueList.vue.ftl
...anager/src/main/resources/template/vue/webVueList.vue.ftl
+4
-0
No files found.
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/model/GentableColumnEntityExt.java
View file @
2a062e0b
...
@@ -10,6 +10,7 @@ import com.mortals.xhx.common.utils.StringUtils;
...
@@ -10,6 +10,7 @@ import com.mortals.xhx.common.utils.StringUtils;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Locale
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -45,9 +46,9 @@ public class GentableColumnEntityExt extends BaseEntityLong {
...
@@ -45,9 +46,9 @@ public class GentableColumnEntityExt extends BaseEntityLong {
String
returnStr
=
""
;
String
returnStr
=
""
;
if
(!
ObjectUtils
.
isEmpty
(
column
.
getDefaultValue
()))
{
if
(!
ObjectUtils
.
isEmpty
(
column
.
getDefaultValue
()))
{
returnStr
=
column
.
getDefaultValue
();
returnStr
=
column
.
getDefaultValue
();
}
else
{
}
else
{
if
(
"String"
.
equalsIgnoreCase
(
column
.
getJavaType
()))
{
if
(
"String"
.
equalsIgnoreCase
(
column
.
getJavaType
()))
{
returnStr
=
RandomUtil
.
randomString
(
6
);
returnStr
=
RandomUtil
.
randomString
(
6
);
}
else
if
(
"Integer"
.
equalsIgnoreCase
(
column
.
getJavaType
())
||
"Long"
.
equalsIgnoreCase
(
column
.
getJavaType
()))
{
}
else
if
(
"Integer"
.
equalsIgnoreCase
(
column
.
getJavaType
())
||
"Long"
.
equalsIgnoreCase
(
column
.
getJavaType
()))
{
...
@@ -55,7 +56,7 @@ public class GentableColumnEntityExt extends BaseEntityLong {
...
@@ -55,7 +56,7 @@ public class GentableColumnEntityExt extends BaseEntityLong {
}
else
if
(
"BigDecimal"
.
equalsIgnoreCase
(
column
.
getJavaType
()))
{
}
else
if
(
"BigDecimal"
.
equalsIgnoreCase
(
column
.
getJavaType
()))
{
returnStr
=
RandomUtil
.
randomBigDecimal
().
setScale
(
2
,
1
).
doubleValue
()
+
""
;
returnStr
=
RandomUtil
.
randomBigDecimal
().
setScale
(
2
,
1
).
doubleValue
()
+
""
;
}
else
if
(
"date"
.
equalsIgnoreCase
(
column
.
getJavaType
()))
{
}
else
if
(
"date"
.
equalsIgnoreCase
(
column
.
getJavaType
()))
{
returnStr
=
DateUtils
.
getCurrDate
().
getTime
()
+
""
;
returnStr
=
DateUtils
.
getCurrDate
().
getTime
()
+
""
;
}
}
}
}
...
@@ -80,13 +81,45 @@ public class GentableColumnEntityExt extends BaseEntityLong {
...
@@ -80,13 +81,45 @@ public class GentableColumnEntityExt extends BaseEntityLong {
}
}
public
static
String
isKeyWord
(
String
columnName
)
{
public
static
String
isKeyWord
(
String
columnName
)
{
if
(
KEYWORDS_SET
.
contains
(
columnName
))
{
if
(
KEYWORDS_SET
.
contains
(
columnName
))
{
return
"`"
+
columnName
+
'`'
;
return
"`"
+
columnName
+
'`'
;
}
}
return
columnName
;
return
columnName
;
}
}
public
static
String
defaultFormatValue
(
String
javaType
,
String
columnName
,
String
defaultValue
)
{
if
(
"Long"
.
equals
(
javaType
))
{
if
(
ObjectUtils
.
isEmpty
(
defaultValue
))
{
defaultValue
=
"0L"
;
}
}
else
if
(
"Integer"
.
equals
(
javaType
))
{
if
(
"year"
.
equals
(
columnName
))
{
defaultValue
=
"DateUtil.year(new Date())"
;
}
else
if
(
"month"
.
equals
(
columnName
))
{
defaultValue
=
"DateUtil.month(new Date())+1"
;
}
else
if
(
"day"
.
equals
(
columnName
))
{
defaultValue
=
"DateUtil.dayOfMonth(new Date())"
;
}
if
(
ObjectUtils
.
isEmpty
(
defaultValue
))
{
defaultValue
=
"0"
;
}
}
else
if
(
"String"
.
equals
(
javaType
))
{
if
(
ObjectUtils
.
isEmpty
(
defaultValue
))
{
defaultValue
=
"\"\""
;
}
}
else
if
(
"BigDecimal"
.
equals
(
javaType
))
{
defaultValue
=
"BigDecimal.ZERO"
;
}
else
if
(
"Date"
.
equals
(
javaType
))
{
defaultValue
=
"new Date()"
;
}
else
{
defaultValue
=
"null"
;
}
return
defaultValue
;
}
public
static
String
randomNumber
()
{
public
static
String
randomNumber
()
{
Faker
faker
=
new
Faker
(
Locale
.
CHINESE
);
Faker
faker
=
new
Faker
(
Locale
.
CHINESE
);
...
...
appbuild-manager/src/main/java/com/mortals/xhx/common/code/OneThingRespCodeEnum.java
deleted
100644 → 0
View file @
da9c3b16
package
com.mortals.xhx.common.code
;
/**
* @author karlhoo
*/
public
enum
OneThingRespCodeEnum
{
/** 接收成功 */
SUCCESS
(
200
,
"成功"
),
/** 执行失败 */
FAILED
(
400
,
"执行失败"
),
;
private
final
Integer
value
;
private
final
String
label
;
OneThingRespCodeEnum
(
Integer
value
,
String
label
)
{
this
.
value
=
value
;
this
.
label
=
label
;
}
public
int
getValue
()
{
return
this
.
value
;
}
public
String
getLabel
()
{
return
this
.
label
;
}
}
appbuild-manager/src/main/java/com/mortals/xhx/common/code/OneThingStatusEnum.java
deleted
100644 → 0
View file @
da9c3b16
package
com.mortals.xhx.common.code
;
import
com.mortals.framework.common.IBaseEnum
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
public
enum
OneThingStatusEnum
implements
IBaseEnum
{
BOM_EDIT
(
401
,
"修订中"
),
BOM_AUDIT
(
402
,
"审核中"
),
BOM_PUBLISH
(
403
,
"已发布"
);
private
int
value
;
private
String
desc
;
OneThingStatusEnum
(
int
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
@Override
public
int
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
desc
;
}
public
static
OneThingStatusEnum
getByValue
(
int
value
)
{
for
(
OneThingStatusEnum
YesNoEnum
:
OneThingStatusEnum
.
values
())
{
if
(
YesNoEnum
.
getValue
()
==
value
)
{
return
YesNoEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
int
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<
String
,
String
>();
for
(
OneThingStatusEnum
item
:
OneThingStatusEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
int
e
:
eItem
){
if
(
item
.
getValue
()==
e
){
hasE
=
true
;
break
;
}
}
if
(!
hasE
){
resultMap
.
put
(
item
.
getValue
()+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
){
}
}
return
resultMap
;
}
}
appbuild-manager/src/main/java/com/mortals/xhx/common/code/OneThingTypeEnum.java
deleted
100644 → 0
View file @
da9c3b16
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* @author: finegirl
* @date: 2021/7/16 11:50
* @description: //TODO 请完善注释信息
**/
public
enum
OneThingTypeEnum
{
UNSUBMIT
(
1
,
"资料上传"
),
SUBMIT
(
2
,
"确认提交"
);
private
int
value
;
private
String
desc
;
private
OneThingTypeEnum
(
int
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
int
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
OneThingTypeEnum
getByValue
(
int
value
)
{
OneThingTypeEnum
[]
var1
=
values
();
int
var2
=
var1
.
length
;
for
(
int
var3
=
0
;
var3
<
var2
;
++
var3
)
{
OneThingTypeEnum
examStatus
=
var1
[
var3
];
if
(
examStatus
.
getValue
()
==
value
)
{
return
examStatus
;
}
}
return
null
;
}
public
static
Map
<
String
,
String
>
getEnumMap
(
int
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
();
OneThingTypeEnum
[]
var2
=
values
();
int
var3
=
var2
.
length
;
for
(
int
var4
=
0
;
var4
<
var3
;
++
var4
)
{
OneThingTypeEnum
item
=
var2
[
var4
];
try
{
boolean
hasE
=
false
;
int
[]
var7
=
eItem
;
int
var8
=
eItem
.
length
;
for
(
int
var9
=
0
;
var9
<
var8
;
++
var9
)
{
int
e
=
var7
[
var9
];
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
var11
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
appbuild-manager/src/main/resources/template/java/entity.java.ftl
View file @
2a062e0b
...
@@ -35,6 +35,9 @@ import com.alibaba.fastjson.annotation.JSONField;
...
@@ -35,6 +35,9 @@ import com.alibaba.fastjson.annotation.JSONField;
</#
list
>
</#
list
>
import
java
.
util
.
List
;
import
java
.
util
.
List
;
import
java
.
util
.
ArrayList
;
import
java
.
util
.
ArrayList
;
import
java
.
math
.
BigDecimal
;
import
cn
.
hutool
.
core
.
date
.
DateUtil
;
import
java
.
util
.
Date
;
import
com
.
fasterxml
.
jackson
.
annotation
.
JsonFormat
;
import
com
.
fasterxml
.
jackson
.
annotation
.
JsonFormat
;
import
com
.
mortals
.
framework
.
annotation
.
Excel
;
import
com
.
mortals
.
framework
.
annotation
.
Excel
;
import
com
.
mortals
.
framework
.
model
.${
Entity
};
import
com
.
mortals
.
framework
.
model
.${
Entity
};
...
@@ -124,33 +127,7 @@ public class ${ClassName}Entity extends ${ClassName}Vo {
...
@@ -124,33 +127,7 @@ public class ${ClassName}Entity extends ${ClassName}Vo {
public
void
initAttrValue
(){
public
void
initAttrValue
(){
<#
list
columns
as
column
>
<#
list
columns
as
column
>
<#
if
!column.isSuperColumn(column.javaField)>
<#
if
!column.isSuperColumn(column.javaField)>
this
.${
column
.
javaField
}
=
${
column
.
defaultFormatValue
(
column
.
javaType
,
column
.
javaField
,
column
.
defaultValue
)};
<#
if
column
.
javaType
==
"Long"
&&
column
.
defaultValue
??&&
column
.
defaultValue
!="">
<#
assign
Default
>${
column
.
defaultValue
}
L
</#
assign
>
<#
elseif
column
.
javaType
==
"Integer"
&&
column
.
defaultValue
??
&&
column
.
defaultValue
!="">
<#
assign
Default
>${
column
.
defaultValue
}</#
assign
>
<#
elseif
column
.
javaType
==
"String"
&&
column
.
defaultValue
??>
<#
assign
Default
>
"${column.defaultValue}"
</#
assign
>
<#
elseif
column
.
javaType
==
"BigDecimal"
&&
column
.
defaultValue
??&&
column
.
defaultValue
!="">
<#
assign
Default
>
BigDecimal
.
valueOf
(${
column
.
defaultValue
})</#
assign
>
<#
elseif
column
.
javaType
==
"Date"
>
<#
assign
Default
>
null
</#
assign
>
<#
else
>
<#
if
column
.
javaType
==
"Long"
>
<#
assign
Default
>-
1L
</#
assign
>
<#
elseif
column
.
javaType
==
"Integer"
>
<#
assign
Default
>-
1
</#
assign
>
<#
elseif
column
.
javaType
==
"String"
>
<#
assign
Default
>
""
</#
assign
>
<#
elseif
column
.
javaType
==
"BigDecimal"
>
<#
assign
Default
>
new
BigDecimal
(
0
)</#
assign
>
<#
elseif
column
.
javaType
==
"Date"
>
<#
assign
Default
>
new
Date
()</#
assign
>
<#
else
>
<#
assign
Default
>
null
</#
assign
>
</#
if
>
</#
if
>
this
.${
column
.
javaField
}
=
${
Default
};
</#
if
>
</#
if
>
</#
list
>
</#
list
>
}
}
...
...
appbuild-manager/src/main/resources/template/java/vo.java.ftl
View file @
2a062e0b
...
@@ -41,6 +41,10 @@ import java.util.Date;
...
@@ -41,6 +41,10 @@ import java.util.Date;
@
Data
@
Data
public
class
${
ClassName
}
Vo
extends
${
Entity
}
{
public
class
${
ClassName
}
Vo
extends
${
Entity
}
{
/**
${
pkColumn
.
columnComment
}
列表
*/
private
List
<${
pkColumn
.
javaType
}>
${
pkColumn
.
javaField
}
List
;
<#
if
table
.
tplCategory
==
"tree"
>
<#
if
table
.
tplCategory
==
"tree"
>
/**
子
${
functionName
}
*/
/**
子
${
functionName
}
*/
private
List
<${
ClassName
}
Entity
>
children
=
new
ArrayList
<>();
private
List
<${
ClassName
}
Entity
>
children
=
new
ArrayList
<>();
...
...
appbuild-manager/src/main/resources/template/vue/webVueList.vue.ftl
View file @
2a062e0b
...
@@ -132,6 +132,10 @@
...
@@ -132,6 +132,10 @@
},
},
/** 导出Excel */
/** 导出Excel */
doExport() {
doExport() {
if(this.isExport) {
this.$message.info("数据正在导出中,请勿重复点击!")
return false;
}
this.isExport = true;
this.isExport = true;
this.$download("/${RequestMapping}/exportExcel", {
this.$download("/${RequestMapping}/exportExcel", {
"idList": this.selection,
"idList": this.selection,
...
...
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