Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
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
YZG
yzg-util
Commits
56714b5d
Commit
56714b5d
authored
Mar 17, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改公式和计算帮助类
parent
a6d551eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
BaseRequestAspect.java
...ain/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
+3
-3
LogLocal.java
...oud/src/main/java/com/yanzuoguang/cloud/aop/LogLocal.java
+16
-4
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/BaseRequestAspect.java
View file @
56714b5d
...
...
@@ -245,10 +245,10 @@ public class BaseRequestAspect {
// 日志请求不记录,防止死循环递归
boolean
isLog
=
isLog
(
name
,
log
.
getActionSubKey
());
if
(
isLog
)
{
return
;
}
// 正常请求不记录
logLocal
.
remove
(
log
);
}
else
{
logLocal
.
result
(
log
,
responseResult
.
getCode
(),
JsonHelper
.
serialize
(
responseResult
));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/LogLocal.java
View file @
56714b5d
...
...
@@ -88,7 +88,7 @@ public class LogLocal implements ThreadNext.Next, InitializingBean {
*/
public
void
result
(
LogVo
log
,
String
status
,
String
result
)
{
Timeout
<
LogVo
>
timeout
=
cache
.
get
(
log
.
getLogId
());
result
(
timeout
,
log
,
status
,
result
);
result
(
timeout
,
log
,
status
,
result
,
true
);
}
/**
...
...
@@ -98,7 +98,7 @@ public class LogLocal implements ThreadNext.Next, InitializingBean {
* @param result
* @return
*/
p
ublic
void
result
(
Timeout
timeout
,
LogVo
log
,
String
status
,
String
result
)
{
p
rivate
void
result
(
Timeout
timeout
,
LogVo
log
,
String
status
,
String
result
,
boolean
write
)
{
if
(
timeout
!=
null
)
{
long
useTime
=
System
.
currentTimeMillis
()
-
timeout
.
getStart
();
log
.
setUseTime
((
int
)
useTime
);
...
...
@@ -108,8 +108,20 @@ public class LogLocal implements ThreadNext.Next, InitializingBean {
if
(!
StringHelper
.
compare
(
status
,
MAX_TIME
))
{
cache
.
remove
(
log
.
getLogId
());
}
if
(
write
)
{
logBase
.
addLog
(
log
);
}
}
/**
* 删除请求信息
*
* @param log
*/
public
void
remove
(
LogVo
log
)
{
Timeout
<
LogVo
>
timeout
=
cache
.
get
(
log
.
getLogId
());
result
(
timeout
,
log
,
StringHelper
.
EMPTY
,
StringHelper
.
EMPTY
,
false
);
}
/**
* 记录超时
...
...
@@ -117,7 +129,7 @@ public class LogLocal implements ThreadNext.Next, InitializingBean {
* @return
*/
private
void
writeTimeout
(
Timeout
<
LogVo
>
timeout
)
{
result
(
timeout
,
timeout
.
getData
(),
MAX_TIME
,
MAX_TIME_NAME
);
result
(
timeout
,
timeout
.
getData
(),
MAX_TIME
,
MAX_TIME_NAME
,
true
);
}
/**
...
...
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