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
54c761ed
Commit
54c761ed
authored
Sep 10, 2019
by
裴大威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-dw-1001692' into 'master'
feat 1001692 See merge request rays/pcloud-book!149
parents
a9441ff6
02b12f81
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
SendWeixinRequestTools.java
...a/com/pcloud/book/group/tools/SendWeixinRequestTools.java
+25
-9
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendWeixinRequestTools.java
View file @
54c761ed
...
@@ -142,7 +142,7 @@ public class SendWeixinRequestTools {
...
@@ -142,7 +142,7 @@ public class SendWeixinRequestTools {
}
}
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
if
(!
CollectionUtils
.
isEmpty
(
keywords
)
&&
isGroupRobot
)
{
if
(!
CollectionUtils
.
isEmpty
(
keywords
)
&&
isGroupRobot
)
{
sb
.
append
(
"\n\n在群内回复以下关键词:\n"
);
sb
.
append
(
"\n\n在群内回复以下关键词
,领取任务或资源
:\n"
);
for
(
KeywordDTO
keyword
:
keywords
)
{
for
(
KeywordDTO
keyword
:
keywords
)
{
sb
.
append
(
"【"
).
append
(
keyword
.
getKeywords
()).
append
(
"】 "
);
sb
.
append
(
"【"
).
append
(
keyword
.
getKeywords
()).
append
(
"】 "
);
}
}
...
@@ -157,7 +157,18 @@ public class SendWeixinRequestTools {
...
@@ -157,7 +157,18 @@ public class SendWeixinRequestTools {
LOGGER
.
info
(
"发送欢迎语"
+
nickNameStr
);
LOGGER
.
info
(
"发送欢迎语"
+
nickNameStr
);
if
(
StringUtils
.
isNotEmpty
(
nickNameStr
))
{
if
(
StringUtils
.
isNotEmpty
(
nickNameStr
))
{
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
sendMessageDTO
.
getReplyType
()))
{
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
sendMessageDTO
.
getReplyType
()))
{
sendMessageDTO
.
setContent
(
nickNameStr
+
" "
+
sendMessageDTO
.
getContent
()
+
groupKeyword
.
toString
());
String
s
=
nickNameStr
+
" "
+
sendMessageDTO
.
getContent
();
// 1001692 自定义欢迎语+关键词文案,如果超过300字,关键词拆分出来发
if
(
s
.
length
()
+
groupKeyword
.
length
()
>=
300
)
{
sendMessageDTO
.
setContent
(
s
);
sendMessage
(
sendMessageDTO
,
robotId
,
weixinGroupId
,
ip
,
code
);
sendMessageDTO
.
setContent
(
groupKeyword
.
toString
().
replaceFirst
(
"\n\n"
,
""
));
sendMessage
(
sendMessageDTO
,
robotId
,
weixinGroupId
,
ip
,
code
);
i
++;
continue
;
}
else
{
sendMessageDTO
.
setContent
(
s
+
groupKeyword
.
toString
());
}
}
else
{
}
else
{
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
sendTextMessageVO
.
setContent
(
nickNameStr
);
sendTextMessageVO
.
setContent
(
nickNameStr
);
...
@@ -364,15 +375,23 @@ public class SendWeixinRequestTools {
...
@@ -364,15 +375,23 @@ public class SendWeixinRequestTools {
}
}
if
(
isHaveKeywords
){
if
(
isHaveKeywords
){
// content = content + "本群目的为学习交流和学习辅导,线上资源和工具为图书的增值服务,可根据实际情况配合图书一起使用。在群内回复以下关键词领取任务或资源:";
// content = content + "本群目的为学习交流和学习辅导,线上资源和工具为图书的增值服务,可根据实际情况配合图书一起使用。在群内回复以下关键词领取任务或资源:";
content
.
append
(
"本群目的为学习交流和学习辅导,线上资源和工具为图书的增值服务,可根据实际情况配合图书一起使用。
\n\n在群内回复以下关键词:\n
"
);
content
.
append
(
"本群目的为学习交流和学习辅导,线上资源和工具为图书的增值服务,可根据实际情况配合图书一起使用。"
);
}
}
StringBuilder
sb
=
new
StringBuilder
();
if
(!
CollectionUtils
.
isEmpty
(
keywords
)
&&
isGroupRobot
)
{
if
(!
CollectionUtils
.
isEmpty
(
keywords
)
&&
isGroupRobot
)
{
sb
.
append
(
"\n\n在群内回复以下关键词,领取任务或资源:\n"
);
for
(
KeywordDTO
keyword
:
keywords
)
{
for
(
KeywordDTO
keyword
:
keywords
)
{
content
.
append
(
"【"
).
append
(
keyword
.
getKeywords
()).
append
(
"】 "
);
sb
.
append
(
"【"
).
append
(
keyword
.
getKeywords
()).
append
(
"】 "
);
}
}
}
StringBuilder
groupKeyword
=
getGroupKeyword
(
dto
,
sb
);
// 1001692 自定义欢迎语+关键词文案,如果超过300字,关键词拆分出来发
if
((
content
.
length
()
+
sb
.
length
())
>=
300
)
{
sendTextMessage
(
content
.
toString
(),
robotId
,
weixinGroupId
,
ip
);
sendTextMessage
(
groupKeyword
.
toString
().
replaceFirst
(
"\n\n"
,
""
),
robotId
,
weixinGroupId
,
ip
);
}
else
{
sendTextMessage
(
content
.
append
(
groupKeyword
).
toString
(),
robotId
,
weixinGroupId
,
ip
);
}
}
StringBuilder
groupKeyword
=
getGroupKeyword
(
dto
,
content
);
sendTextMessage
(
groupKeyword
.
toString
(),
robotId
,
weixinGroupId
,
ip
);
}
}
private
static
StringBuilder
getGroupKeyword
(
KeywordStatusDTO
dto
,
StringBuilder
sb
)
{
private
static
StringBuilder
getGroupKeyword
(
KeywordStatusDTO
dto
,
StringBuilder
sb
)
{
...
@@ -388,9 +407,6 @@ public class SendWeixinRequestTools {
...
@@ -388,9 +407,6 @@ public class SendWeixinRequestTools {
if
(
dto
.
getClockOpen
())
{
if
(
dto
.
getClockOpen
())
{
sb
.
append
(
"【"
).
append
(
dto
.
getClockKeyword
()).
append
(
"】 "
);
sb
.
append
(
"【"
).
append
(
dto
.
getClockKeyword
()).
append
(
"】 "
);
}
}
if
(
StringUtil
.
isNotBlank
(
sb
)
&&
sb
.
toString
().
contains
(
"【"
))
{
sb
.
append
(
",领取任务或资源"
);
}
return
sb
;
return
sb
;
}
}
...
...
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