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
fab61e8c
Commit
fab61e8c
authored
Feb 15, 2020
by
zhuyajie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不重复回复
parent
f312b886
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+17
-1
WxGroupSendNotTextListener.java
.../com/pcloud/book/mq/topic/WxGroupSendNotTextListener.java
+1
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
fab61e8c
...
...
@@ -693,7 +693,15 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
}
if
(
pcloudKeyword
!=
null
){
//走关键词
log
.
info
(
"查询平台端关键词"
+
pcloudKeyword
.
toString
());
log
.
info
(
"查询平台端关键词"
+
pcloudKeyword
.
toString
()+
"id="
+
pcloudKeyword
.
getId
());
//3min不回复同一关键词
String
key
=
"BOOK:PCLOUD_KEYWORD:"
+
userWxId
+
"-"
+
robotId
+
"-"
+
pcloudKeyword
.
getId
();
String
redisContent
=
JedisClusterUtils
.
getJson
(
key
,
String
.
class
);
if
(!
StringUtil
.
isEmpty
(
redisContent
)){
return
;
}
else
{
JedisClusterUtils
.
setJson
(
key
,
userWxId
,
3
*
60
);
}
List
<
PcloudKeywordReply
>
replies
=
pcloudKeywordReplyDao
.
getByRelevance
(
RelevanceTypeEnum
.
KEYWORD
.
value
,
pcloudKeyword
.
getId
());
if
(
MethodEnum
.
RANDOM
.
value
.
equals
(
pcloudKeyword
.
getMethod
())){
int
a
=
(
int
)
Math
.
floor
(
Math
.
random
()*
replies
.
size
());
...
...
@@ -1032,6 +1040,14 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
@ParamLog
(
"非关键词响应"
)
@Override
public
void
sendPcloudNotKeyWord
(
String
userWxId
,
String
ip
,
Integer
code
,
String
robotId
,
Long
pcloudClassifyId
)
{
//1min不重复回复
String
key
=
"BOOK:PCLOUD_NOT_KEYWORD:"
+
userWxId
+
"-"
+
robotId
+
"-"
+
pcloudClassifyId
;
String
redisContent
=
JedisClusterUtils
.
getJson
(
key
,
String
.
class
);
if
(!
StringUtil
.
isEmpty
(
redisContent
)){
return
;
}
else
{
JedisClusterUtils
.
setJson
(
key
,
userWxId
,
60
);
}
//走非关键词
List
<
PcloudNotKeyword
>
notKeywords
=
pcloudNotKeywordDao
.
getPcloudNotKeywordList
(
pcloudClassifyId
);
if
(!
ListUtils
.
isEmpty
(
notKeywords
)){
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/WxGroupSendNotTextListener.java
View file @
fab61e8c
...
...
@@ -6,6 +6,7 @@ import com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.wechatgroup.message.dto.SendNotTextDTO
;
import
lombok.extern.slf4j.Slf4j
;
...
...
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