Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
messageflow
Overview
Overview
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
虞诚毅
messageflow
Commits
c9795aca
Commit
c9795aca
authored
Nov 20, 2018
by
shentao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2018/11/20 事件采集url去除百度的跳转链接
parent
ed96a533
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/main/java/com/zhiwei/messageflow/service/impl/EventServiceImpl.java
+4
-2
No files found.
src/main/java/com/zhiwei/messageflow/service/impl/EventServiceImpl.java
View file @
c9795aca
...
...
@@ -37,6 +37,7 @@ import com.zhiwei.messageflow.bean.Event;
import
com.zhiwei.messageflow.config.MiddlewareConfig
;
import
com.zhiwei.messageflow.redis.service.RedisService
;
import
com.zhiwei.messageflow.service.EventService
;
import
com.zhiwei.messageflow.util.Tools
;
import
com.zhiwei.middleware.automaticmark.Service.AutomaticMarkClient
;
import
redis.clients.jedis.Tuple
;
...
...
@@ -171,13 +172,11 @@ public class EventServiceImpl implements EventService {
private
boolean
CanMsgInsert
(
JSONObject
msgJsonOb
)
{
if
(
msgJsonOb
.
containsKey
(
"time"
))
{
if
(
null
==
msgJsonOb
.
getLong
(
"time"
)
||
-
1
==
msgJsonOb
.
getLong
(
"time"
))
{
// log.info("MSG_time_Error:{}", msgJsonOb);
return
false
;
}
}
if
(
msgJsonOb
.
containsKey
(
"source"
))
{
if
(
null
==
msgJsonOb
.
getString
(
"source"
)
||
"百度网页"
.
equals
(
msgJsonOb
.
getString
(
"source"
)))
{
// log.info("MSG_Source_Error:{}", msgJsonOb);
return
false
;
}
}
...
...
@@ -194,6 +193,9 @@ public class EventServiceImpl implements EventService {
}
else
if
(!
isValidUrl
(
msgJsonOb
.
getString
(
"url"
)))
{
log
.
info
(
"MSG_url_Error_notValid:{}"
,
msgJsonOb
);
return
false
;
}
else
if
(
Tools
.
approximateStringMatching
(
msgJsonOb
.
getString
(
"url"
),
"www.baidu.com/link?url="
))
{
log
.
info
(
"MSG_url_Error_www.baidu.com/link?url=:{}"
,
msgJsonOb
);
return
false
;
}
}
if
(
msgJsonOb
.
containsKey
(
"content"
))
{
...
...
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