Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 361cda45
authored
Dec 15, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
群发内容为空
1 parent
ae1d1a26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
linkwe-common/src/main/java/com/linkwechat/common/enums/MessageType.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageTemplateServiceImpl.java
linkwe-common/src/main/java/com/linkwechat/common/enums/MessageType.java
View file @
361cda4
...
...
@@ -15,63 +15,63 @@ public enum MessageType {
/**
* 文本消息
*/
TEXT
(
"0"
,
"text"
),
TEXT
(
"0"
,
"text"
,
"文本"
),
/**
* 图片消息
*/
IMAGE
(
"1"
,
"image"
),
IMAGE
(
"1"
,
"image"
,
"图片"
),
/**
* 语音消息
*/
VOICE
(
"2"
,
"voice"
),
VOICE
(
"2"
,
"voice"
,
"语音"
),
/**
* 视频消息
*/
VIDEO
(
"3"
,
"video"
),
VIDEO
(
"3"
,
"video"
,
"视频"
),
/**
* 文件消息
*/
FILE
(
"4"
,
"file"
),
FILE
(
"4"
,
"file"
,
"文件"
),
/**
* 文本卡片消息
*/
TEXTCARD
(
"5"
,
"textcard"
),
TEXTCARD
(
"5"
,
"textcard"
,
"文本卡片"
),
/**
* 图文消息
*/
NEWS
(
"6"
,
"news"
),
NEWS
(
"6"
,
"news"
,
"图文"
),
/**
* 图文消息(mpnews)
*/
MPNEWS
(
"7"
,
"mpnews"
),
MPNEWS
(
"7"
,
"mpnews"
,
"图文"
),
/**
* markdown消息
*/
MARKDOWN
(
"8"
,
"markdown"
),
MARKDOWN
(
"8"
,
"markdown"
,
"markdown"
),
/**
* 小程序通知消息
*/
MINIPROGRAM_NOTICE
(
"9"
,
"miniprogram_notice"
),
MINIPROGRAM_NOTICE
(
"9"
,
"miniprogram_notice"
,
"小程序"
),
/**
* 任务卡片消息
*/
TASKCARD
(
"10"
,
"taskcard"
),
TASKCARD
(
"10"
,
"taskcard"
,
"任务卡片"
),
/**
* 群发图文消息
*/
LINK
(
"11"
,
"link"
),
LINK
(
"11"
,
"link"
,
"链接"
),
/**
* 群发小程序
*/
MINIPROGRAM
(
"12"
,
"miniprogram"
),
MINIPROGRAM
(
"12"
,
"miniprogram"
,
"小程序"
),
;
/**
...
...
@@ -80,13 +80,19 @@ public enum MessageType {
String
messageType
;
/**
* 媒体名称
*/
String
name
;
/**
* 数据值
*/
String
type
;
MessageType
(
String
type
,
String
messageType
)
{
MessageType
(
String
type
,
String
messageType
,
String
name
)
{
this
.
type
=
type
;
this
.
messageType
=
messageType
;
this
.
name
=
name
;
}
public
static
Optional
<
MessageType
>
of
(
String
type
)
{
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageTemplateServiceImpl.java
View file @
361cda4
...
...
@@ -180,6 +180,10 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
if
(
query
.
getSendTime
()
==
null
){
weGroupMessageTemplate
.
setSendTime
(
new
Date
());
}
if
(
StringUtils
.
isEmpty
(
query
.
getContent
())
&&
CollectionUtil
.
isNotEmpty
(
query
.
getAttachmentsList
())){
String
msgContent
=
query
.
getAttachmentsList
().
stream
().
map
(
item
->
MessageType
.
messageTypeOf
(
item
.
getMsgType
()).
getName
()).
collect
(
Collectors
.
joining
(
","
));
weGroupMessageTemplate
.
setContent
(
msgContent
);
}
try
{
if
(
save
(
weGroupMessageTemplate
))
{
query
.
setId
(
weGroupMessageTemplate
.
getId
());
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment