Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
9a76ea4c
Commit
9a76ea4c
authored
Jun 13, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全局异常处理
parent
82244f9b
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
65 additions
and
67 deletions
+65
-67
YifuAuthenticationFailureEventHandler.java
...u/auth/handler/YifuAuthenticationFailureEventHandler.java
+7
-0
YifuAuthenticationSuccessEventHandler.java
...u/auth/handler/YifuAuthenticationSuccessEventHandler.java
+8
-0
pom.xml
yifu-common/yifu-common-bom/pom.xml
+34
-5
SysLogUtils.java
.../yifu.cloud.plus.v1/yifu/common/log/util/SysLogUtils.java
+1
-0
GlobalExceptionHandler.java
...ifu/common/security/exception/GlobalExceptionHandler.java
+3
-51
spring.factories
...mon-security/src/main/resources/META-INF/spring.factories
+2
-1
SysFileServiceImpl.java
...d.plus.v1/yifu/admin/service/impl/SysFileServiceImpl.java
+2
-2
SysMenuServiceImpl.java
...d.plus.v1/yifu/admin/service/impl/SysMenuServiceImpl.java
+4
-4
SysPostServiceImpl.java
...d.plus.v1/yifu/admin/service/impl/SysPostServiceImpl.java
+1
-1
SysRoleServiceImpl.java
...d.plus.v1/yifu/admin/service/impl/SysRoleServiceImpl.java
+0
-3
GeneratorController.java
....plus.v1/yifu/codegen/controller/GeneratorController.java
+3
-0
No files found.
yifu-auth/src/main/java/com/yifu.cloud.plus.v1/yifu/auth/handler/YifuAuthenticationFailureEventHandler.java
View file @
9a76ea4c
...
@@ -17,11 +17,14 @@
...
@@ -17,11 +17,14 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
handler
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
handler
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogEvent
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogEvent
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.LogTypeEnum
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.LogTypeEnum
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.handler.AbstractAuthenticationFailureEventHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.security.handler.AbstractAuthenticationFailureEventHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.AuthenticationException
;
import
org.springframework.security.core.AuthenticationException
;
...
@@ -54,6 +57,10 @@ public class YifuAuthenticationFailureEventHandler extends AbstractAuthenticatio
...
@@ -54,6 +57,10 @@ public class YifuAuthenticationFailureEventHandler extends AbstractAuthenticatio
Long
startTime
=
System
.
currentTimeMillis
();
Long
startTime
=
System
.
currentTimeMillis
();
Long
endTime
=
System
.
currentTimeMillis
();
Long
endTime
=
System
.
currentTimeMillis
();
logVo
.
setTime
(
endTime
-
startTime
);
logVo
.
setTime
(
endTime
-
startTime
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isNotNull
(
user
)){
logVo
.
setCreateName
(
user
.
getNickname
());
}
logVo
.
setCreateBy
(
authentication
.
getName
());
logVo
.
setCreateBy
(
authentication
.
getName
());
logVo
.
setUpdateBy
(
authentication
.
getName
());
logVo
.
setUpdateBy
(
authentication
.
getName
());
SpringContextHolder
.
publishEvent
(
new
SysLogEvent
(
logVo
));
SpringContextHolder
.
publishEvent
(
new
SysLogEvent
(
logVo
));
...
...
yifu-auth/src/main/java/com/yifu.cloud.plus.v1/yifu/auth/handler/YifuAuthenticationSuccessEventHandler.java
View file @
9a76ea4c
...
@@ -17,10 +17,13 @@
...
@@ -17,10 +17,13 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
handler
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
auth
.
handler
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.SpringContextHolder
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogEvent
;
import
com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogEvent
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.handler.AbstractAuthenticationSuccessEventHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.security.handler.AbstractAuthenticationSuccessEventHandler
;
import
com.yifu.cloud.plus.v1.yifu.common.security.service.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.core.context.SecurityContextHolder
;
...
@@ -50,8 +53,13 @@ public class YifuAuthenticationSuccessEventHandler extends AbstractAuthenticatio
...
@@ -50,8 +53,13 @@ public class YifuAuthenticationSuccessEventHandler extends AbstractAuthenticatio
Long
startTime
=
System
.
currentTimeMillis
();
Long
startTime
=
System
.
currentTimeMillis
();
Long
endTime
=
System
.
currentTimeMillis
();
Long
endTime
=
System
.
currentTimeMillis
();
logVo
.
setTime
(
endTime
-
startTime
);
logVo
.
setTime
(
endTime
-
startTime
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isNotNull
(
user
)){
logVo
.
setCreateName
(
user
.
getNickname
());
}
logVo
.
setCreateBy
(
authentication
.
getName
());
logVo
.
setCreateBy
(
authentication
.
getName
());
logVo
.
setUpdateBy
(
authentication
.
getName
());
logVo
.
setUpdateBy
(
authentication
.
getName
());
SpringContextHolder
.
publishEvent
(
new
SysLogEvent
(
logVo
));
SpringContextHolder
.
publishEvent
(
new
SysLogEvent
(
logVo
));
}
}
...
...
yifu-common/yifu-common-bom/pom.xml
View file @
9a76ea4c
...
@@ -7,6 +7,40 @@
...
@@ -7,6 +7,40 @@
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-bom
</artifactId>
<artifactId>
yifu-common-bom
</artifactId>
<version>
1.0.0
</version>
<version>
1.0.0
</version>
<dependencies>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
<version>
5.3.19
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
RELEASE
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.security
</groupId>
<artifactId>
spring-security-core
</artifactId>
<version>
5.6.3
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-core
</artifactId>
</dependency>
<dependency>
<groupId>
jakarta.validation
</groupId>
<artifactId>
jakarta.validation-api
</artifactId>
<version>
2.0.2
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-security
</artifactId>
</dependency>
</dependencies>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<name>
yifu-common-bom
</name>
<name>
yifu-common-bom
</name>
...
@@ -70,11 +104,6 @@
...
@@ -70,11 +104,6 @@
<artifactId>
yifu-common-security
</artifactId>
<artifactId>
yifu-common-security
</artifactId>
<version>
${yifu.common.version}
</version>
<version>
${yifu.common.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-feign
</artifactId>
<version>
${yifu.common.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<groupId>
com.yifu.cloud.plus.v1
</groupId>
<artifactId>
yifu-common-swagger
</artifactId>
<artifactId>
yifu-common-swagger
</artifactId>
...
...
yifu-common/yifu-common-log/src/main/java/com/yifu.cloud.plus.v1/yifu/common/log/util/SysLogUtils.java
View file @
9a76ea4c
...
@@ -20,6 +20,7 @@ import cn.hutool.core.util.URLUtil;
...
@@ -20,6 +20,7 @@ import cn.hutool.core.util.URLUtil;
import
cn.hutool.extra.servlet.ServletUtil
;
import
cn.hutool.extra.servlet.ServletUtil
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
lombok.experimental.UtilityClass
;
import
lombok.experimental.UtilityClass
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
...
...
yifu-common/yifu-common-security/src/main/java/com/yifu.cloud.plus.v1/yifu/common/security/exception/GlobalExceptionHandler.java
View file @
9a76ea4c
...
@@ -5,7 +5,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ValidateCodeException;
...
@@ -5,7 +5,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ValidateCodeException;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.mybatis.spring.MyBatisSystemException
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
import
org.springframework.http.converter.HttpMessageNotReadableException
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
...
@@ -29,17 +28,6 @@ import java.util.Set;
...
@@ -29,17 +28,6 @@ import java.util.Set;
@RestControllerAdvice
@RestControllerAdvice
public
class
GlobalExceptionHandler
{
public
class
GlobalExceptionHandler
{
//指定异常执行方法
@ExceptionHandler
(
Exception
.
class
)
@ResponseStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
)
public
R
error
(
Exception
e
){
errorLog
(
e
);
if
(
null
!=
e
.
getMessage
()){
return
R
.
failed
(
"系统异常:"
+
e
.
getMessage
());
}
else
{
return
R
.
failed
(
e
,
"系统异常!"
);
}
}
/**
/**
* description:获取用户账号
* description:获取用户账号
*
*
...
@@ -68,22 +56,11 @@ public class GlobalExceptionHandler {
...
@@ -68,22 +56,11 @@ public class GlobalExceptionHandler {
public
R
exception
(
Exception
e
)
{
public
R
exception
(
Exception
e
)
{
errorLog
(
e
);
errorLog
(
e
);
if
(
null
!=
e
.
getMessage
()){
if
(
null
!=
e
.
getMessage
()){
return
R
.
failed
(
"系统异常:"
+
e
.
getMessage
());
return
R
.
failed
(
e
.
getMessage
());
}
else
{
}
else
{
return
R
.
failed
(
e
,
"系统异常!"
);
return
R
.
failed
(
e
,
"系统异常!"
);
}
}
}
}
/*@ExceptionHandler(RateLimitException.class)
@ResponseStatus(HttpStatus.TOO_MANY_REQUESTS)
public R exception(RateLimitException e) {
errorLog( e );
if( null != e.getMessage()){
return R.fail("接口限流:"+e.getMessage());
}else{
return R.fail("接口限流:接口访问到达上限,请稍后再试!",e);
}
}*/
@ExceptionHandler
({
HttpMessageNotReadableException
.
class
})
@ExceptionHandler
({
HttpMessageNotReadableException
.
class
})
@ResponseStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
)
@ResponseStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
)
...
@@ -152,38 +129,13 @@ public class GlobalExceptionHandler {
...
@@ -152,38 +129,13 @@ public class GlobalExceptionHandler {
* @param e
* @param e
* @return R
* @return R
*/
*/
@ExceptionHandler
({
ValidateCodeException
.
class
,
DataException
.
class
})
@ExceptionHandler
({
ValidateCodeException
.
class
,
DataException
.
class
})
@ResponseStatus
(
HttpStatus
.
BAD_REQUEST
)
@ResponseStatus
(
HttpStatus
.
BAD_REQUEST
)
public
R
dataExceptionHandler
(
Exception
e
)
{
public
R
dataExceptionHandler
(
Exception
e
)
{
errorLog
(
e
);
errorLog
(
e
);
R
result
=
R
.
failed
(
"数据异常:"
+
e
.
getMessage
());
R
result
=
R
.
failed
(
"数据异常:"
+
e
.
getMessage
());
return
result
;
return
result
;
}
}
/**
* 数据库异常 Exception
*
* @param e
* @return R
*/
@ExceptionHandler
({
MyBatisSystemException
.
class
})
@ResponseStatus
(
HttpStatus
.
BAD_REQUEST
)
public
R
CommunicationsExceptionHandler
(
Exception
e
)
{
errorLog
(
e
);
R
result
=
R
.
failed
(
"数据有误,如检查无误后,请联系管理员!"
);
return
result
;
}
/*@ExceptionHandler(CheckedException.class)
@ResponseStatus(HttpStatus.OK)
public R checkedException(CheckedException e) {
errorLog( e );
if( null != e.getMessage()){
return R.fail("系统异常:"+e.getMessage());
}else{
return R.fail("系统异常!",e);
}
}*/
/**
/**
* 异常打印的方法
* 异常打印的方法
* @Author pwang
* @Author pwang
...
...
yifu-common/yifu-common-security/src/main/resources/META-INF/spring.factories
View file @
9a76ea4c
...
@@ -4,5 +4,6 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
...
@@ -4,5 +4,6 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuSecurityInnerAspect,\
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuSecurityInnerAspect,\
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuTokenStoreAutoConfiguration,\
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuTokenStoreAutoConfiguration,\
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuTokenStoreAutoCleanSchedule,\
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuTokenStoreAutoCleanSchedule,\
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuSecurityMessageSourceConfiguration
com.yifu.cloud.plus.v1.yifu.common.security.component.YifuSecurityMessageSourceConfiguration,\
com.yifu.cloud.plus.v1.yifu.common.security.exception.GlobalExceptionHandler
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysFileServiceImpl.java
View file @
9a76ea4c
...
@@ -22,12 +22,12 @@ import cn.hutool.core.util.IdUtil;
...
@@ -22,12 +22,12 @@ import cn.hutool.core.util.IdUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.amazonaws.services.s3.model.S3Object
;
import
com.amazonaws.services.s3.model.S3Object
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.pig4cloud.plugin.oss.OssProperties
;
import
com.pig4cloud.plugin.oss.service.OssTemplate
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysFile
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysFile
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysFileMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysFileMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysFileService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysFileService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.pig4cloud.plugin.oss.OssProperties
;
import
com.pig4cloud.plugin.oss.service.OssTemplate
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.SneakyThrows
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysMenuServiceImpl.java
View file @
9a76ea4c
...
@@ -20,15 +20,12 @@ import cn.hutool.core.collection.CollUtil;
...
@@ -20,15 +20,12 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.SysLogDTO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysMenuMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysMenuMapper
;
...
@@ -47,7 +44,10 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -47,7 +44,10 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysPostServiceImpl.java
View file @
9a76ea4c
...
@@ -20,6 +20,7 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -20,6 +20,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysPost
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysPost
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.PostExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.PostExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysPostMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysPostMapper
;
...
@@ -27,7 +28,6 @@ import com.yifu.cloud.plus.v1.yifu.admin.service.SysPostService;
...
@@ -27,7 +28,6 @@ import com.yifu.cloud.plus.v1.yifu.admin.service.SysPostService;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysRoleServiceImpl.java
View file @
9a76ea4c
...
@@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu
;
...
@@ -31,12 +30,10 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserRole;
...
@@ -31,12 +30,10 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserRole;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMenuMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMenuMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserRoleMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserRoleMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysRoleService
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysRoleService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.enums.DictTypeEnum
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
...
...
yifu-visual/yifu-codegen/src/main/java/com/yifu.cloud.plus.v1/yifu/codegen/controller/GeneratorController.java
View file @
9a76ea4c
...
@@ -55,6 +55,9 @@ public class GeneratorController {
...
@@ -55,6 +55,9 @@ public class GeneratorController {
*/
*/
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
List
<
Map
<
String
,
Object
>>>>
getPage
(
Page
page
,
String
tableName
,
String
dsName
)
{
public
R
<
IPage
<
List
<
Map
<
String
,
Object
>>>>
getPage
(
Page
page
,
String
tableName
,
String
dsName
)
{
if
(
1
==
1
){
throw
new
RuntimeException
(
"teskdjfaskldfjklsajfdls"
);
}
return
R
.
ok
(
generatorService
.
getPage
(
page
,
tableName
,
dsName
));
return
R
.
ok
(
generatorService
.
getPage
(
page
,
tableName
,
dsName
));
}
}
...
...
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