Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
5ce9da30
Commit
5ce9da30
authored
Mar 20, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
eb93b272
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
14 deletions
+7
-14
MvcConfiguration.java
...a/cn/wisenergy/chnmuseum/party/conf/MvcConfiguration.java
+3
-5
controller.java.vm
src/main/resources/templates/controller.java.vm
+4
-9
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/conf/MvcConfiguration.java
View file @
5ce9da30
...
...
@@ -5,7 +5,6 @@ import cn.wisenergy.chnmuseum.party.common.util.MyLocalDateTimeSerializer;
import
com.alibaba.fastjson.PropertyNamingStrategy
;
import
com.alibaba.fastjson.serializer.SerializeConfig
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.alibaba.fastjson.serializer.ToStringSerializer
;
import
com.alibaba.fastjson.support.config.FastJsonConfig
;
import
com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -18,7 +17,6 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
;
import
java.math.BigInteger
;
import
java.nio.charset.StandardCharsets
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
...
...
@@ -79,9 +77,9 @@ public class MvcConfiguration extends WebMvcConfigurationSupport {
// 设置数字转化问题
SerializeConfig
serializeConfig
=
SerializeConfig
.
globalInstance
;
serializeConfig
.
put
(
BigInteger
.
class
,
ToStringSerializer
.
instance
);
serializeConfig
.
put
(
Long
.
class
,
ToStringSerializer
.
instance
);
serializeConfig
.
put
(
Long
.
TYPE
,
ToStringSerializer
.
instance
);
//
serializeConfig.put(BigInteger.class, ToStringSerializer.instance);
//
serializeConfig.put(Long.class, ToStringSerializer.instance);
//
serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
serializeConfig
.
setPropertyNamingStrategy
(
PropertyNamingStrategy
.
CamelCase
);
serializeConfig
.
put
(
LocalDateTime
.
class
,
new
MyLocalDateTimeSerializer
(
"yyyy-MM-dd"
));
serializeConfig
.
put
(
LocalDate
.
class
,
new
MyLocalDateSerializer
(
"yyyy-MM-dd"
));
...
...
src/main/resources/templates/controller.java.vm
View file @
5ce9da30
...
...
@@ -65,7 +65,7 @@ public class ${table.controllerName} {
@
RequiresPermissions
(
"$!{cfg.colonTableName}:batch:save"
)
#
end
@
ApiOperation
(
value
=
"批量添加$!{table.comment}"
,
notes
=
"批量添加$!{table.comment}"
)
public
Map
<
String
,
Object
>
batchSave
${
entity
}(#
if
(${
cfg
.
paramValidation
})@
Validated
(
value
=
{
Add
.
class
})#
end
List
<${
entity
}>
${
table
.
entityPath
}
List
)
{
public
Map
<
String
,
Object
>
batchSave
${
entity
}(
@
RequestBody
#
if
(${
cfg
.
paramValidation
})@
Validated
(
value
=
{
Add
.
class
})#
end
List
<${
entity
}>
${
table
.
entityPath
}
List
)
{
//
保存业务节点信息
boolean
result
=
${
table
.
entityPath
}
Service
.
saveBatch
(${
table
.
entityPath
}
List
);
//
返回操作结果
...
...
@@ -82,7 +82,7 @@ public class ${table.controllerName} {
@
RequiresPermissions
(
"$!{cfg.colonTableName}:save"
)
#
end
@
ApiOperation
(
value
=
"添加$!{table.comment}"
,
notes
=
"添加$!{table.comment}"
)
public
Map
<
String
,
Object
>
save
${
entity
}(#
if
(${
cfg
.
paramValidation
})@
Validated
(
value
=
{
Add
.
class
})#
end
${
entity
}
${
table
.
entityPath
})
{
public
Map
<
String
,
Object
>
save
${
entity
}(
@
RequestBody
#
if
(${
cfg
.
paramValidation
})@
Validated
(
value
=
{
Add
.
class
})#
end
${
entity
}
${
table
.
entityPath
})
{
//
保存业务节点信息
boolean
result
=
${
table
.
entityPath
}
Service
.
save
(${
table
.
entityPath
});
//
返回操作结果
...
...
@@ -99,7 +99,7 @@ public class ${table.controllerName} {
@
RequiresPermissions
(
"$!{cfg.colonTableName}:update"
)
#
end
@
ApiOperation
(
value
=
"修改$!{table.comment}信息"
,
notes
=
"修改$!{table.comment}信息"
)
public
Map
<
String
,
Object
>
update
${
entity
}(#
if
(${
cfg
.
paramValidation
})@
Validated
(
value
=
{
Update
.
class
})#
end
${
entity
}
${
cfg
.
entityObjectName
})
{
public
Map
<
String
,
Object
>
update
${
entity
}(
@
RequestBody
#
if
(${
cfg
.
paramValidation
})@
Validated
(
value
=
{
Update
.
class
})#
end
${
entity
}
${
cfg
.
entityObjectName
})
{
#
if
(${
cfg
.
generatorStrategy
}
==
'ALL'
)
boolean
flag
=
${
table
.
entityPath
}
Service
.
update
${
entity
}(${
cfg
.
entityObjectName
});
#
else
...
...
@@ -153,7 +153,7 @@ public class ${table.controllerName} {
@
ApiImplicitParams
(
value
=
{
@
ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
get
${
entity
}
List
(@
RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
public
Map
<
String
,
Object
>
get
${
entity
}
List
(@
RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED
_FINAL
"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
List
<${
entity
}>
${
table
.
entityPath
}
List
=
${
table
.
entityPath
}
Service
.
list
(
Wrappers
.<${
entity
}>
lambdaQuery
().
eq
(${
entity
}::
getAuditStatus
,
auditStatus
.
name
()));
return
getResult
(${
table
.
entityPath
}
List
);
}
...
...
@@ -162,7 +162,6 @@ public class ${table.controllerName} {
@
ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@
ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@
ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
@
ApiImplicitParam
(
name
=
"copyrightOwner"
,
value
=
"版权方"
,
paramType
=
"query"
,
dataType
=
"String"
),
@
ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@
ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
...
...
@@ -177,10 +176,6 @@ public class ${table.controllerName} {
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(${
entity
}::
getName
,
genericPageParam
.
getNameOrCode
());
}
//
对版权方模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getCopyrightOwnerId
()))
{
queryWrapper
.
like
(${
entity
}::
getAssetCopyrightOwnerId
,
genericPageParam
.
getCopyrightOwnerId
());
}
//
根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!= null && genericPageParam.getEndDate() != null) {
queryWrapper
.
ge
(${
entity
}::
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
...
...
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