From d3f82164b7960075ba430e4d2e4e0f3bc723283b Mon Sep 17 00:00:00 2001
From: Hugo <52446959+Hugo-Ho@users.noreply.github.com>
Date: Sat, 2 Mar 2024 18:05:52 +0800
Subject: [PATCH] =?UTF-8?q?:new:=20#3228=20=E3=80=90=E4=BC=81=E4=B8=9A?=
=?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E5=8A=9E=E5=85=AC?=
=?UTF-8?q?-=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6=E6=A8=A1=E5=9D=97?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/cp/api/WxCpOaMailService.java | 57 ++++
.../cp/api/impl/WxCpOMailServiceImpl.java | 80 ++++++
.../oa/mail/WxCpMailCommonSendRequest.java | 244 +++++++++++++++++
.../oa/mail/WxCpMailMeetingSendRequest.java | 239 +++++++++++++++++
.../oa/mail/WxCpMailScheduleSendRequest.java | 246 ++++++++++++++++++
.../weixin/cp/constant/WxCpApiPathConsts.java | 9 +
6 files changed, 875 insertions(+)
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaMailService.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOMailServiceImpl.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailCommonSendRequest.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailMeetingSendRequest.java
create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailScheduleSendRequest.java
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaMailService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaMailService.java
new file mode 100644
index 000000000..07786080f
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaMailService.java
@@ -0,0 +1,57 @@
+package me.chanjar.weixin.cp.api;
+
+import lombok.NonNull;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.cp.bean.WxCpBaseResp;
+import me.chanjar.weixin.cp.bean.oa.mail.WxCpMailCommonSendRequest;
+import me.chanjar.weixin.cp.bean.oa.mail.WxCpMailMeetingSendRequest;
+import me.chanjar.weixin.cp.bean.oa.mail.WxCpMailScheduleSendRequest;
+
+/**
+ * 企业微信y邮件相关接口.
+ * 邮件
+ *
+ * @author Hugo
+ */
+public interface WxCpOaMailService {
+
+ /**
+ * 发送普通邮件
+ * 应用可以通过该接口发送普通邮件,支持附件能力。
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址: ...
+ *
+ * @param request 发送普通邮件请求参数
+ * @return wx cp base resp
+ * @throws WxErrorException the wx error exception
+ */
+ WxCpBaseResp mailCommonSend(@NonNull WxCpMailCommonSendRequest request) throws WxErrorException;
+
+ /**
+ * 发送日程邮件
+ * 应用可以通过该接口发送日程邮件。
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址: ...
+ *
+ * @param request 发送日程邮件请求参数
+ * @return wx cp base resp
+ * @throws WxErrorException the wx error exception
+ */
+ WxCpBaseResp mailScheduleSend(@NonNull WxCpMailScheduleSendRequest request) throws WxErrorException;
+
+ /**
+ * 发送会议邮件
+ * 应用可以通过该接口发送会议邮件。
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址: ...
+ *
+ * @param request 发送会议邮件请求参数
+ * @return wx cp base resp
+ * @throws WxErrorException the wx error exception
+ */
+ WxCpBaseResp mailMeetingSend(@NonNull WxCpMailMeetingSendRequest request) throws WxErrorException;
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOMailServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOMailServiceImpl.java
new file mode 100644
index 000000000..c3844464e
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOMailServiceImpl.java
@@ -0,0 +1,80 @@
+package me.chanjar.weixin.cp.api.impl;
+
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.cp.api.WxCpOaMailService;
+import me.chanjar.weixin.cp.api.WxCpService;
+import me.chanjar.weixin.cp.bean.WxCpBaseResp;
+import me.chanjar.weixin.cp.bean.oa.mail.WxCpMailCommonSendRequest;
+import me.chanjar.weixin.cp.bean.oa.mail.WxCpMailMeetingSendRequest;
+import me.chanjar.weixin.cp.bean.oa.mail.WxCpMailScheduleSendRequest;
+
+import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Oa.EXMAIL_APP_COMPOSE_SEND;
+
+/**
+ * 企业微信邮件接口实现类.
+ *
+ * @author Hugo
+ */
+@Slf4j
+@RequiredArgsConstructor
+public class WxCpOMailServiceImpl implements WxCpOaMailService {
+ private final WxCpService cpService;
+
+ /**
+ * 发送普通邮件
+ * 应用可以通过该接口发送普通邮件,支持附件能力。
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址: ...
+ *
+ * @param request 发送普通邮件请求参数
+ * @return wx cp base resp
+ * @throws WxErrorException the wx error exception
+ */
+ @Override
+ public WxCpBaseResp mailCommonSend(@NonNull WxCpMailCommonSendRequest request) throws WxErrorException {
+ return this.mailSend(request.toJson());
+ }
+
+ /**
+ * 发送日程邮件
+ * 应用可以通过该接口发送日程邮件。
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址: ...
+ *
+ * @param request 发送日程邮件请求参数
+ * @return wx cp base resp
+ * @throws WxErrorException the wx error exception
+ */
+ @Override
+ public WxCpBaseResp mailScheduleSend(@NonNull WxCpMailScheduleSendRequest request) throws WxErrorException {
+ return this.mailSend(request.toJson());
+ }
+
+ /**
+ * 发送会议邮件
+ * 应用可以通过该接口发送会议邮件。
+ *
+ * 请求方式:POST(HTTPS)
+ * 请求地址: ...
+ *
+ * @param request 发送会议邮件请求参数
+ * @return wx cp base resp
+ * @throws WxErrorException the wx error exception
+ */
+ @Override
+ public WxCpBaseResp mailMeetingSend(@NonNull WxCpMailMeetingSendRequest request) throws WxErrorException {
+
+ return this.mailSend(request.toJson());
+ }
+
+ private WxCpBaseResp mailSend(String request) throws WxErrorException {
+ String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(EXMAIL_APP_COMPOSE_SEND);
+ String responseContent = this.cpService.post(apiUrl, request);
+ return WxCpBaseResp.fromJson(responseContent);
+ }
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailCommonSendRequest.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailCommonSendRequest.java
new file mode 100644
index 000000000..4108646d4
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailCommonSendRequest.java
@@ -0,0 +1,244 @@
+package me.chanjar.weixin.cp.bean.oa.mail;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.*;
+import lombok.experimental.Accessors;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 发送普通邮件请求.
+ *
+ * @author Hugo
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+public class WxCpMailCommonSendRequest implements Serializable {
+ private static final long serialVersionUID = -4961239393895454138L;
+
+ /**
+ * 收件人,to.emails 和 to.userids 至少传一个
+ */
+ @SerializedName("to")
+ private TO to;
+
+ /**
+ * 抄送
+ */
+ @SerializedName("cc")
+ private CC cc;
+
+ /**
+ * 文档类型, 3:文档 4:表格
+ */
+ @SerializedName("bcc")
+ private BCC bcc;
+
+ /**
+ * 标题
+ */
+ @SerializedName("subject")
+ private String subject;
+
+ /**
+ * 内容
+ */
+ @SerializedName("content")
+ private String content;
+
+ /**
+ * 附件相关
+ */
+ @SerializedName("attachment_list")
+ private List attachmentList;
+
+ /**
+ * 内容类型 html,text(默认是html)
+ */
+ @SerializedName("content_type")
+ private String contentType;
+
+ /**
+ * 表示是否开启id转译,0表示否,1表示是,默认0。仅第三方应用需要用到,企业自建应用可以忽略。
+ * 目前仅subject、content、attachment_list[].file_name字段支持转译。
+ */
+ @SerializedName("enable_id_trans")
+ private Integer enableIdTrans;
+
+ @Getter
+ @Setter
+ public static class TO implements Serializable {
+ private static final long serialVersionUID = -4860239393895754598L;
+
+ /**
+ * 收件人,邮箱地址
+ */
+ @SerializedName("emails")
+ private List emails;
+
+ /**
+ * 收件人,企业内成员的userid
+ */
+ @SerializedName("userids")
+ private List userIds;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailCommonSendRequest.TO fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailCommonSendRequest.TO.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ @Getter
+ @Setter
+ public static class CC implements Serializable {
+ private static final long serialVersionUID = -4863239393895754598L;
+
+ /**
+ * 抄送人,邮箱地址
+ */
+ @SerializedName("emails")
+ private List emails;
+
+ /**
+ * 抄送人,企业内成员的userid
+ */
+ @SerializedName("userids")
+ private List userIds;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailCommonSendRequest.CC fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailCommonSendRequest.CC.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ @Getter
+ @Setter
+ public static class BCC implements Serializable {
+ private static final long serialVersionUID = -4860239393885754598L;
+
+ /**
+ * 密送人,邮箱地址
+ */
+ @SerializedName("emails")
+ private List emails;
+
+ /**
+ * 密送人,企业内成员的userid
+ */
+ @SerializedName("userids")
+ private List userIds;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailCommonSendRequest.BCC fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailCommonSendRequest.BCC.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ @Getter
+ @Setter
+ public static class Attachment implements Serializable {
+ private static final long serialVersionUID = -4860230393895754598L;
+
+ /**
+ * 文件名
+ */
+ @SerializedName("file_name")
+ private String fileName;
+
+ /**
+ * 文件内容(base64编码),所有附件加正文的大小不允许超过50M, 且附件个数不能超过200个
+ */
+ @SerializedName("content")
+ private String content;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailCommonSendRequest.Attachment fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailCommonSendRequest.Attachment.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ /**
+ * From json wx cp space create request.
+ *
+ * @param json the json
+ * @return the wx cp space create request
+ */
+ public static WxCpMailCommonSendRequest fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailCommonSendRequest.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailMeetingSendRequest.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailMeetingSendRequest.java
new file mode 100644
index 000000000..e9e2f802b
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailMeetingSendRequest.java
@@ -0,0 +1,239 @@
+package me.chanjar.weixin.cp.bean.oa.mail;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.*;
+import lombok.experimental.Accessors;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 发送会议邮件请求.
+ *
+ * @author Hugo
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+public class WxCpMailMeetingSendRequest extends WxCpMailScheduleSendRequest implements Serializable {
+ private static final long serialVersionUID = -4961279393895454138L;
+
+ /**
+ * 会议相关,会议邮件必填,且必须同时带上schedule,会议的基本设置放在schedule里
+ */
+ @SerializedName("meeting")
+ private Meeting meeting;
+
+ @Getter
+ @Setter
+ public static class Meeting implements Serializable {
+ private static final long serialVersionUID = -4860239393895754598L;
+
+ /**
+ * 会议相关设置
+ */
+ @SerializedName("option")
+ private Option option;
+
+ /**
+ * 会议主持人列表,最多10个。定义见收件人字段,只支持填userid
+ */
+ @SerializedName("hosts")
+ private Hosts hosts;
+
+ /**
+ * 会议管理员字段, , 仅可指定1人,只支持传userid,必须是同企业的用户,且在参与人中
+ */
+ @SerializedName("meeting_admins")
+ private MeetingAdmins meetingAdmins;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailMeetingSendRequest.Meeting fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailMeetingSendRequest.Meeting.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ @Getter
+ @Setter
+ public static class Option implements Serializable {
+ private static final long serialVersionUID = -4860239393895754598L;
+
+ /**
+ * 入会密码,仅可输入4-6位纯数字
+ */
+ @SerializedName("password")
+ private String password;
+
+ /**
+ * 是否自动录制
+ * 0:未开启自动录制,1:开启自动本地录制,2:开启自动云录制;默认不开启
+ */
+ @SerializedName("auto_record")
+ private Integer autoRecord;
+
+ /**
+ * 是否开启等候室
+ * false:不开启等候室;true:开启等候室;默认不开
+ */
+ @SerializedName("enable_waiting_room")
+ private Boolean enableWaitingRoom;
+
+ /**
+ * 是否允许成员在主持人进会前加入。
+ * true:允许;false:不允许。默认允许
+ */
+ @SerializedName("allow_enter_before_host")
+ private Boolean allowEnterBeforeHost;
+
+ /**
+ * 是否限制成员入会
+ * 0:所有人可入会 2:仅企业内部用户可入会;默认所有人可入会
+ */
+ @SerializedName("enter_restraint")
+ private Integer enterRestraint;
+
+ /**
+ * 是否开启屏幕水印
+ * true:开启;false:不开启。默认不开启
+ */
+ @SerializedName("enable_screen_watermark")
+ private Boolean enableScreenWatermark;
+
+ /**
+ * 成员入会时是否静音
+ * 1:开启;0:关闭;2:超过6人后自动开启静音。默认超过6人自动开启静音
+ */
+ @SerializedName("enable_enter_mute")
+ private Integer enableEnterMute;
+
+ /**
+ * 会议开始时是否提醒
+ * 1:不提醒 2:仅提醒主持人 3:提醒所有成员入会; 默认仅提醒主持人
+ */
+ @SerializedName("remind_scope")
+ private Integer remindScope;
+
+ /**
+ * 水印类型
+ * 0:单排水印 1:多排水印;默认单排水印
+ */
+ @SerializedName("water_mark_type")
+ private Integer waterMarkType;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailMeetingSendRequest.Option fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailMeetingSendRequest.Option.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ @Getter
+ @Setter
+ public static class Hosts implements Serializable {
+ private static final long serialVersionUID = -4860239393895754598L;
+
+ @SerializedName("userids")
+ private List userIds;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailMeetingSendRequest.Hosts fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailMeetingSendRequest.Hosts.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ @Getter
+ @Setter
+ public static class MeetingAdmins implements Serializable {
+ private static final long serialVersionUID = -4860239393895754598L;
+
+ @SerializedName("userids")
+ private List userIds;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailMeetingSendRequest.MeetingAdmins fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailMeetingSendRequest.MeetingAdmins.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ /**
+ * From json wx cp space create request.
+ *
+ * @param json the json
+ * @return the wx cp space create request
+ */
+ public static WxCpMailMeetingSendRequest fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailMeetingSendRequest.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailScheduleSendRequest.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailScheduleSendRequest.java
new file mode 100644
index 000000000..d9666e1b7
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/mail/WxCpMailScheduleSendRequest.java
@@ -0,0 +1,246 @@
+package me.chanjar.weixin.cp.bean.oa.mail;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.*;
+import lombok.experimental.Accessors;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 发送日程邮件请求.
+ *
+ * @author Hugo
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+public class WxCpMailScheduleSendRequest extends WxCpMailCommonSendRequest implements Serializable {
+ private static final long serialVersionUID = -4961279393895454138L;
+
+ /**
+ * 标题
+ */
+ @SerializedName("schedule")
+ private Schedule schedule;
+
+ @Getter
+ @Setter
+ public static class Schedule implements Serializable {
+ private static final long serialVersionUID = -4860239393895754598L;
+
+ /**
+ * 日程ID (修改/取消日程必须带上schedule_id)
+ */
+ @SerializedName("is_remind")
+ private String scheduleId;
+
+ /**
+ * 日程方法:
+ * request-请求(不传schedule_id时是创建日程,传了是修改日程)
+ *
+ * cancel-取消日程(必须带上schedule_id)
+ *
+ * 默认为request
+ */
+ @SerializedName("method")
+ private String method;
+
+ /**
+ * 地点
+ */
+ @SerializedName("location")
+ private String location;
+
+ /**
+ * 日程开始时间,Unix时间戳
+ */
+ @SerializedName("start_time")
+ private Integer startTime;
+
+ /**
+ * 日程结束时间,Unix时间戳
+ */
+ @SerializedName("end_time")
+ private Integer endTime;
+
+ /**
+ * 重复和提醒相关字段
+ */
+ @SerializedName("reminders")
+ private Reminders reminders;
+
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailScheduleSendRequest.Schedule fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailScheduleSendRequest.Schedule.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ @Getter
+ @Setter
+ public static class Reminders implements Serializable {
+ private static final long serialVersionUID = -4860239393895754598L;
+
+ /**
+ * 是否有提醒 0-不提醒 1-提醒
+ */
+ @SerializedName("is_remind")
+ private Integer isRemind;
+
+ /**
+ * 日程开始(start_time)前多少分钟提醒,当is_remind=1时有效。例如:
+ * 15表示日程开始前15分钟提醒
+ *
+ * -15表示日程开始后15分钟提醒
+ */
+ @SerializedName("remind_before_event_mins")
+ private Integer remindBeforeEventMins;
+
+ /**
+ * 是否重复 0-否 1-是
+ */
+ @SerializedName("is_repeat")
+ private Integer isRepeat;
+
+ /**
+ * 是否自定义重复 0-否 1-是。当is_repeat为1时有效。
+ */
+ @SerializedName("is_custom_repeat")
+ private Integer isCustomRepeat;
+
+ /**
+ * 时区。UTC偏移量表示(即偏离零时区的小时数),东区为正数,西区为负数。
+ * 例如:+8 表示北京时间东八区
+ *
+ * 默认为北京时间东八区
+ *
+ * 取值范围:-12 ~ +12
+ */
+ @SerializedName("timezone")
+ private Integer timeZone;
+
+ /**
+ * 重复间隔
+ * 仅当指定为自定义重复时有效,该字段随repeat_type不同而含义不同
+ *
+ * 例如:
+ *
+ * repeat_interval指定为2,repeat_type指定为每周重复,那么每2周重复一次;
+ *
+ * repeat_interval指定为2,repeat_type指定为每月重复,那么每2月重复一次
+ */
+ @SerializedName("repeat_interval")
+ private Integer repeatInterval;
+
+ /**
+ * 重复类型,当is_repeat=1时有效。目前支持如下类型:
+ * 0 - 每日
+ *
+ * 1 - 每周
+ *
+ * 2 - 每月
+ *
+ * 5 - 每年
+ */
+ @SerializedName("repeat_type")
+ private Integer repeatType;
+
+ /**
+ * 每周周几重复
+ * 仅当指定为自定义重复且重复类型为每周时有效
+ *
+ * 取值范围:1 ~ 7,分别表示周一至周日
+ */
+ @SerializedName("repeat_day_of_week")
+ private List repeatDayOfWeek;
+
+ /**
+ * 每月哪几天重复
+ * 仅当指定为自定义重复, 且重复类型为每月或每年时有效
+ *
+ * 取值范围:1 ~ 31,分别表示1~31号
+ */
+ @SerializedName("repeat_day_of_month")
+ private List repeatDayOfMonth;
+
+ /**
+ * 标题
+ */
+ @SerializedName("repeat_week_of_month")
+ private List repeatWeekOfMonth;
+
+ /**
+ * 每年哪几个月重复
+ * 仅当指定为自定义重复且重复类型为每年时有效
+ *
+ * 取值范围:1 ~ 12,分别表示 1月 - 12月(每年重复需要repeat_month_of_year和repeat_day_of_month来指定某一天)
+ */
+ @SerializedName("repeat_month_of_year")
+ private List repeatMonthOfYear;
+
+ /**
+ * 重复结束时刻,Unix时间戳,当is_repeat=1时有效。不填或填0表示一直重复
+ */
+ @SerializedName("repeat_until")
+ private Integer repeatUntil;
+
+ /**
+ * From json space info.
+ *
+ * @param json the json
+ * @return the space info
+ */
+ public static WxCpMailScheduleSendRequest.Reminders fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailScheduleSendRequest.Reminders.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+ }
+
+ /**
+ * From json wx cp space create request.
+ *
+ * @param json the json
+ * @return the wx cp space create request
+ */
+ public static WxCpMailScheduleSendRequest fromJson(String json) {
+ return WxCpGsonBuilder.create().fromJson(json, WxCpMailScheduleSendRequest.class);
+ }
+
+ /**
+ * To json string.
+ *
+ * @return the string
+ */
+ public String toJson() {
+ return WxCpGsonBuilder.create().toJson(this);
+ }
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
index af870445f..dd41d9b8b 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
@@ -533,6 +533,15 @@ public interface WxCpApiPathConsts {
*/
String WEDOC_DOC_SHARE = "/cgi-bin/wedoc/doc_share";
+ /**
+ * 邮件
+ * https://developer.work.weixin.qq.com/document/path/95486
+ */
+ /**
+ * The constant EXMAIL_APP_COMPOSE_SEND.
+ */
+ String EXMAIL_APP_COMPOSE_SEND = "/cgi-bin/exmail/app/compose_send";
+
}
/**