Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
ab2df3cc
Commit
ab2df3cc
authored
Sep 17, 2019
by
zengchao
Browse files
预备自定义Beanprocessor的算法测试初期工作
也许无法成功
parent
e8e8dfd5
Changes
3
Hide whitespace changes
Inline
Side-by-side
plus-admin/admin-console/src/main/java/com/ibeetl/admin/Coso
n
leApplication.java
→
plus-admin/admin-console/src/main/java/com/ibeetl/admin/Co
n
soleApplication.java
View file @
ab2df3cc
...
...
@@ -8,15 +8,15 @@ import org.springframework.cache.annotation.EnableCaching;
@SpringBootApplication
@EnableCaching
public
class
Coso
n
leApplication
extends
SpringBootServletInitializer
{
public
class
Co
n
soleApplication
extends
SpringBootServletInitializer
{
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
return
application
.
sources
(
Coso
n
leApplication
.
class
);
return
application
.
sources
(
Co
n
soleApplication
.
class
);
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
Coso
n
leApplication
.
class
,
args
);
SpringApplication
.
run
(
Co
n
soleApplication
.
class
,
args
);
}
}
plus-admin/admin-console/src/test/java/BeanProcessor.java
0 → 100644
View file @
ab2df3cc
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.ibeetl.admin.ConsoleApplication
;
import
com.ibeetl.admin.core.dao.CoreFunctionDao
;
import
com.ibeetl.admin.core.entity.CoreRoute
;
import
com.ibeetl.admin.core.entity.CoreRouteMeta
;
import
java.util.List
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
ConsoleApplication
.
class
)
public
class
BeanProcessor
{
@Autowired
CoreFunctionDao
coreFunctionDao
;
static
JSONObject
resultMap
;
@BeforeClass
public
static
void
init
()
{
resultMap
=
new
JSONObject
();
resultMap
.
put
(
"id"
,
"resultmap"
);
JSONObject
mapping
=
new
JSONObject
();
mapping
.
put
(
"id"
,
"id"
);
mapping
.
put
(
"parentId"
,
"parent_id"
);
mapping
.
put
(
"path"
,
"path"
);
mapping
.
put
(
"name"
,
"name"
);
mapping
.
put
(
"seq"
,
"seq"
);
JSONObject
objMap
=
new
JSONObject
();
objMap
.
put
(
"title"
,
"title"
);
objMap
.
put
(
"icon"
,
"icon"
);
objMap
.
put
(
"resultType"
,
CoreRouteMeta
.
class
.
getCanonicalName
());
mapping
.
put
(
"obj_mapping"
+
IdUtil
.
fastSimpleUUID
(),
objMap
);
JSONArray
listMap
=
new
JSONArray
();
JSONObject
listInnerMap
=
new
JSONObject
();
listInnerMap
.
put
(
"id"
,
"role_id"
);
listMap
.
add
(
listInnerMap
);
mapping
.
put
(
"list_mapping"
+
IdUtil
.
fastSimpleUUID
(),
listMap
);
resultMap
.
put
(
"map"
,
mapping
);
}
@Test
public
void
maptest
()
{
List
<
CoreRoute
>
routesList
=
coreFunctionDao
.
getAllRoutes
();
System
.
out
.
println
(
JSONUtil
.
toJsonStr
(
resultMap
));
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/conf/BeetlConf.java
View file @
ab2df3cc
...
...
@@ -78,6 +78,7 @@ public class BeetlConf {
@Bean
public
WebSimulate
getWebSimulate
(
GroupTemplate
gt
,
ObjectMapper
objectMapper
)
{
return
new
WebSimulate
(
gt
,
new
ObjectMapperJsonUtil
(
objectMapper
))
{
@Override
protected
String
getRenderPath
(
HttpServletRequest
request
)
{
String
defaultRenderPath
=
request
.
getServletPath
();
return
defaultRenderPath
.
replace
(
".do"
,
".html"
);
...
...
@@ -88,7 +89,6 @@ public class BeetlConf {
@Bean
public
SQLManager
sqlManager
(
@Qualifier
(
"baseDataSourceSqlManagerFactoryBean"
)
SQLManager
sqlManager
)
{
Map
<
Class
,
JavaSqlTypeHandler
>
typeHandlerMap
=
sqlManager
.
getDefaultBeanProcessors
().
getHandlers
();
/*Java bean的属性类型处理器,从数据库类型转化到属性Date类型*/
typeHandlerMap
.
remove
(
Date
.
class
);
...
...
@@ -171,6 +171,7 @@ public class BeetlConf {
}
static
class
StarterDebugInterceptor
extends
DebugInterceptor
{
@Override
protected
boolean
isSimple
(
String
sqlId
)
{
if
(
sqlId
.
indexOf
(
"_gen_"
)
!=
-
1
)
{
return
true
;
...
...
@@ -179,6 +180,7 @@ public class BeetlConf {
}
}
@Override
protected
void
simpleOut
(
InterceptorContext
ctx
)
{
return
;
}
...
...
Write
Preview
Supports
Markdown
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