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
Eladmin
Commits
e471a9da
Commit
e471a9da
authored
Aug 22, 2019
by
dqjdda
Browse files
日志加入加入IP来源,支持多字段模糊搜索,升级七牛云存储版本
parent
1b574b59
Changes
33
Hide whitespace changes
Inline
Side-by-side
eladmin-common/src/main/java/me/zhengjie/annotation/Query.java
View file @
e471a9da
...
@@ -30,6 +30,12 @@ public @interface Query {
...
@@ -30,6 +30,12 @@ public @interface Query {
*/
*/
Join
join
()
default
Join
.
LEFT
;
Join
join
()
default
Join
.
LEFT
;
/**
* 多字段模糊搜索,仅支持String类型字段,多个用逗号隔开, 如@Query(blurry = "email,username")
* @return
*/
String
blurry
()
default
""
;
enum
Type
{
enum
Type
{
/** jie 2019/6/4 相等 */
/** jie 2019/6/4 相等 */
EQUAL
EQUAL
...
...
eladmin-common/src/main/java/me/zhengjie/utils/ElAdminConstant.java
View file @
e471a9da
...
@@ -11,6 +11,11 @@ public class ElAdminConstant {
...
@@ -11,6 +11,11 @@ public class ElAdminConstant {
public
static
final
String
RESET_MAIL
=
"重置邮箱"
;
public
static
final
String
RESET_MAIL
=
"重置邮箱"
;
/**
* 用于IP定位转换
*/
public
static
final
String
REGION
=
"内网IP|内网IP"
;
/**
/**
* 常用接口
* 常用接口
*/
*/
...
...
eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
View file @
e471a9da
...
@@ -2,8 +2,8 @@ package me.zhengjie.utils;
...
@@ -2,8 +2,8 @@ package me.zhengjie.utils;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.IdUtil
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.
IOException
;
import
java.io.
*
;
import
java.text.DecimalFormat
;
import
java.text.DecimalFormat
;
/**
/**
...
@@ -116,4 +116,27 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
...
@@ -116,4 +116,27 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
}
}
return
resultSize
;
return
resultSize
;
}
}
/**
* inputStream 转 File
* @param ins
* @param name
* @return
* @throws Exception
*/
public
static
File
inputStreamToFile
(
InputStream
ins
,
String
name
)
throws
Exception
{
File
file
=
new
File
(
System
.
getProperty
(
"java.io.tmpdir"
)
+
name
);
if
(
file
.
exists
())
{
return
file
;
}
OutputStream
os
=
new
FileOutputStream
(
file
);
int
bytesRead
=
0
;
byte
[]
buffer
=
new
byte
[
8192
];
while
((
bytesRead
=
ins
.
read
(
buffer
,
0
,
8192
))
!=
-
1
)
{
os
.
write
(
buffer
,
0
,
bytesRead
);
}
os
.
close
();
ins
.
close
();
return
file
;
}
}
}
eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java
View file @
e471a9da
...
@@ -37,6 +37,7 @@ public class QueryHelp {
...
@@ -37,6 +37,7 @@ public class QueryHelp {
if
(
q
!=
null
)
{
if
(
q
!=
null
)
{
String
propName
=
q
.
propName
();
String
propName
=
q
.
propName
();
String
joinName
=
q
.
joinName
();
String
joinName
=
q
.
joinName
();
String
blurry
=
q
.
blurry
();
String
attributeName
=
isBlank
(
propName
)
?
field
.
getName
()
:
propName
;
String
attributeName
=
isBlank
(
propName
)
?
field
.
getName
()
:
propName
;
Class
<?>
fieldType
=
field
.
getType
();
Class
<?>
fieldType
=
field
.
getType
();
Object
val
=
field
.
get
(
query
);
Object
val
=
field
.
get
(
query
);
...
@@ -44,6 +45,18 @@ public class QueryHelp {
...
@@ -44,6 +45,18 @@ public class QueryHelp {
continue
;
continue
;
}
}
Join
join
=
null
;
Join
join
=
null
;
// 模糊多字段
if
(
ObjectUtil
.
isNotEmpty
(
blurry
))
{
String
[]
blurrys
=
blurry
.
split
(
","
);
List
<
Predicate
>
orPredicate
=
new
ArrayList
<>();
for
(
String
s
:
blurrys
)
{
orPredicate
.
add
(
cb
.
like
(
root
.
get
(
s
)
.
as
(
String
.
class
),
"%"
+
val
.
toString
()
+
"%"
));
}
Predicate
[]
p
=
new
Predicate
[
orPredicate
.
size
()];
list
.
add
(
cb
.
or
(
orPredicate
.
toArray
(
p
)));
continue
;
}
if
(
ObjectUtil
.
isNotEmpty
(
joinName
))
{
if
(
ObjectUtil
.
isNotEmpty
(
joinName
))
{
switch
(
q
.
join
())
{
switch
(
q
.
join
())
{
case
LEFT:
case
LEFT:
...
...
eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java
View file @
e471a9da
package
me.zhengjie.utils
;
package
me.zhengjie.utils
;
import
cn.hutool.core.io.resource.ClassPathResource
;
import
org.lionsoul.ip2region.DataBlock
;
import
org.lionsoul.ip2region.DbConfig
;
import
org.lionsoul.ip2region.DbSearcher
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.File
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.lang.reflect.Method
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -132,7 +139,49 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
...
@@ -132,7 +139,49 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
if
(
ip
==
null
||
ip
.
length
()
==
0
||
"unknown"
.
equalsIgnoreCase
(
ip
))
{
if
(
ip
==
null
||
ip
.
length
()
==
0
||
"unknown"
.
equalsIgnoreCase
(
ip
))
{
ip
=
request
.
getRemoteAddr
();
ip
=
request
.
getRemoteAddr
();
}
}
return
"0:0:0:0:0:0:0:1"
.
equals
(
ip
)?
"127.0.0.1"
:
ip
;
String
[]
ips
=
ip
.
split
(
","
);
return
"0:0:0:0:0:0:0:1"
.
equals
(
ips
[
0
])?
"127.0.0.1"
:
ips
[
0
];
}
/**
* 根据ip获取详细地址
* @param ip
* @return
*/
public
static
String
getCityInfo
(
String
ip
)
{
try
{
String
path
=
"ip2region/ip2region.db"
;
String
name
=
"ip2region.db"
;
int
algorithm
=
DbSearcher
.
BTREE_ALGORITHM
;
DbConfig
config
=
new
DbConfig
();
File
file
=
FileUtil
.
inputStreamToFile
(
new
ClassPathResource
(
path
).
getStream
(),
name
);
DbSearcher
searcher
=
new
DbSearcher
(
config
,
file
.
getPath
());
Method
method
=
null
;
switch
(
algorithm
)
{
case
DbSearcher
.
BTREE_ALGORITHM
:
method
=
searcher
.
getClass
().
getMethod
(
"btreeSearch"
,
String
.
class
);
break
;
case
DbSearcher
.
BINARY_ALGORITHM
:
method
=
searcher
.
getClass
().
getMethod
(
"binarySearch"
,
String
.
class
);
break
;
case
DbSearcher
.
MEMORY_ALGORITYM
:
method
=
searcher
.
getClass
().
getMethod
(
"memorySearch"
,
String
.
class
);
break
;
default
:
method
=
searcher
.
getClass
().
getMethod
(
"memorySearch"
,
String
.
class
);
break
;
}
DataBlock
dataBlock
=
null
;
dataBlock
=
(
DataBlock
)
method
.
invoke
(
searcher
,
ip
);
String
address
=
dataBlock
.
getRegion
().
replace
(
"0|"
,
""
);
if
(
address
.
charAt
(
address
.
length
()-
1
)
==
'|'
){
address
=
address
.
substring
(
0
,
address
.
length
()
-
1
);
}
return
address
.
equals
(
ElAdminConstant
.
REGION
)?
"内网IP"
:
address
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
""
;
}
}
/**
/**
...
...
eladmin-logging/src/main/java/me/zhengjie/domain/Log.java
View file @
e471a9da
...
@@ -54,6 +54,9 @@ public class Log implements Serializable {
...
@@ -54,6 +54,9 @@ public class Log implements Serializable {
@Column
(
name
=
"request_ip"
)
@Column
(
name
=
"request_ip"
)
private
String
requestIp
;
private
String
requestIp
;
@Column
(
name
=
"address"
)
private
String
address
;
/**
/**
* 请求耗时
* 请求耗时
*/
*/
...
...
eladmin-logging/src/main/java/me/zhengjie/rest/LogController.java
View file @
e471a9da
...
@@ -34,7 +34,7 @@ public class LogController {
...
@@ -34,7 +34,7 @@ public class LogController {
@GetMapping
(
value
=
"/logs/user"
)
@GetMapping
(
value
=
"/logs/user"
)
public
ResponseEntity
getUserLogs
(
LogQueryCriteria
criteria
,
Pageable
pageable
){
public
ResponseEntity
getUserLogs
(
LogQueryCriteria
criteria
,
Pageable
pageable
){
criteria
.
setLogType
(
"INFO"
);
criteria
.
setLogType
(
"INFO"
);
criteria
.
set
Username
(
SecurityUtils
.
getUsername
());
criteria
.
set
Blurry
(
SecurityUtils
.
getUsername
());
return
new
ResponseEntity
(
logService
.
queryAllByUser
(
criteria
,
pageable
),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
logService
.
queryAllByUser
(
criteria
,
pageable
),
HttpStatus
.
OK
);
}
}
...
...
eladmin-logging/src/main/java/me/zhengjie/service/dto/LogErrorDTO.java
View file @
e471a9da
...
@@ -38,6 +38,8 @@ public class LogErrorDTO implements Serializable {
...
@@ -38,6 +38,8 @@ public class LogErrorDTO implements Serializable {
*/
*/
private
String
requestIp
;
private
String
requestIp
;
private
String
address
;
/**
/**
* 创建日期
* 创建日期
...
...
eladmin-logging/src/main/java/me/zhengjie/service/dto/LogQueryCriteria.java
View file @
e471a9da
...
@@ -11,12 +11,10 @@ import me.zhengjie.annotation.Query;
...
@@ -11,12 +11,10 @@ import me.zhengjie.annotation.Query;
@Data
@Data
public
class
LogQueryCriteria
{
public
class
LogQueryCriteria
{
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
// 多字段模糊
private
String
username
;
@Query
(
blurry
=
"username,description,address,requestIp,method,params"
)
private
String
blurry
;
@Query
@Query
private
String
logType
;
private
String
logType
;
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
private
String
description
;
}
}
eladmin-logging/src/main/java/me/zhengjie/service/dto/LogSmallDTO.java
View file @
e471a9da
...
@@ -27,6 +27,8 @@ public class LogSmallDTO implements Serializable {
...
@@ -27,6 +27,8 @@ public class LogSmallDTO implements Serializable {
*/
*/
private
Long
time
;
private
Long
time
;
private
String
address
;
/**
/**
* 创建日期
* 创建日期
*/
*/
...
...
eladmin-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java
View file @
e471a9da
...
@@ -10,6 +10,7 @@ import me.zhengjie.service.mapper.LogErrorMapper;
...
@@ -10,6 +10,7 @@ import me.zhengjie.service.mapper.LogErrorMapper;
import
me.zhengjie.service.mapper.LogSmallMapper
;
import
me.zhengjie.service.mapper.LogSmallMapper
;
import
me.zhengjie.utils.PageUtil
;
import
me.zhengjie.utils.PageUtil
;
import
me.zhengjie.utils.QueryHelp
;
import
me.zhengjie.utils.QueryHelp
;
import
me.zhengjie.utils.StringUtils
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -92,6 +93,7 @@ public class LogServiceImpl implements LogService {
...
@@ -92,6 +93,7 @@ public class LogServiceImpl implements LogService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
log
.
setAddress
(
StringUtils
.
getCityInfo
(
log
.
getRequestIp
()));
log
.
setMethod
(
methodName
);
log
.
setMethod
(
methodName
);
log
.
setUsername
(
username
);
log
.
setUsername
(
username
);
log
.
setParams
(
params
+
" }"
);
log
.
setParams
(
params
+
" }"
);
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java
View file @
e471a9da
...
@@ -5,6 +5,7 @@ import me.zhengjie.exception.BadRequestException;
...
@@ -5,6 +5,7 @@ import me.zhengjie.exception.BadRequestException;
import
me.zhengjie.modules.system.domain.Dict
;
import
me.zhengjie.modules.system.domain.Dict
;
import
me.zhengjie.modules.system.service.DictService
;
import
me.zhengjie.modules.system.service.DictService
;
import
me.zhengjie.modules.system.service.dto.DictDTO
;
import
me.zhengjie.modules.system.service.dto.DictDTO
;
import
me.zhengjie.modules.system.service.dto.DictQueryCriteria
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
...
@@ -29,7 +30,7 @@ public class DictController {
...
@@ -29,7 +30,7 @@ public class DictController {
@Log
(
"查询字典"
)
@Log
(
"查询字典"
)
@GetMapping
(
value
=
"/dict"
)
@GetMapping
(
value
=
"/dict"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','DICT_ALL','DICT_SELECT')"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','DICT_ALL','DICT_SELECT')"
)
public
ResponseEntity
getDicts
(
Dict
DTO
resources
,
Pageable
pageable
){
public
ResponseEntity
getDicts
(
Dict
QueryCriteria
resources
,
Pageable
pageable
){
return
new
ResponseEntity
(
dictService
.
queryAll
(
resources
,
pageable
),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
dictService
.
queryAll
(
resources
,
pageable
),
HttpStatus
.
OK
);
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java
View file @
e471a9da
...
@@ -6,8 +6,8 @@ import me.zhengjie.exception.BadRequestException;
...
@@ -6,8 +6,8 @@ import me.zhengjie.exception.BadRequestException;
import
me.zhengjie.modules.system.service.MenuService
;
import
me.zhengjie.modules.system.service.MenuService
;
import
me.zhengjie.modules.system.service.RoleService
;
import
me.zhengjie.modules.system.service.RoleService
;
import
me.zhengjie.modules.system.service.UserService
;
import
me.zhengjie.modules.system.service.UserService
;
import
me.zhengjie.modules.system.service.dto.CommonQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.MenuDTO
;
import
me.zhengjie.modules.system.service.dto.MenuDTO
;
import
me.zhengjie.modules.system.service.dto.MenuQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.UserDTO
;
import
me.zhengjie.modules.system.service.dto.UserDTO
;
import
me.zhengjie.utils.SecurityUtils
;
import
me.zhengjie.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -62,7 +62,7 @@ public class MenuController {
...
@@ -62,7 +62,7 @@ public class MenuController {
@Log
(
"查询菜单"
)
@Log
(
"查询菜单"
)
@GetMapping
(
value
=
"/menus"
)
@GetMapping
(
value
=
"/menus"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','MENU_ALL','MENU_SELECT')"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','MENU_ALL','MENU_SELECT')"
)
public
ResponseEntity
getMenus
(
Common
QueryCriteria
criteria
){
public
ResponseEntity
getMenus
(
Menu
QueryCriteria
criteria
){
List
<
MenuDTO
>
menuDTOList
=
menuService
.
queryAll
(
criteria
);
List
<
MenuDTO
>
menuDTOList
=
menuService
.
queryAll
(
criteria
);
return
new
ResponseEntity
(
menuService
.
buildTree
(
menuDTOList
),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
menuService
.
buildTree
(
menuDTOList
),
HttpStatus
.
OK
);
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/PermissionController.java
View file @
e471a9da
...
@@ -4,8 +4,8 @@ import me.zhengjie.aop.log.Log;
...
@@ -4,8 +4,8 @@ import me.zhengjie.aop.log.Log;
import
me.zhengjie.modules.system.domain.Permission
;
import
me.zhengjie.modules.system.domain.Permission
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.modules.system.service.PermissionService
;
import
me.zhengjie.modules.system.service.PermissionService
;
import
me.zhengjie.modules.system.service.dto.CommonQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.PermissionDTO
;
import
me.zhengjie.modules.system.service.dto.PermissionDTO
;
import
me.zhengjie.modules.system.service.dto.PermissionQueryCriteria
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
@@ -41,7 +41,7 @@ public class PermissionController {
...
@@ -41,7 +41,7 @@ public class PermissionController {
@Log
(
"查询权限"
)
@Log
(
"查询权限"
)
@GetMapping
(
value
=
"/permissions"
)
@GetMapping
(
value
=
"/permissions"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_SELECT')"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','PERMISSION_ALL','PERMISSION_SELECT')"
)
public
ResponseEntity
getPermissions
(
Comm
onQueryCriteria
criteria
){
public
ResponseEntity
getPermissions
(
Permissi
onQueryCriteria
criteria
){
List
<
PermissionDTO
>
permissionDTOS
=
permissionService
.
queryAll
(
criteria
);
List
<
PermissionDTO
>
permissionDTOS
=
permissionService
.
queryAll
(
criteria
);
return
new
ResponseEntity
(
permissionService
.
buildTree
(
permissionDTOS
),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
permissionService
.
buildTree
(
permissionDTOS
),
HttpStatus
.
OK
);
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java
View file @
e471a9da
...
@@ -5,7 +5,8 @@ import me.zhengjie.aop.log.Log;
...
@@ -5,7 +5,8 @@ import me.zhengjie.aop.log.Log;
import
me.zhengjie.modules.system.domain.Role
;
import
me.zhengjie.modules.system.domain.Role
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.modules.system.service.RoleService
;
import
me.zhengjie.modules.system.service.RoleService
;
import
me.zhengjie.modules.system.service.dto.CommonQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.MenuQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.RoleQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
me.zhengjie.utils.SecurityUtils
;
import
me.zhengjie.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -58,7 +59,7 @@ public class RoleController {
...
@@ -58,7 +59,7 @@ public class RoleController {
@Log
(
"查询角色"
)
@Log
(
"查询角色"
)
@GetMapping
(
value
=
"/roles"
)
@GetMapping
(
value
=
"/roles"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','ROLES_ALL','ROLES_SELECT')"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','ROLES_ALL','ROLES_SELECT')"
)
public
ResponseEntity
getRoles
(
Common
QueryCriteria
criteria
,
Pageable
pageable
){
public
ResponseEntity
getRoles
(
Role
QueryCriteria
criteria
,
Pageable
pageable
){
return
new
ResponseEntity
(
roleService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
return
new
ResponseEntity
(
roleService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
}
}
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictService.java
View file @
e471a9da
...
@@ -2,6 +2,7 @@ package me.zhengjie.modules.system.service;
...
@@ -2,6 +2,7 @@ package me.zhengjie.modules.system.service;
import
me.zhengjie.modules.system.domain.Dict
;
import
me.zhengjie.modules.system.domain.Dict
;
import
me.zhengjie.modules.system.service.dto.DictDTO
;
import
me.zhengjie.modules.system.service.dto.DictDTO
;
import
me.zhengjie.modules.system.service.dto.DictQueryCriteria
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
...
@@ -21,7 +22,7 @@ public interface DictService {
...
@@ -21,7 +22,7 @@ public interface DictService {
* @return
* @return
*/
*/
@Cacheable
(
keyGenerator
=
"keyGenerator"
)
@Cacheable
(
keyGenerator
=
"keyGenerator"
)
Object
queryAll
(
Dict
DTO
dict
,
Pageable
pageable
);
Object
queryAll
(
Dict
QueryCriteria
dict
,
Pageable
pageable
);
/**
/**
* findById
* findById
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/MenuService.java
View file @
e471a9da
package
me.zhengjie.modules.system.service
;
package
me.zhengjie.modules.system.service
;
import
me.zhengjie.modules.system.domain.Menu
;
import
me.zhengjie.modules.system.domain.Menu
;
import
me.zhengjie.modules.system.domain.Role
;
import
me.zhengjie.modules.system.service.dto.CommonQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.MenuDTO
;
import
me.zhengjie.modules.system.service.dto.MenuDTO
;
import
me.zhengjie.modules.system.service.dto.MenuQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
/**
/**
* @author Zheng Jie
* @author Zheng Jie
...
@@ -25,7 +23,7 @@ public interface MenuService {
...
@@ -25,7 +23,7 @@ public interface MenuService {
* @return
* @return
*/
*/
@Cacheable
(
keyGenerator
=
"keyGenerator"
)
@Cacheable
(
keyGenerator
=
"keyGenerator"
)
List
<
MenuDTO
>
queryAll
(
Common
QueryCriteria
criteria
);
List
<
MenuDTO
>
queryAll
(
Menu
QueryCriteria
criteria
);
/**
/**
* get
* get
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/PermissionService.java
View file @
e471a9da
package
me.zhengjie.modules.system.service
;
package
me.zhengjie.modules.system.service
;
import
me.zhengjie.modules.system.domain.Permission
;
import
me.zhengjie.modules.system.domain.Permission
;
import
me.zhengjie.modules.system.service.dto.CommonQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.PermissionDTO
;
import
me.zhengjie.modules.system.service.dto.PermissionDTO
;
import
me.zhengjie.modules.system.service.dto.PermissionQueryCriteria
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Cacheable
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -76,5 +75,5 @@ public interface PermissionService {
...
@@ -76,5 +75,5 @@ public interface PermissionService {
* @return
* @return
*/
*/
@Cacheable
(
keyGenerator
=
"keyGenerator"
)
@Cacheable
(
keyGenerator
=
"keyGenerator"
)
List
<
PermissionDTO
>
queryAll
(
Comm
onQueryCriteria
criteria
);
List
<
PermissionDTO
>
queryAll
(
Permissi
onQueryCriteria
criteria
);
}
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/RoleService.java
View file @
e471a9da
...
@@ -2,8 +2,8 @@ package me.zhengjie.modules.system.service;
...
@@ -2,8 +2,8 @@ package me.zhengjie.modules.system.service;
import
me.zhengjie.modules.system.domain.Menu
;
import
me.zhengjie.modules.system.domain.Menu
;
import
me.zhengjie.modules.system.domain.Role
;
import
me.zhengjie.modules.system.domain.Role
;
import
me.zhengjie.modules.system.service.dto.CommonQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.RoleDTO
;
import
me.zhengjie.modules.system.service.dto.RoleDTO
;
import
me.zhengjie.modules.system.service.dto.RoleQueryCriteria
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CacheEvict
;
...
@@ -94,5 +94,5 @@ public interface RoleService {
...
@@ -94,5 +94,5 @@ public interface RoleService {
* @param criteria
* @param criteria
* @return
* @return
*/
*/
Object
queryAll
(
Common
QueryCriteria
criteria
,
Pageable
pageable
);
Object
queryAll
(
Role
QueryCriteria
criteria
,
Pageable
pageable
);
}
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDTO.java
View file @
e471a9da
package
me.zhengjie.modules.system.service.dto
;
package
me.zhengjie.modules.system.service.dto
;
import
lombok.Data
;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
/**
...
@@ -17,12 +15,10 @@ public class DictDTO implements Serializable {
...
@@ -17,12 +15,10 @@ public class DictDTO implements Serializable {
/**
/**
* 字典名称
* 字典名称
*/
*/
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
private
String
name
;
private
String
name
;
/**
/**
* 描述
* 描述
*/
*/
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
private
String
remark
;
private
String
remark
;
}
}
Prev
1
2
Next
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