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 a0bee74c
authored
Oct 19, 2021
by
孙喜旺
Committed by
linkwechat8856@163.com
Nov 03, 2021
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增消息群发相关接口
1 parent
853bfc69
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
32 deletions
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerMessagePushClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeGroupMsgDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeGroupMsgSendDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeGroupMsgTaskDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/query/WeAddMsgTemplateQuery.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/query/WeGetGroupMsgListQuery.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/query/WeGroupMsgListQuery.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerMessagePushClient.java
View file @
a0bee74
...
...
@@ -24,7 +24,7 @@ public interface WeCustomerMessagePushClient {
*/
@Deprecated
@Request
(
url
=
"/externalcontact/add_msg_template"
,
type
=
"POST"
)
SendMessageResultDto
sendCustomerMessageToUser
(
@
JSON
Body
WeCustomerMessagePushDto
customerMessagePushDto
);
SendMessageResultDto
sendCustomerMessageToUser
(
@Body
WeCustomerMessagePushDto
customerMessagePushDto
);
...
...
@@ -55,7 +55,7 @@ public interface WeCustomerMessagePushClient {
* @return {@link WeGroupMsgListDto}
*/
@Request
(
url
=
"/externalcontact/get_groupmsg_list_v2"
,
type
=
"POST"
)
WeGroupMsgListDto
getGroupMsg
Lis
t
(
@JSONBody
WeGroupMsgListQuery
query
);
WeGroupMsgListDto
getGroupMsg
Resul
t
(
@JSONBody
WeGroupMsgListQuery
query
);
/**
* 获取群发成员发送任务列表
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeGroupMsgDto.java
View file @
a0bee74
...
...
@@ -27,7 +27,7 @@ public class WeGroupMsgDto {
private
Long
createTime
;
@ApiModelProperty
(
"群发消息创建来源。0:企业 1:个人"
)
private
Integer
createType
;
private
String
createType
;
@ApiModelProperty
(
"消息文本内容,最多4000个字节"
)
private
WeAddMsgTemplateQuery
.
Text
text
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeGroupMsgSendDto.java
View file @
a0bee74
...
...
@@ -5,9 +5,9 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
/**
* @author
danmo
* @author
sxw
* @description 群成员发送结果列表
* @date 2021/10/
3
17:02
* @date 2021/10/
19
17:02
**/
@ApiModel
@Data
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeGroupMsgTaskDto.java
View file @
a0bee74
...
...
@@ -4,9 +4,9 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
/**
* @author
danmo
* @author
sxw
* @description 群发成员发送任务列表
* @date 2021/10/
3
16:56
* @date 2021/10/
19
16:56
**/
@Data
public
class
WeGroupMsgTaskDto
{
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/query/WeAddMsgTemplateQuery.java
View file @
a0bee74
package
com
.
linkwechat
.
wecom
.
domain
.
query
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.linkwechat.common.enums.MessageType
;
import
com.linkwechat.common.exception.wecom.WeComException
;
import
com.linkwechat.wecom.domain.WeMessageTemplate
;
import
io.swagger.annotations.ApiModel
;
...
...
@@ -37,39 +35,28 @@ public class WeAddMsgTemplateQuery {
@ApiModelProperty
(
"附件,最多支持添加9个附件 ru"
)
private
List
<
Attachments
>
attachments
;
public
void
setChat_type
(
String
chat_type
)
{
this
.
chat_type
=
chat_type
;
}
public
void
setChat_type
(
Integer
chatType
)
{
if
(
ObjectUtil
.
equal
(
2
,
chatType
)){
this
.
chat_type
=
"group"
;
}
else
{
this
.
chat_type
=
"single"
;
}
}
public
void
setAttachments
(
List
<
WeMessageTemplate
>
messageTemplates
)
{
final
int
size
=
10
;
final
int
size
=
9
;
this
.
attachments
=
new
ArrayList
<>(
16
);
if
(
CollectionUtil
.
isNotEmpty
(
messageTemplates
)
&&
messageTemplates
.
size
()
<
size
)
{
if
(
messageTemplates
!=
null
&&
messageTemplates
.
size
()
<=
size
)
{
messageTemplates
.
forEach
(
messageTemplate
->
{
if
(
ObjectUtil
.
equal
(
MessageType
.
IMAGE
.
getMessageType
()
,
messageTemplate
.
getMsgType
()))
{
if
(
ObjectUtil
.
equal
(
"image"
,
messageTemplate
.
getMsgType
()))
{
Attachments
images
=
new
Images
(
messageTemplate
.
getMsgType
(),
messageTemplate
.
getMediaId
(),
messageTemplate
.
getPicUrl
());
attachments
.
add
(
images
);
}
else
if
(
ObjectUtil
.
equal
(
MessageType
.
LINK
.
getMessageType
()
,
messageTemplate
.
getMsgType
()))
{
}
else
if
(
ObjectUtil
.
equal
(
"link"
,
messageTemplate
.
getMsgType
()))
{
Attachments
links
=
new
Links
(
messageTemplate
.
getMsgType
(),
messageTemplate
.
getTitle
(),
messageTemplate
.
getPicUrl
(),
messageTemplate
.
getDescription
(),
messageTemplate
.
getLinkUrl
());
attachments
.
add
(
links
);
}
else
if
(
ObjectUtil
.
equal
(
MessageType
.
MINIPROGRAM
.
getMessageType
()
,
messageTemplate
.
getMsgType
()))
{
}
else
if
(
ObjectUtil
.
equal
(
"miniprogram"
,
messageTemplate
.
getMsgType
()))
{
Attachments
miniprograms
=
new
Miniprograms
(
messageTemplate
.
getMsgType
(),
messageTemplate
.
getTitle
(),
messageTemplate
.
getMediaId
(),
messageTemplate
.
getAppId
(),
messageTemplate
.
getLinkUrl
());
attachments
.
add
(
miniprograms
);
}
else
if
(
ObjectUtil
.
equal
(
MessageType
.
VIDEO
.
getMessageType
()
,
messageTemplate
.
getMsgType
()))
{
}
else
if
(
ObjectUtil
.
equal
(
"video"
,
messageTemplate
.
getMsgType
()))
{
Attachments
videos
=
new
Videos
(
messageTemplate
.
getMsgType
(),
messageTemplate
.
getMediaId
());
attachments
.
add
(
videos
);
}
else
if
(
ObjectUtil
.
equal
(
MessageType
.
FILE
.
getMessageType
()
,
messageTemplate
.
getMsgType
()))
{
}
else
if
(
ObjectUtil
.
equal
(
"file"
,
messageTemplate
.
getMsgType
()))
{
Attachments
files
=
new
Files
(
messageTemplate
.
getMsgType
(),
messageTemplate
.
getMediaId
());
attachments
.
add
(
files
);
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/query/WeGetGroupMsgListQuery.java
View file @
a0bee74
...
...
@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
/**
* @author
danmo
* @author
sxw
* @description 群发成员发送任务列表入参
* @date 2021/10/19 16:49
**/
...
...
@@ -14,10 +14,10 @@ import lombok.Data;
public
class
WeGetGroupMsgListQuery
{
@ApiModelProperty
(
"群发消息的id"
)
private
String
msg
i
d
;
private
String
msg
I
d
;
@ApiModelProperty
(
"发送成员userid"
)
private
String
user
i
d
;
private
String
user
I
d
;
@ApiModelProperty
(
"返回的最大记录数,整型,最大值1000,默认值500"
)
private
Integer
limit
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/query/WeGroupMsgListQuery.java
View file @
a0bee74
...
...
@@ -25,10 +25,10 @@ public class WeGroupMsgListQuery {
private
String
creator
;
@ApiModelProperty
(
"创建人类型。0:企业发表 1:个人发表 2:所有,包括个人创建以及企业创建,默认情况下为所有类型"
)
private
Integer
filter_type
=
2
;
private
Integer
filter_type
;
@ApiModelProperty
(
"返回的最大记录数,整型,最大值100,默认值50"
)
private
Integer
limit
=
100
;
private
Integer
limit
;
@ApiModelProperty
(
"用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填"
)
private
String
cursor
;
...
...
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