Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
log-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
log-platform
Commits
f6039f3f
Commit
f6039f3f
authored
Nov 07, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改查询时间段
parent
3817c432
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
log-manager/src/main/java/com/mortals/xhx/base/framework/listener/AccessMessageConsumerListener.java
...ase/framework/listener/AccessMessageConsumerListener.java
+9
-3
log-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
...er/src/main/java/com/mortals/xhx/common/key/Constant.java
+5
-0
No files found.
log-manager/src/main/java/com/mortals/xhx/base/framework/listener/AccessMessageConsumerListener.java
View file @
f6039f3f
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.IdUtil;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.common.key.QueueKey
;
import
com.mortals.xhx.common.pdu.access.AccessLogPdu
;
import
com.mortals.xhx.module.access.model.AccessLogEntity
;
...
...
@@ -23,6 +24,7 @@ import org.springframework.boot.autoconfigure.amqp.RabbitProperties;
import
org.springframework.messaging.handler.annotation.Headers
;
import
org.springframework.messaging.handler.annotation.Payload
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
...
...
@@ -74,10 +76,14 @@ public class AccessMessageConsumerListener {
try
{
// AccessLogEntity entity =null;
//entity = JSON.parseObject(message, AccessLogEntity.class);
entity
.
setLogTime
(
entity
.
getLogTime
()
==
null
?
new
Date
():
entity
.
getLogTime
());
entity
.
setLogTime
(
entity
.
getLogTime
()
==
null
?
new
Date
()
:
entity
.
getLogTime
());
entity
.
setId
(
IdUtil
.
getSnowflake
(
0
,
1
).
nextId
());
entity
.
setCreateUserId
(
1L
);
entity
.
setCreateTime
(
new
Date
());
//判断 超过一定时间的请求 才记录
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getDuration
())
&&
entity
.
getDuration
()
<
Constant
.
ACCESS_EXPIRE_TIME
)
{
return
null
;
}
return
entity
;
}
catch
(
Exception
e
)
{
log
.
info
(
"反序列化异常"
,
e
);
...
...
log-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
View file @
f6039f3f
...
...
@@ -114,4 +114,9 @@ public final class Constant {
public
static
final
String
DISTRIBUTE_PATH
=
"distribute_path"
;
/**
* 访问超时时间,默认2秒
*/
public
static
final
Long
ACCESS_EXPIRE_TIME
=
2000L
;
}
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