Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
6f2732de
Commit
6f2732de
authored
Jul 12, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
7899f85d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
CommonLogService.java
.../github/wxiaoqi/security/common/log/CommonLogService.java
+7
-0
CommonLogServiceImpl.java
...xiaoqi/security/common/log/Impl/CommonLogServiceImpl.java
+6
-1
XxLogInterceptor.java
.../github/wxiaoqi/security/common/log/XxLogInterceptor.java
+6
-1
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/log/CommonLogService.java
View file @
6f2732de
...
@@ -37,6 +37,13 @@ public interface CommonLogService {
...
@@ -37,6 +37,13 @@ public interface CommonLogService {
*/
*/
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
BaseResponse
result
);
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
BaseResponse
result
);
/**
* 初始化日志后半部分(String)
* @param xxLogEntity
* @param result
*/
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
String
result
);
/**
/**
* 初始化FeignClient日志前半部分
* 初始化FeignClient日志前半部分
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/log/Impl/CommonLogServiceImpl.java
View file @
6f2732de
...
@@ -104,9 +104,14 @@ public class CommonLogServiceImpl implements CommonLogService {
...
@@ -104,9 +104,14 @@ public class CommonLogServiceImpl implements CommonLogService {
@Override
@Override
public
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
BaseResponse
result
)
{
public
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
BaseResponse
result
)
{
initCommonLogLastPart
(
xxLogEntity
,
JSON
.
toJSONString
(
result
));
}
@Override
public
void
initCommonLogLastPart
(
XxLogEntity
xxLogEntity
,
String
result
)
{
LocalDateTime
endTime
=
LocalDateTime
.
now
();
//结束时间
LocalDateTime
endTime
=
LocalDateTime
.
now
();
//结束时间
xxLogEntity
.
setEndDate
(
endTime
.
toString
());
xxLogEntity
.
setEndDate
(
endTime
.
toString
());
xxLogEntity
.
setResponseData
(
JSON
.
toJSONString
(
result
)
);
xxLogEntity
.
setResponseData
(
result
);
}
}
@Override
@Override
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/log/XxLogInterceptor.java
View file @
6f2732de
package
com
.
github
.
wxiaoqi
.
security
.
common
.
log
;
package
com
.
github
.
wxiaoqi
.
security
.
common
.
log
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.log.CommonLogService
;
import
com.github.wxiaoqi.security.common.log.CommonLogService
;
import
com.github.wxiaoqi.security.common.log.entity.XxLogEntity
;
import
com.github.wxiaoqi.security.common.log.entity.XxLogEntity
;
...
@@ -54,7 +55,11 @@ public class XxLogInterceptor{
...
@@ -54,7 +55,11 @@ public class XxLogInterceptor{
//###################上面代码为方法执行前#####################
//###################上面代码为方法执行前#####################
result
=
pjp
.
proceed
();
//执行方法,获取返回参数
result
=
pjp
.
proceed
();
//执行方法,获取返回参数
//###################下面代码为方法执行后#####################
//###################下面代码为方法执行后#####################
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
(
BaseResponse
)
result
);
if
(
result
instanceof
JSONObject
)
{
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
((
JSONObject
)
result
).
toJSONString
());
}
else
{
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
(
BaseResponse
)
result
);
}
}
catch
(
BaseException
e
){
}
catch
(
BaseException
e
){
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
ObjectRestResponse
.
createFailedResult
(
e
.
getStatus
(),
e
.
getMessage
()));
commonLogService
.
initCommonLogLastPart
(
xxLogEntity
,
ObjectRestResponse
.
createFailedResult
(
e
.
getStatus
(),
e
.
getMessage
()));
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
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