Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
cb687f29
Commit
cb687f29
authored
Aug 15, 2019
by
裴大威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ruansiyuan' of
http://192.168.89.173/rays/pcloud-book
into ruansiyuan
parents
311bf8ec
97ccd78b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+7
-8
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
cb687f29
...
...
@@ -426,14 +426,13 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
this
.
sendKeywordMessageToGroup
(
content
,
weixinGroupId
,
userWxId
,
robotId
,
ip
,
code
);
return
;
}
//消息为个人机器人消息时,其实weixinGroupId是机器人id
String
altId
=
weixinGroupId
;
//个人机器人接收消息的时候,weixinGroupId就是userWxId,也就是用户的id,robotId是接收的机器人的id
//简单过滤非关键词的词
if
(
StringUtil
.
isEmpty
(
content
)
||
content
.
length
()
>
20
)
{
return
;
}
// TODO 根据小号和用户id获取所有相关的分类id,若该关键词存在多本书,则组装成文本加链接一次发送
final
List
<
JoinGroupCipherDTO
>
dtos
=
bookGroupBiz
.
getClassifyIdsByWxIdAndAltId
(
alt
Id
,
robotId
);
final
List
<
JoinGroupCipherDTO
>
dtos
=
bookGroupBiz
.
getClassifyIdsByWxIdAndAltId
(
userWx
Id
,
robotId
);
if
(
CollectionUtils
.
isEmpty
(
dtos
))
{
log
.
info
(
"[关键词消息回复] classifyIds is null"
);
return
;
...
...
@@ -477,7 +476,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
final
Map
<
Long
,
GroupClassifyQrcodeDTO
>
classifyMap
=
qrcodeDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
GroupClassifyQrcodeDTO:
:
getClassifyId
,
p
->
p
,
(
v1
,
v2
)
->
v2
));
// 记录循环插入,消息一条发送
for
(
ReplyKeywordDTO
replyKeywordDTO
:
replyKeywordDTOs
)
{
log
.
info
(
"[关键词回复原始数据] : sendKeywordMessage replyKeywordDTO :{}, robotId:{}, altId:{}"
,
replyKeywordDTO
,
robotId
,
alt
Id
);
log
.
info
(
"[关键词回复原始数据] : sendKeywordMessage replyKeywordDTO :{}, robotId:{}, altId:{}"
,
replyKeywordDTO
,
robotId
,
userWx
Id
);
// 处理链接地址
Long
classifyId
=
keywordClassifyIdMap
.
get
(
replyKeywordDTO
.
getKeywordId
());
final
GroupClassifyQrcodeDTO
dto
=
classifyMap
.
get
(
classifyId
);
...
...
@@ -495,7 +494,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
replyKeywordDTO
.
setShortLinkUrl
(
UrlUtils
.
getShortUrl4Own
(
linkUrl
));
}
}
String
redisContent
=
JedisClusterUtils
.
getJson
(
"BOOK:KEYWORD:"
+
alt
Id
+
"-"
+
replyKeywordDTO
.
getKeywordId
(),
String
.
class
);
String
redisContent
=
JedisClusterUtils
.
getJson
(
"BOOK:KEYWORD:"
+
userWx
Id
+
"-"
+
replyKeywordDTO
.
getKeywordId
(),
String
.
class
);
// 同一群10秒内不回复同一关键词
if
(
insertBookKeywordRecord
(
qrcodeInfo
.
getWeixinGroupId
(),
userWxId
,
replyKeywordDTO
,
dto
,
redisContent
))
{
return
;
...
...
@@ -512,7 +511,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
}
// 单条还是按原来的发送
if
(
replyKeywordDTOs
.
size
()
<=
1
)
{
SendWeixinRequestTools
.
sendKeywordMessage
(
replyKeywordDTOs
.
get
(
0
),
robotId
,
alt
Id
,
ip
,
code
);
SendWeixinRequestTools
.
sendKeywordMessage
(
replyKeywordDTOs
.
get
(
0
),
robotId
,
userWx
Id
,
ip
,
code
);
}
else
{
// 多条时文字,应用,链接组装成一条发送
ReplyKeywordDTO
d
=
new
ReplyKeywordDTO
();
...
...
@@ -523,13 +522,13 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
}
else
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
dto
.
getReplyType
())){
sb
.
append
(
dto
.
getKeywords
()).
append
(
":"
).
append
(
dto
.
getContent
()).
append
(
"\n"
);
}
else
if
(
ReplyTypeEnum
.
IMAGE
.
value
.
equals
(
dto
.
getReplyType
()))
{
SendWeixinRequestTools
.
sendKeywordMessage
(
dto
,
robotId
,
alt
Id
,
ip
,
code
);
SendWeixinRequestTools
.
sendKeywordMessage
(
dto
,
robotId
,
userWx
Id
,
ip
,
code
);
continue
;
}
}
d
.
setContent
(
sb
.
toString
());
d
.
setReplyType
(
ReplyTypeEnum
.
TEXT
.
value
);
SendWeixinRequestTools
.
sendKeywordMessage
(
d
,
robotId
,
alt
Id
,
ip
,
code
);
SendWeixinRequestTools
.
sendKeywordMessage
(
d
,
robotId
,
userWx
Id
,
ip
,
code
);
}
}
...
...
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