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
6e6ebce5
Commit
6e6ebce5
authored
Oct 14, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改截取规则
parent
4d78f867
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
46 deletions
+33
-46
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+33
-46
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
6e6ebce5
...
...
@@ -645,66 +645,68 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
if
(
i
==
1
||
i
==
2
)
{
text
=
text
+
"🔥"
;
}
text
=
text
+
i
+
"."
+
bookGroupServe
.
getServeName
()
+
bookGroupServe
.
getShortUrl
()
+
"\n"
;
String
content
=
text
+
i
+
"."
+
bookGroupServe
.
getServeName
()
+
bookGroupServe
.
getShortUrl
()
+
"\n"
;
if
(
content
.
length
()
>
LE
)
{
sendText
(
sendTextDTO
,
text
);
text
=
""
;
}
else
{
text
=
content
;
}
i
=
i
+
1
;
}
}
else
{
text
=
text
+
"《"
+
bookName
+
"》"
+
"还没有配置资源服务,敬请期待。\n"
;
}
//获取配套关键词。先去掉,后面可能需要再加上
// List<KeywordDTO> keywordDTOS = getListByBookGroupId(bookGroupId);
// if (!ListUtils.isEmpty(keywordDTOS)) {
// text = text + "回复括号内关键词领取本书配套资源学习资料:\n";
// for (KeywordDTO keywordDTO : keywordDTOS) {
// if (!StringUtil.isEmpty(keywordDTO.getKeywords())) {
// text = text + "【" + keywordDTO.getKeywords() + "】";
// }
// }
// text = text + "\n";
// }
//邀请进群
if
(
isInviteGroup
!=
null
&&
isInviteGroup
)
{
//获取社群码下的分类
List
<
ListClassifyVO
>
listClassifyVOS
=
bookGroupClassifyBiz
.
listAllClassify
(
bookGroupId
);
if
(!
ListUtils
.
isEmpty
(
listClassifyVOS
))
{
text
=
text
+
"======================\n"
;
String
content
=
text
+
"======================\n"
;
if
(
content
.
length
()
>
LE
)
{
sendText
(
sendTextDTO
,
text
);
text
=
""
;
}
else
{
text
=
content
;
}
if
(
listClassifyVOS
.
size
()
==
1
)
{
ListClassifyVO
listClassifyVO
=
listClassifyVOS
.
get
(
0
);
//如果只有一个分类
text
=
text
+
"☕本书还配有交流群“"
+
listClassifyVO
.
getClassify
()
+
"”,"
+
listClassifyVO
.
getClassifyIntroduce
()
+
",点击下方邀请链接,即可进群"
;
//发送欢迎语
if
(
text
.
length
()
>
LE
)
{
sendTextBatch
(
sendTextDTO
,
text
,
LE
);
}
else
{
String
contents
=
text
+
"☕本书还配有交流群“"
+
listClassifyVO
.
getClassify
()
+
"”,"
+
listClassifyVO
.
getClassifyIntroduce
()
+
",点击下方邀请链接,即可进群"
;
if
(
contents
.
length
()
>
LE
)
{
sendText
(
sendTextDTO
,
text
);
text
=
""
;
}
else
{
text
=
contents
;
}
sendText
(
sendTextDTO
,
text
);
dealGroupInvite
(
sendTextDTO
,
listClassifyVO
.
getId
(),
listClassifyVO
.
getChangeNumber
());
}
else
{
text
=
text
+
"☕本书还配有以下交流群,选择你想加入的微信群,回复群名称,我会拉你入群!\n"
;
for
(
ListClassifyVO
listClassifyVO
:
listClassifyVOS
)
{
text
=
text
+
"☑"
+
listClassifyVO
.
getClassify
()
+
":"
+
listClassifyVO
.
getClassifyIntroduce
()
+
"\n"
;
}
//发送欢迎语
if
(
text
.
length
()
>
LE
)
{
sendTextBatch
(
sendTextDTO
,
text
,
LE
);
}
else
{
sendText
(
sendTextDTO
,
text
);
String
contents
=
text
+
"☑"
+
listClassifyVO
.
getClassify
()
+
":"
+
listClassifyVO
.
getClassifyIntroduce
()
+
"\n"
;
if
(
contents
.
length
()
>
LE
)
{
sendText
(
sendTextDTO
,
text
);
text
=
""
;
}
else
{
text
=
contents
;
}
}
sendText
(
sendTextDTO
,
text
);
}
return
;
}
}
//发送配置的资源服务和关键词
if
(
text
.
length
()
>
LE
)
{
sendTextBatch
(
sendTextDTO
,
text
,
LE
);
}
else
{
sendText
(
sendTextDTO
,
text
);
}
//发送配置的资源服务
sendText
(
sendTextDTO
,
text
);
}
@ParamLog
(
"发送收到暗号后的本书介绍"
)
private
void
sendText
(
SendTextDTO
sendTextDTO
,
String
content
)
{
if
(
StringUtil
.
isEmpty
(
content
)){
return
;
}
String
userWxId
=
sendTextDTO
.
getWechatUserId
();
String
ip
=
sendTextDTO
.
getIp
();
Integer
code
=
sendTextDTO
.
getCode
();
...
...
@@ -720,21 +722,6 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
log
.
info
(
"发送收到暗号后的本书介绍 : {}"
,
vo
);
}
@ParamLog
(
"发送收到暗号后的本书介绍"
)
private
void
sendTextBatch
(
SendTextDTO
sendTextDTO
,
String
content
,
Integer
le
)
{
List
<
String
>
contents
=
new
ArrayList
<>();
String
s
=
content
;
while
(
s
.
length
()
>
le
)
{
contents
.
add
(
s
.
substring
(
0
,
le
));
s
=
s
.
substring
(
le
,
s
.
length
());
}
contents
.
add
(
s
);
for
(
String
sin
:
contents
)
{
sendText
(
sendTextDTO
,
sin
);
}
}
@ParamLog
(
"分类群发送邀请入群链接"
)
private
void
dealGroupInvite
(
SendTextDTO
sendTextDTO
,
Long
classifyId
,
Integer
changeNumber
)
{
//获取分类基本信息
...
...
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