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
eacdbf63
Commit
eacdbf63
authored
Oct 08, 2019
by
zengchao
Browse files
-重写路由
parent
c6ec721d
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
plus-admin/admin-console/src/main/resources/application.properties
View file @
eacdbf63
...
@@ -36,7 +36,7 @@ logging.level.org.springframework.web.servlet.mvc.method.annotation=warn
...
@@ -36,7 +36,7 @@ logging.level.org.springframework.web.servlet.mvc.method.annotation=warn
#logging.file = my.log
#logging.file = my.log
logging.pattern.console
=
%-4relative [%thread] %-5level %logger{256} %M %L - %msg%n
logging.pattern.console
=
%-4relative [%thread] %-5level %logger{256} %M %L - %msg%n
#\u65E5\u5FD7\u6392\u9664 autoconfiguration \u8F93\u51FA
#\u65E5\u5FD7\u6392\u9664 autoconfiguration \u8F93\u51FA
logging.level.org.springframework.boot.autoconfigure
:
ERROR
logging.level.org.springframework.boot.autoconfigure
=
ERROR
#\u6587\u6863\u9884\u89C8\u670D\u52A1\u7684\u8C03\u7528\u5730\u5740\uFF0C\u53C2\u8003https://gitee.com/kekingcn/file-online-preview \u5B89\u88C5\uFF0C\u6CA1\u6709\u5982\u4E0B\u914D\u7F6E\u65E0\u6CD5\u4F7F\u7528\u9884\u89C8\u529F\u80FD
#\u6587\u6863\u9884\u89C8\u670D\u52A1\u7684\u8C03\u7528\u5730\u5740\uFF0C\u53C2\u8003https://gitee.com/kekingcn/file-online-preview \u5B89\u88C5\uFF0C\u6CA1\u6709\u5982\u4E0B\u914D\u7F6E\u65E0\u6CD5\u4F7F\u7528\u9884\u89C8\u529F\u80FD
file.previewURL
=
http://localhost:8012/onlinePreview
file.previewURL
=
http://localhost:8012/onlinePreview
plus-admin/admin-console/src/main/resources/btsql-ext.properties
View file @
eacdbf63
DELIMITER_PLACEHOLDER_START
=
#
DELIMITER_PLACEHOLDER_START
=
#
DELIMITER_PLACEHOLDER_END=#
DELIMITER_PLACEHOLDER_END=#
DELIMITER_STATEMENT_START
=
>-
DELIMITER_STATEMENT_START
=
@
DELIMITER_STATEMENT_END
=
DELIMITER_STATEMENT_END
=
#\u51FD\u6570\u6CE8\u518C
#\u51FD\u6570\u6CE8\u518C
FN.isEmpty
=
org.beetl.ext.fn.EmptyExpressionFunction
FN.isEmpty
=
org.beetl.ext.fn.EmptyExpressionFunction
...
...
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/conf/BeetlConf.java
View file @
eacdbf63
package
com.ibeetl.admin.core.conf
;
package
com.ibeetl.admin.core.conf
;
import
cn.hutool.core.util.CharsetUtil
;
import
cn.hutool.core.util.CharsetUtil
;
import
cn.hutool.setting.SettingUtil
;
import
cn.hutool.setting.dialect.Props
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.ibeetl.admin.core.conf.handler.DateTypeHandler
;
import
com.ibeetl.admin.core.conf.handler.DateTypeHandler
;
import
com.ibeetl.admin.core.conf.handler.ZonedDateTimeTypeHandler
;
import
com.ibeetl.admin.core.conf.handler.ZonedDateTimeTypeHandler
;
...
@@ -23,6 +25,7 @@ import com.ibeetl.admin.core.web.query.QueryParser;
...
@@ -23,6 +25,7 @@ import com.ibeetl.admin.core.web.query.QueryParser;
import
com.ibeetl.starter.BeetlSqlMutipleSourceCustomize
;
import
com.ibeetl.starter.BeetlSqlMutipleSourceCustomize
;
import
com.ibeetl.starter.BeetlTemplateCustomize
;
import
com.ibeetl.starter.BeetlTemplateCustomize
;
import
com.ibeetl.starter.ObjectMapperJsonUtil
;
import
com.ibeetl.starter.ObjectMapperJsonUtil
;
import
java.io.File
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.time.ZonedDateTime
;
import
java.time.ZonedDateTime
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -85,7 +88,7 @@ public class BeetlConf {
...
@@ -85,7 +88,7 @@ public class BeetlConf {
}
}
/**
/**
* BeetlSql 多数据源
*
对
BeetlSql
的
多数据源
中每个数据源单独自定义配置
*
*
* @return
* @return
*/
*/
...
@@ -194,7 +197,7 @@ public class BeetlConf {
...
@@ -194,7 +197,7 @@ public class BeetlConf {
@Override
@Override
protected
void
println
(
String
str
)
{
protected
void
println
(
String
str
)
{
logger
.
info
(
str
);
logger
.
info
(
System
.
lineSeparator
()+
str
);
}
}
}
}
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/conf/JasonConfig.java
View file @
eacdbf63
package
com.ibeetl.admin.core.conf
;
package
com.ibeetl.admin.core.conf
;
import
com.fasterxml.jackson.annotation.JsonInclude.Include
;
import
com.fasterxml.jackson.databind.DeserializationConfig
;
import
com.fasterxml.jackson.databind.SerializationConfig
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -23,11 +28,17 @@ public class JasonConfig {
...
@@ -23,11 +28,17 @@ public class JasonConfig {
@ConditionalOnMissingBean
(
ObjectMapper
.
class
)
@ConditionalOnMissingBean
(
ObjectMapper
.
class
)
public
ObjectMapper
getObjectMapper
()
{
public
ObjectMapper
getObjectMapper
()
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
objectMapper
.
setDateFormat
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
));
objectMapper
.
setDateFormat
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
));
objectMapper
.
configure
(
SerializationFeature
.
INDENT_OUTPUT
,
true
);
objectMapper
.
configure
(
SerializationFeature
.
INDENT_OUTPUT
,
true
);
SimpleModule
simpleModule
=
new
SimpleModule
(
"SimpleModule"
,
Version
.
unknownVersion
());
SimpleModule
simpleModule
=
new
SimpleModule
(
"SimpleModule"
,
Version
.
unknownVersion
());
simpleModule
.
addSerializer
(
JsonResult
.
class
,
new
CustomJsonResultSerializer
());
simpleModule
.
addSerializer
(
JsonResult
.
class
,
new
CustomJsonResultSerializer
());
simpleModule
.
addSerializer
(
Long
.
class
,
ToStringSerializer
.
instance
);
simpleModule
.
addSerializer
(
Long
.
TYPE
,
ToStringSerializer
.
instance
);
objectMapper
.
registerModule
(
simpleModule
);
objectMapper
.
registerModule
(
simpleModule
);
return
objectMapper
;
return
objectMapper
;
}
}
/**
/**
...
@@ -48,7 +59,7 @@ public class JasonConfig {
...
@@ -48,7 +59,7 @@ public class JasonConfig {
Object
data
=
value
.
getData
();
Object
data
=
value
.
getData
();
if
(
data
instanceof
PageQuery
)
{
if
(
data
instanceof
PageQuery
)
{
PageQuery
query
=
(
PageQuery
)
(
data
);
PageQuery
query
=
(
PageQuery
)
(
data
);
gen
.
write
Object
Field
(
"count"
,
query
.
getTotalRow
());
gen
.
write
Number
Field
(
"count"
,
query
.
getTotalRow
());
gen
.
writeObjectField
(
"data"
,
query
.
getList
());
gen
.
writeObjectField
(
"data"
,
query
.
getList
());
}
else
{
}
else
{
gen
.
writeObjectField
(
"data"
,
data
);
gen
.
writeObjectField
(
"data"
,
data
);
...
...
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/conf/processor/JsonBeanProcessor.java
View file @
eacdbf63
...
@@ -95,6 +95,7 @@ public class JsonBeanProcessor extends BeanProcessor {
...
@@ -95,6 +95,7 @@ public class JsonBeanProcessor extends BeanProcessor {
}
else
{
}
else
{
/*复杂结果集映射,取消TailBean的便利性*/
/*复杂结果集映射,取消TailBean的便利性*/
rs
.
absolute
(
0
);
rs
.
absolute
(
0
);
mapping
.
setNestedRows
(
null
);
fillMappingRow
(
rs
,
mapping
);
fillMappingRow
(
rs
,
mapping
);
results
=
convertMapping
(
mapping
,
type
);
results
=
convertMapping
(
mapping
,
type
);
}
}
...
@@ -131,6 +132,7 @@ public class JsonBeanProcessor extends BeanProcessor {
...
@@ -131,6 +132,7 @@ public class JsonBeanProcessor extends BeanProcessor {
}
else
{
}
else
{
/*复杂结果集映射,取消TailBean的便利性*/
/*复杂结果集映射,取消TailBean的便利性*/
rs
.
absolute
(
0
);
rs
.
absolute
(
0
);
mapping
.
getNestedRows
().
clear
();
fillMappingRow
(
rs
,
mapping
);
fillMappingRow
(
rs
,
mapping
);
results
=
convertMapping
(
mapping
,
type
);
results
=
convertMapping
(
mapping
,
type
);
}
}
...
...
plus-admin/admin-core/src/main/resources/sql/core/coreFunction.md
View file @
eacdbf63
...
@@ -3,20 +3,22 @@ getAllRoutes
...
@@ -3,20 +3,22 @@ getAllRoutes
===
===
```
sql
```
sql
select
router
.
id
,
router
.
PARENT_ID
,
select
menu
.
id
,
ifnull
(
router
.
ACCESS_URL
,
'/error/404'
)
path
,
menu
.
PARENT_MENU_ID
PARENT_ID
,
router
.
NAME
,
menu
.
NAME
title
,
menu
.
NAME
title
,
menu
.
ICON
,
menu
.
ICON
,
ifnull
(
menu
.
SEQ
,
999999
)
seq
,
ifnull
(
menu
.
SEQ
,
999999
)
seq
,
crm
.
ROLE_ID
route
.
ACCESS_URL
path
,
from
core_function
router
route
.
NAME
,
left
join
core_menu
menu
on
menu
.
FUNCTION_ID
=
router
.
ID
role_menu
.
ROLE_ID
left
join
core_role_menu
crm
on
crm
.
MENU_ID
=
menu
.
id
from
core_menu
menu
order
by
router
.
ID
left
join
core_function
route
on
route
.
ID
=
menu
.
FUNCTION_ID
left
join
core_role_menu
role_menu
on
role_menu
.
MENU_ID
=
menu
.
id
where
menu
.
TYPE
!=
'MENU_S'
```
```
>-
mapping("RouteMapping");
@
mapping("RouteMapping");
RouteMapping
RouteMapping
===
===
...
...
plus-admin/admin-core/src/main/resources/usually.sql
View file @
eacdbf63
...
@@ -36,15 +36,30 @@ SELECT router.id,
...
@@ -36,15 +36,30 @@ SELECT router.id,
menu
.
NAME
title
,
menu
.
NAME
title
,
menu
.
ICON
,
menu
.
ICON
,
IFNULL
(
menu
.
SEQ
,
-
9999
)
seq
,
IFNULL
(
menu
.
SEQ
,
-
9999
)
seq
,
crm
.
ROLE_ID
(
select
from
core_role_menu
crm
where
crm
.
FROM
core_function
router
FROM
core_function
router
LEFT
JOIN
core_menu
menu
LEFT
JOIN
core_menu
menu
ON
menu
.
FUNCTION_ID
=
router
.
ID
ON
menu
.
FUNCTION_ID
=
router
.
ID
;
LEFT
JOIN
core_role_menu
crm
ON
crm
.
MENU_ID
=
menu
.
id
;
select
*
select
router
.
id
,
from
core_function
;
router
.
PARENT_ID
,
IFNULL
(
router
.
ACCESS_URL
,
'/error/404'
)
path
,
router
.
NAME
,
menu
.
NAME
title
,
menu
.
ICON
,
IFNULL
(
menu
.
SEQ
,
-
9999
)
seq
,
from
core_menu
cm
left
join
core_function
cf
on
cf
.
id
=
cm
.
function_id
union
select
router
.
id
,
router
.
PARENT_ID
,
IFNULL
(
router
.
ACCESS_URL
,
'/error/404'
)
path
,
router
.
NAME
,
menu
.
NAME
title
,
menu
.
ICON
,
IFNULL
(
menu
.
SEQ
,
-
9999
)
seq
,
from
core_menu
cm
right
join
core_function
cf
on
cf
.
id
=
cm
.
function_id
;
-- 分为系统,导航,菜单。系统是顶部菜单,导航就是父菜单,菜单是导航的子菜单
-- 分为系统,导航,菜单。系统是顶部菜单,导航就是父菜单,菜单是导航的子菜单
select
cm
.
*
,
select
cm
.
*
,
...
...
plus-admin/doc/starter-mysql.sql
View file @
eacdbf63
This diff is collapsed.
Click to expand it.
plus-admin/pom.xml
View file @
eacdbf63
...
@@ -42,11 +42,11 @@
...
@@ -42,11 +42,11 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-undertow
</artifactId>
<artifactId>
spring-boot-starter-undertow
</artifactId>
</dependency>
</dependency>
<dependency>
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<optional>true</optional>
</dependency>
</dependency>
-->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
...
...
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