Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调整企业群发消息任务字段 && 增加主部门字段 #2391

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.cp.bean.external.msg.Image;
import me.chanjar.weixin.cp.bean.external.msg.Link;
import me.chanjar.weixin.cp.bean.external.msg.MiniProgram;
import me.chanjar.weixin.cp.bean.external.msg.Text;
import me.chanjar.weixin.cp.bean.external.msg.*;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

import java.io.Serializable;
Expand All @@ -19,7 +16,7 @@
* <p>
* Created by songfan on 2020/7/14.
*
* @author songfan
* @author songfan & Mr.Pan
*/
@Data
@Builder
Expand All @@ -28,21 +25,32 @@
public class WxCpMsgTemplate implements Serializable {
private static final long serialVersionUID = 3172331565173474358L;

/**
* 群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
*/
@SerializedName("chat_type")
private String chatType;

/**
* 客户的外部联系人id列表,仅在chat_type为single时有效,不可与sender同时为空,最多可传入1万个客户
*/
@SerializedName("external_userid")
private List<String> externalUserid;

/**
* 发送企业群发消息的成员userid,当类型为发送给客户群时必填
*/
private String sender;

/**
* 消息文本内容,最多4000个字节
*/
private Text text;

private Image image;

private Link link;

private MiniProgram miniprogram;
/**
* 附件,最多支持添加9个附件
*/
private List<Attachment> attachments;

public static WxCpMsgTemplate fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpMsgTemplate.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ public class WxCpXmlMessage implements Serializable {
@XStreamConverter(value = LongArrayConverter.class)
private Long[] departments;

/**
* 主部门
*/
@XStreamAlias("MainDepartment")
private Long mainDepartment;

/**
* 手机号码.
*/
Expand Down Expand Up @@ -533,7 +539,7 @@ public static class SendPicsInfo implements Serializable {
@Data
public static class Item implements Serializable {
private static final long serialVersionUID = -6549728838848064881L;

@XStreamAlias("PicMd5Sum")
@XStreamConverter(value = XStreamCDataConverter.class)
private String picMd5Sum;
Expand Down