Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
92a45904
提交
92a45904
编写于
8月 06, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支持表格不分页
上级
213321de
变更
4
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
24 行增加
和
3 行删除
+24
-3
%APP%Application.java.ftl
...ava/%SYS_PKGPATH%/%APP_PKGPATH%/%APP%Application.java.ftl
+5
-1
DevBootApplication.java.ftl
...t/src/main/java/%SYS_PKGPATH%/DevBootApplication.java.ftl
+5
-1
%SYS%%API%Application.java.ftl
..._PKGPATH%/%SYSAPI_PKGPATH%/%SYS%%API%Application.java.ftl
+5
-1
SearchContextHandlerMethodArgumentResolver.java.ftl
...l/web/SearchContextHandlerMethodArgumentResolver.java.ftl
+9
-0
未找到文件。
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/java/%SYS_PKGPATH%/%APP_PKGPATH%/%APP%Application.java.ftl
浏览文件 @
92a45904
...
@@ -23,6 +23,7 @@ import org.mybatis.spring.annotation.MapperScan;
...
@@ -23,6 +23,7 @@ import org.mybatis.spring.annotation.MapperScan;
import
org
.
springframework
.
boot
.
SpringApplication
;
import
org
.
springframework
.
boot
.
SpringApplication
;
import
org
.
springframework
.
web
.
method
.
support
.
HandlerMethodArgumentResolver
;
import
org
.
springframework
.
web
.
method
.
support
.
HandlerMethodArgumentResolver
;
import
org
.
springframework
.
web
.
servlet
.
config
.
annotation
.
WebMvcConfigurerAdapter
;
import
org
.
springframework
.
web
.
servlet
.
config
.
annotation
.
WebMvcConfigurerAdapter
;
import
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
;
import
java
.
util
.
List
;
import
java
.
util
.
List
;
@
Slf4j
@
Slf4j
...
@@ -55,6 +56,9 @@ import java.util.List;
...
@@ -55,6 +56,9 @@ import java.util.List;
})
})
public
class
${
app
.
getPKGCodeName
()}
Application
extends
WebMvcConfigurerAdapter
{
public
class
${
app
.
getPKGCodeName
()}
Application
extends
WebMvcConfigurerAdapter
{
@
Autowired
SearchContextHandlerMethodArgumentResolver
resolver
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(${
app
.
getPKGCodeName
()}
Application
.
class
,
args
);
SpringApplication
.
run
(${
app
.
getPKGCodeName
()}
Application
.
class
,
args
);
}
}
...
@@ -62,6 +66,6 @@ public class ${app.getPKGCodeName()}Application extends WebMvcConfigurerAdapter{
...
@@ -62,6 +66,6 @@ public class ${app.getPKGCodeName()}Application extends WebMvcConfigurerAdapter{
@
Override
@
Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
()
);
argumentResolvers
.
add
(
resolver
);
}
}
}
}
SLN/%PUBPRJ%-boot/src/main/java/%SYS_PKGPATH%/DevBootApplication.java.ftl
浏览文件 @
92a45904
...
@@ -24,6 +24,7 @@ import org.springframework.context.annotation.ComponentScan;
...
@@ -24,6 +24,7 @@ import org.springframework.context.annotation.ComponentScan;
import
org
.
springframework
.
scheduling
.
annotation
.
EnableAsync
;
import
org
.
springframework
.
scheduling
.
annotation
.
EnableAsync
;
import
org
.
springframework
.
scheduling
.
annotation
.
EnableScheduling
;
import
org
.
springframework
.
scheduling
.
annotation
.
EnableScheduling
;
import
java
.
util
.
List
;
import
java
.
util
.
List
;
import
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
;
@
Slf4j
@
Slf4j
@
EnableDiscoveryClient
@
EnableDiscoveryClient
...
@@ -59,6 +60,9 @@ import java.util.List;
...
@@ -59,6 +60,9 @@ import java.util.List;
@
EnableScheduling
@
EnableScheduling
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
@
Autowired
SearchContextHandlerMethodArgumentResolver
resolver
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
DevBootApplication
.
class
,
args
);
SpringApplication
.
run
(
DevBootApplication
.
class
,
args
);
}
}
...
@@ -66,6 +70,6 @@ public class DevBootApplication extends WebMvcConfigurerAdapter{
...
@@ -66,6 +70,6 @@ public class DevBootApplication extends WebMvcConfigurerAdapter{
@
Override
@
Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
()
);
argumentResolvers
.
add
(
resolver
);
}
}
}
}
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/%SYS%%API%Application.java.ftl
浏览文件 @
92a45904
...
@@ -25,6 +25,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
...
@@ -25,6 +25,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import
org
.
springframework
.
cloud
.
openfeign
.
EnableFeignClients
;
import
org
.
springframework
.
cloud
.
openfeign
.
EnableFeignClients
;
import
org
.
springframework
.
scheduling
.
annotation
.
EnableAsync
;
import
org
.
springframework
.
scheduling
.
annotation
.
EnableAsync
;
import
org
.
springframework
.
scheduling
.
annotation
.
EnableScheduling
;
import
org
.
springframework
.
scheduling
.
annotation
.
EnableScheduling
;
import
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
;
import
java
.
util
.
List
;
import
java
.
util
.
List
;
@
Slf4j
@
Slf4j
...
@@ -64,6 +65,9 @@ import java.util.List;
...
@@ -64,6 +65,9 @@ import java.util.List;
@
EnableScheduling
@
EnableScheduling
public
class
${
sys
.
codeName
}${
item
.
codeName
}
Application
extends
WebMvcConfigurerAdapter
{
public
class
${
sys
.
codeName
}${
item
.
codeName
}
Application
extends
WebMvcConfigurerAdapter
{
@
Autowired
SearchContextHandlerMethodArgumentResolver
resolver
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(${
sys
.
codeName
}${
item
.
codeName
}
Application
.
class
,
args
);
SpringApplication
.
run
(${
sys
.
codeName
}${
item
.
codeName
}
Application
.
class
,
args
);
}
}
...
@@ -71,6 +75,6 @@ public class ${sys.codeName}${item.codeName}Application extends WebMvcConfigurer
...
@@ -71,6 +75,6 @@ public class ${sys.codeName}${item.codeName}Application extends WebMvcConfigurer
@
Override
@
Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
()
);
argumentResolvers
.
add
(
resolver
);
}
}
}
}
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/web/SearchContextHandlerMethodArgumentResolver.java.ftl
浏览文件 @
92a45904
...
@@ -13,10 +13,16 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
...
@@ -13,10 +13,16 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import
org
.
springframework
.
web
.
method
.
support
.
ModelAndViewContainer
;
import
org
.
springframework
.
web
.
method
.
support
.
ModelAndViewContainer
;
import
java
.
util
.
LinkedHashMap
;
import
java
.
util
.
LinkedHashMap
;
import
java
.
util
.
Map
;
import
java
.
util
.
Map
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Value
;
import
org
.
springframework
.
context
.
annotation
.
Configuration
;
@
Slf4j
@
Slf4j
@
Configuration
public
class
SearchContextHandlerMethodArgumentResolver
implements
HandlerMethodArgumentResolver
{
public
class
SearchContextHandlerMethodArgumentResolver
implements
HandlerMethodArgumentResolver
{
@
Value
(
"${r'${ibiz.pageLimit:1000}'}"
)
private
int
pageLimit
=
1000
;
private
static
ObjectMapper
objectMapper
=
new
ObjectMapper
();
private
static
ObjectMapper
objectMapper
=
new
ObjectMapper
();
@
Override
@
Override
...
@@ -32,6 +38,9 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
...
@@ -32,6 +38,9 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for
(
String
key
:
params
.
keySet
())
{
for
(
String
key
:
params
.
keySet
())
{
set
.
put
(
key
,
params
.
get
(
key
)[
0
]);
set
.
put
(
key
,
params
.
get
(
key
)[
0
]);
}
}
if
((
!set.containsKey("size")) ){
set
.
put
(
"size"
,
pageLimit
);
}
String
json
=
objectMapper
.
writeValueAsString
(
set
);
String
json
=
objectMapper
.
writeValueAsString
(
set
);
return
objectMapper
.
readValue
(
json
,
parameter
.
getParameterType
());
return
objectMapper
.
readValue
(
json
,
parameter
.
getParameterType
());
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录