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
abbf0ec8
Commit
abbf0ec8
authored
Jan 15, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-rsy' into 'master'
发识别码错误和请按以上指引回复准确的内容以便获取对应服务加1小时缓存 See merge request rays/pcloud-book!311
parents
54a02094
b51cce55
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
9 deletions
+36
-9
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+20
-2
SelfRobotKeywordBizImpl.java
...cloud/book/keywords/biz/impl/SelfRobotKeywordBizImpl.java
+9
-1
SelfRobotKeywordDao.java
...ava/com/pcloud/book/keywords/dao/SelfRobotKeywordDao.java
+1
-1
SelfRobotKeywordDaoImpl.java
...cloud/book/keywords/dao/impl/SelfRobotKeywordDaoImpl.java
+2
-2
SelfRobotKeyword.xml
...book/src/main/resources/mapper/group/SelfRobotKeyword.xml
+4
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
abbf0ec8
...
...
@@ -183,6 +183,10 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
*/
private
static
final
Integer
LE
=
1000
;
private
static
final
String
REPLY_GUIDE_CACHE
=
"BOOK:replyGuideCache"
;
private
static
final
String
REPLY_ERROR_SHORT_BOOK_NAME_CACHE
=
"BOOK:replyErrorShortBookNameCache"
;
@Override
@ParamLog
(
"新增关键词"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -531,7 +535,14 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
BookGroup
bookGroup
=
bookGroupDao
.
getByShortBookName
(
content
);
if
(
bookGroup
==
null
)
{
//既不是关键词也不是识别码
sendText
(
sendTextDTO
,
"请按以上指引回复准确的内容以便获取对应服务,谢谢!"
);
String
altIdAndWxId
=
sendTextDTO
.
getWxId
()
+
"_"
+
sendTextDTO
.
getWechatUserId
();
Integer
send
=
JedisClusterUtils
.
hgetJson2Class
(
REPLY_GUIDE_CACHE
,
altIdAndWxId
,
Integer
.
class
);
if
(
send
==
null
)
{
sendText
(
sendTextDTO
,
"请按以上指引回复准确的内容以便获取对应服务,谢谢!"
);
JedisClusterUtils
.
hset2Json
(
REPLY_GUIDE_CACHE
,
altIdAndWxId
,
1
);
//1小时缓存
JedisClusterUtils
.
expire
(
REPLY_GUIDE_CACHE
,
60
*
60
*
1
);
}
}
}
}
...
...
@@ -620,7 +631,14 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
//判断之前是否有关联,如果没有,提示输入正确的识别码
Long
bookGroupId
=
bookGroupCipherUserDao
.
getBookGroupIdByWxUserId
(
sendTextDTO
.
getWechatUserId
());
if
(
bookGroupId
==
null
)
{
sendText
(
sendTextDTO
,
"识别码发送错误,请核对后重新发送。"
);
String
altIdAndWxId
=
sendTextDTO
.
getWxId
()
+
"_"
+
sendTextDTO
.
getWechatUserId
();
Integer
send
=
JedisClusterUtils
.
hgetJson2Class
(
REPLY_ERROR_SHORT_BOOK_NAME_CACHE
,
altIdAndWxId
,
Integer
.
class
);
if
(
send
==
null
)
{
sendText
(
sendTextDTO
,
"识别码发送错误,请核对后重新发送。"
);
JedisClusterUtils
.
hset2Json
(
REPLY_ERROR_SHORT_BOOK_NAME_CACHE
,
altIdAndWxId
,
1
);
//1小时缓存
JedisClusterUtils
.
expire
(
altIdAndWxId
,
60
*
60
*
1
);
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/SelfRobotKeywordBizImpl.java
View file @
abbf0ec8
...
...
@@ -182,7 +182,15 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
@Override
public
String
getMaxKeyword
(
Long
bookGroupId
)
{
return
selfRobotKeywordDao
.
getMaxKeyword
(
bookGroupId
);
List
<
String
>
keywords
=
selfRobotKeywordDao
.
getKeywords
(
bookGroupId
);
Integer
max
=
0
;
for
(
String
keyword
:
keywords
)
{
Integer
iKeyword
=
new
Integer
(
keyword
);
if
(
iKeyword
>
max
)
{
max
=
iKeyword
;
}
}
return
max
.
toString
();
}
@ParamLog
(
"填充列表"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/dao/SelfRobotKeywordDao.java
View file @
abbf0ec8
...
...
@@ -28,5 +28,5 @@ public interface SelfRobotKeywordDao extends BaseDao<SelfRobotKeyword> {
void
updateSeqNum
(
Long
id
,
Integer
seqNum
);
String
getMaxKeyword
(
Long
bookGroupId
);
List
<
String
>
getKeywords
(
Long
bookGroupId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/dao/impl/SelfRobotKeywordDaoImpl.java
View file @
abbf0ec8
...
...
@@ -72,9 +72,9 @@ public class SelfRobotKeywordDaoImpl extends BaseDaoImpl<SelfRobotKeyword> imple
}
@Override
public
String
getMaxKeyword
(
Long
bookGroupId
)
{
public
List
<
String
>
getKeywords
(
Long
bookGroupId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupId"
,
bookGroupId
);
return
this
.
getSqlSession
().
select
One
(
this
.
getStatement
(
"getMaxKeyword
"
),
map
);
return
this
.
getSqlSession
().
select
List
(
this
.
getStatement
(
"getKeywords
"
),
map
);
}
}
pcloud-service-book/src/main/resources/mapper/group/SelfRobotKeyword.xml
View file @
abbf0ec8
...
...
@@ -189,9 +189,9 @@
where id=#{id}
</update>
<!--获取
最大关键词
-->
<select
id=
"get
MaxKeyword
"
parameterType=
"map"
resultType=
"string"
>
select
max(keyword)
from self_robot_keyword
<!--获取
关键词列表
-->
<select
id=
"get
Keywords
"
parameterType=
"map"
resultType=
"string"
>
select
keyword
from self_robot_keyword
where book_group_id=#{bookGroupId}
</select>
</mapper>
\ No newline at end of file
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