mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-07 23:24:39 +08:00
🆕 #3397【企业微信】增加会议室预定管理相关接口
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package me.chanjar.weixin.cp.api;
|
||||
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.cp.bean.oa.meetingroom.WxCpOaMeetingRoom;
|
||||
import me.chanjar.weixin.cp.bean.oa.meetingroom.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -59,17 +59,110 @@ public interface WxCpOaMeetingRoomService {
|
||||
void editMeetingRoom(WxCpOaMeetingRoom meetingRoom) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 编辑会议室.
|
||||
* 删除会议室.
|
||||
* <pre>
|
||||
* 该接口用于通过应用在企业内编辑会议室。
|
||||
* 企业可通过此接口删除指定的会议室。
|
||||
* 请求方式: POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/meetingroom/del?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* 文档地址:https://developer.work.weixin.qq.com/document/path/93619
|
||||
* </pre>
|
||||
*
|
||||
* @param meetingRoomId 会议室对象
|
||||
* @param meetingRoomId 会议室ID
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
void deleteMeetingRoom(Integer meetingRoomId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 查询会议室的预定信息.
|
||||
* <pre>
|
||||
* 企业可通过此接口查询相关会议室在指定时间段的预定情况,如是否已被预定,预定者的userid等信息,不支持跨天查询。
|
||||
* 请求方式: POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/meetingroom/get_booking_info?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* 文档地址:https://developer.work.weixin.qq.com/document/path/93620
|
||||
* </pre>
|
||||
*
|
||||
* @param wxCpOaMeetingRoomBookingInfoRequest 会议室预定信息查询对象
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
WxCpOaMeetingRoomBookingInfoResult getMeetingRoomBookingInfo(WxCpOaMeetingRoomBookingInfoRequest wxCpOaMeetingRoomBookingInfoRequest) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 预定会议室.
|
||||
* <pre>
|
||||
* 企业可通过此接口预定会议室并自动关联日程。
|
||||
* 请求方式: POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/meetingroom/book?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* 文档地址:https://developer.work.weixin.qq.com/document/path/93620
|
||||
* </pre>
|
||||
*
|
||||
* @param wxCpOaMeetingRoomBookRequest 会议室预定对象
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
WxCpOaMeetingRoomBookResult bookingMeetingRoom(WxCpOaMeetingRoomBookRequest wxCpOaMeetingRoomBookRequest) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 通过日程预定会议室.
|
||||
* <pre>
|
||||
* 企业可通过此接口为指定日程预定会议室,支持重复日程预定。
|
||||
* 请求方式: POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/meetingroom/book_by_schedule?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* 文档地址:https://developer.work.weixin.qq.com/document/path/93620
|
||||
* </pre>
|
||||
*
|
||||
* @param wxCpOaMeetingRoomBookByScheduleRequest 会议室预定对象
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
WxCpOaMeetingRoomBookResult bookingMeetingRoomBySchedule(WxCpOaMeetingRoomBookByScheduleRequest wxCpOaMeetingRoomBookByScheduleRequest) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 通过会议预定会议室.
|
||||
* <pre>
|
||||
* 企业可通过此接口为指定会议预定会议室,支持重复会议预定。
|
||||
* 请求方式: POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/meetingroom/book_by_meeting?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* 文档地址:https://developer.work.weixin.qq.com/document/path/93620
|
||||
* </pre>
|
||||
*
|
||||
* @param wxCpOaMeetingRoomBookByMeetingRequest 会议室预定对象
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
WxCpOaMeetingRoomBookResult bookingMeetingRoomByMeeting(WxCpOaMeetingRoomBookByMeetingRequest wxCpOaMeetingRoomBookByMeetingRequest) throws WxErrorException;
|
||||
|
||||
|
||||
/**
|
||||
* 取消预定会议室.
|
||||
* <pre>
|
||||
* 企业可通过此接口取消会议室的预定
|
||||
* 请求方式: POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/meetingroom/cancel_book?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* 文档地址:https://developer.work.weixin.qq.com/document/path/93620
|
||||
* </pre>
|
||||
*
|
||||
* @param wxCpOaMeetingRoomCancelBookRequest 取消预定会议室对象
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
void cancelBookMeetingRoom(WxCpOaMeetingRoomCancelBookRequest wxCpOaMeetingRoomCancelBookRequest) throws WxErrorException;
|
||||
|
||||
|
||||
/**
|
||||
* 根据会议室预定ID查询预定详情.
|
||||
* <pre>
|
||||
* 企业可通过此接口根据预定id查询相关会议室的预定情况
|
||||
* 请求方式: POST(HTTPS)
|
||||
* 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/meetingroom/bookinfo/get?access_token=ACCESS_TOKEN
|
||||
*
|
||||
* 文档地址:https://developer.work.weixin.qq.com/document/path/93620
|
||||
* </pre>
|
||||
*
|
||||
* @param wxCpOaMeetingRoomBookingInfoByBookingIdRequest 根据会议室预定ID查询预定详情对象
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
WxCpOaMeetingRoomBookingInfoByBookingIdResult getBookingInfoByBookingId(WxCpOaMeetingRoomBookingInfoByBookingIdRequest wxCpOaMeetingRoomBookingInfoByBookingIdRequest) throws WxErrorException;
|
||||
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.common.util.json.GsonParser;
|
||||
import me.chanjar.weixin.cp.api.WxCpOaMeetingRoomService;
|
||||
import me.chanjar.weixin.cp.api.WxCpService;
|
||||
import me.chanjar.weixin.cp.bean.oa.meetingroom.WxCpOaMeetingRoom;
|
||||
import me.chanjar.weixin.cp.bean.oa.meetingroom.*;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.util.List;
|
||||
@@ -48,4 +48,40 @@ public class WxCpOaMeetingRoomServiceImpl implements WxCpOaMeetingRoomService {
|
||||
this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_DEL),
|
||||
GsonHelper.buildJsonObject("meetingroom_id", meetingRoomId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpOaMeetingRoomBookingInfoResult getMeetingRoomBookingInfo(WxCpOaMeetingRoomBookingInfoRequest wxCpOaMeetingRoomBookingInfoRequest) throws WxErrorException {
|
||||
String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_GET_BOOKING_INFO), wxCpOaMeetingRoomBookingInfoRequest);
|
||||
return WxCpOaMeetingRoomBookingInfoResult.fromJson(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpOaMeetingRoomBookResult bookingMeetingRoom(WxCpOaMeetingRoomBookRequest wxCpOaMeetingRoomBookRequest) throws WxErrorException {
|
||||
String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_BOOK), wxCpOaMeetingRoomBookRequest);
|
||||
return WxCpOaMeetingRoomBookResult.fromJson(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpOaMeetingRoomBookResult bookingMeetingRoomBySchedule(WxCpOaMeetingRoomBookByScheduleRequest wxCpOaMeetingRoomBookByScheduleRequest) throws WxErrorException {
|
||||
String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_BOOK_BY_SCHEDULE), wxCpOaMeetingRoomBookByScheduleRequest);
|
||||
return WxCpOaMeetingRoomBookResult.fromJson(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpOaMeetingRoomBookResult bookingMeetingRoomByMeeting(WxCpOaMeetingRoomBookByMeetingRequest wxCpOaMeetingRoomBookByMeetingRequest) throws WxErrorException {
|
||||
String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_BOOK_BY_MEETING), wxCpOaMeetingRoomBookByMeetingRequest);
|
||||
return WxCpOaMeetingRoomBookResult.fromJson(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelBookMeetingRoom(WxCpOaMeetingRoomCancelBookRequest wxCpOaMeetingRoomCancelBookRequest) throws WxErrorException {
|
||||
this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_CANCEL_BOOK), wxCpOaMeetingRoomCancelBookRequest);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpOaMeetingRoomBookingInfoByBookingIdResult getBookingInfoByBookingId(WxCpOaMeetingRoomBookingInfoByBookingIdRequest wxCpOaMeetingRoomBookingInfoByBookingIdRequest) throws WxErrorException {
|
||||
String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_BOOKINFO_GET), wxCpOaMeetingRoomBookingInfoByBookingIdRequest);
|
||||
return WxCpOaMeetingRoomBookingInfoByBookingIdResult.fromJson(response);
|
||||
}
|
||||
}
|
||||
|
@@ -386,6 +386,19 @@ public class WxCpXmlMessage implements Serializable {
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String calId;
|
||||
|
||||
/**
|
||||
* 会议室ID.
|
||||
*/
|
||||
@XStreamAlias("MeetingRoomId")
|
||||
private String meetingRoomId;
|
||||
|
||||
/**
|
||||
* 会议室预定id,可根据该ID查询具体的会议预定情况
|
||||
*/
|
||||
@XStreamAlias("BookingId")
|
||||
@XStreamConverter(value = XStreamCDataConverter.class)
|
||||
private String bookingId;
|
||||
|
||||
/**
|
||||
* 扩展属性.
|
||||
*/
|
||||
|
@@ -0,0 +1,50 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import me.chanjar.weixin.common.bean.ToJson;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 通过会议预定会议室
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WxCpOaMeetingRoomBookByMeetingRequest implements Serializable, ToJson {
|
||||
private static final long serialVersionUID = 2825289798463742531L;
|
||||
/**
|
||||
* 会议室Id
|
||||
*/
|
||||
@SerializedName("meetingroom_id")
|
||||
private Integer meetingroomId;
|
||||
/**
|
||||
* 会议id,仅可使用同应用创建的会议
|
||||
*/
|
||||
@SerializedName("meetingid")
|
||||
private String meetingid;
|
||||
/**
|
||||
* 预定人的userid
|
||||
*/
|
||||
@SerializedName("booker")
|
||||
private String booker;
|
||||
|
||||
|
||||
@Override
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import me.chanjar.weixin.common.bean.ToJson;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 通过日程预定会议室
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WxCpOaMeetingRoomBookByScheduleRequest implements Serializable, ToJson {
|
||||
private static final long serialVersionUID = 2825289798463742532L;
|
||||
/**
|
||||
* 会议室Id
|
||||
*/
|
||||
@SerializedName("meetingroom_id")
|
||||
private Integer meetingroomId;
|
||||
/**
|
||||
* 日程id,仅可使用同应用创建的日程
|
||||
*/
|
||||
@SerializedName("schedule_id")
|
||||
private String schedule_id;
|
||||
/**
|
||||
* 预定人的userid
|
||||
*/
|
||||
@SerializedName("booker")
|
||||
private String booker;
|
||||
|
||||
|
||||
@Override
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import me.chanjar.weixin.common.bean.ToJson;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预定会议室的请求类
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WxCpOaMeetingRoomBookRequest implements Serializable, ToJson {
|
||||
private static final long serialVersionUID = 2825289798463742536L;
|
||||
/**
|
||||
* 会议室Id
|
||||
*/
|
||||
@SerializedName("meetingroom_id")
|
||||
private Integer meetingroomId;
|
||||
/**
|
||||
* 预定开始时间
|
||||
*/
|
||||
@SerializedName("start_time")
|
||||
private Integer startTime;
|
||||
/**
|
||||
* 预定结束时间
|
||||
*/
|
||||
@SerializedName("end_time")
|
||||
private Integer endTime;
|
||||
/**
|
||||
* 会议主题
|
||||
*/
|
||||
@SerializedName("subject")
|
||||
private String subject;
|
||||
/**
|
||||
* 预定人的userid
|
||||
*/
|
||||
@SerializedName("booker")
|
||||
private String booker;
|
||||
/**
|
||||
* 参与人的userid列表
|
||||
*/
|
||||
@SerializedName("attendees")
|
||||
private List<String> attendees;
|
||||
|
||||
@Override
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预定会议室的返回结果类
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
public class WxCpOaMeetingRoomBookResult extends WxCpBaseResp implements Serializable {
|
||||
private static final long serialVersionUID = -4993287594652231098L;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
public static WxCpOaMeetingRoomBookResult fromJson(String json) {
|
||||
return WxCpGsonBuilder.create().fromJson(json, WxCpOaMeetingRoomBookResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会议室的预定id
|
||||
*/
|
||||
@SerializedName("booking_id")
|
||||
private String booking_id;
|
||||
/**
|
||||
* 会议关联日程的id
|
||||
*/
|
||||
@SerializedName("schedule_id")
|
||||
private String schedule_id;
|
||||
/**
|
||||
* 通过会议预定会议室 和 通过日程预定会议室 接口返回
|
||||
* <br/>
|
||||
* 会议室冲突日期列表,为当天0点的时间戳;使用重复会议预定会议室,部分日期与会议室预定情况冲突时返回
|
||||
*/
|
||||
@SerializedName("conflict_date")
|
||||
private List<Integer> conflict_date;
|
||||
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import me.chanjar.weixin.common.bean.ToJson;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 根据会议室预定ID查询预定详情请求类
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WxCpOaMeetingRoomBookingInfoByBookingIdRequest implements Serializable, ToJson {
|
||||
private static final long serialVersionUID = 2825289798463742533L;
|
||||
/**
|
||||
* 会议室id
|
||||
*/
|
||||
@SerializedName("meetingroom_id")
|
||||
private Integer meetingroom_id;
|
||||
/**
|
||||
* 会议室的预定id
|
||||
*/
|
||||
@SerializedName("booking_id")
|
||||
private String booking_id;
|
||||
|
||||
|
||||
@Override
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 根据会议室预定ID查询预定详情返回结果类
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
public class WxCpOaMeetingRoomBookingInfoByBookingIdResult extends WxCpBaseResp implements Serializable {
|
||||
private static final long serialVersionUID = -4993287594652231097L;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
public static WxCpOaMeetingRoomBookingInfoByBookingIdResult fromJson(String json) {
|
||||
return WxCpGsonBuilder.create().fromJson(json, WxCpOaMeetingRoomBookingInfoByBookingIdResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会议室ID
|
||||
*/
|
||||
@SerializedName("meetingroom_id")
|
||||
private Integer meetingroomId;
|
||||
/**
|
||||
* 该会议室查询时间段内的预定情况
|
||||
*/
|
||||
@SerializedName("schedule")
|
||||
private Schedule schedule;
|
||||
|
||||
|
||||
@Data
|
||||
public static class Schedule {
|
||||
/**
|
||||
* 会议室的预定id
|
||||
*/
|
||||
@SerializedName("booking_id")
|
||||
private String bookingId;
|
||||
/**
|
||||
* 会议关联日程的id,若会议室已取消预定(未保留日历),则schedule_id将无法再获取到日程详情
|
||||
*/
|
||||
@SerializedName("schedule_id")
|
||||
private String scheduleId;
|
||||
/**
|
||||
* 开始时间的时间戳
|
||||
*/
|
||||
@SerializedName("start_time")
|
||||
private Integer startTime;
|
||||
/**
|
||||
* 结束时间的时间戳
|
||||
*/
|
||||
@SerializedName("end_time")
|
||||
private Integer endTime;
|
||||
/**
|
||||
* 预定人的userid
|
||||
*/
|
||||
@SerializedName("booker")
|
||||
private String booker;
|
||||
/**
|
||||
* 会议室的预定状态,0:已预定 、2:申请中、3:审批中
|
||||
*/
|
||||
@SerializedName("status")
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,64 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import me.chanjar.weixin.common.bean.ToJson;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 查询会议室的预定信息的请求类
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WxCpOaMeetingRoomBookingInfoRequest implements Serializable, ToJson {
|
||||
private static final long serialVersionUID = 2825289798463742534L;
|
||||
/**
|
||||
* 会议室Id
|
||||
*/
|
||||
@SerializedName("meetingroom_id")
|
||||
private Integer meetingroomId;
|
||||
/**
|
||||
* 查询预定的起始时间,默认为当前时间
|
||||
*/
|
||||
@SerializedName("start_time")
|
||||
private Integer startTime;
|
||||
/**
|
||||
* 查询预定的结束时间, 默认为明日0时
|
||||
*/
|
||||
@SerializedName("end_time")
|
||||
private Integer endTime;
|
||||
/**
|
||||
* 会议室所在城市
|
||||
*/
|
||||
@SerializedName("city")
|
||||
private String city;
|
||||
/**
|
||||
* 会议室所在楼宇
|
||||
*/
|
||||
@SerializedName("building")
|
||||
private String building;
|
||||
/**
|
||||
* 会议室所在楼层
|
||||
*/
|
||||
@SerializedName("floor")
|
||||
private String floor;
|
||||
|
||||
@Override
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,85 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 查询会议室的预定信息的返回结果类
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
public class WxCpOaMeetingRoomBookingInfoResult extends WxCpBaseResp implements Serializable {
|
||||
private static final long serialVersionUID = -4993287594652231095L;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
public static WxCpOaMeetingRoomBookingInfoResult fromJson(String json) {
|
||||
return WxCpGsonBuilder.create().fromJson(json, WxCpOaMeetingRoomBookingInfoResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会议室预订信息列表
|
||||
*/
|
||||
@SerializedName("booking_list")
|
||||
private List<Booking> bookingList;
|
||||
|
||||
@Data
|
||||
public static class Booking {
|
||||
/**
|
||||
* 会议室ID
|
||||
*/
|
||||
@SerializedName("meetingroom_id")
|
||||
private Integer meetingroomId;
|
||||
/**
|
||||
* 该会议室查询时间段内的预定情况
|
||||
*/
|
||||
@SerializedName("schedule")
|
||||
private List<Schedule> schedule;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Schedule {
|
||||
/**
|
||||
* 会议室的预定id
|
||||
*/
|
||||
@SerializedName("booking_id")
|
||||
private String bookingId;
|
||||
/**
|
||||
* 会议关联日程的id,若会议室已取消预定(未保留日历),则schedule_id将无法再获取到日程详情
|
||||
*/
|
||||
@SerializedName("schedule_id")
|
||||
private String scheduleId;
|
||||
/**
|
||||
* 开始时间的时间戳
|
||||
*/
|
||||
@SerializedName("start_time")
|
||||
private Integer startTime;
|
||||
/**
|
||||
* 结束时间的时间戳
|
||||
*/
|
||||
@SerializedName("end_time")
|
||||
private Integer endTime;
|
||||
/**
|
||||
* 预定人的userid
|
||||
*/
|
||||
@SerializedName("booker")
|
||||
private String booker;
|
||||
/**
|
||||
* 会议室的预定状态,0:已预定 、2:申请中、3:审批中
|
||||
*/
|
||||
@SerializedName("status")
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package me.chanjar.weixin.cp.bean.oa.meetingroom;
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import me.chanjar.weixin.common.bean.ToJson;
|
||||
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 取消预定会议室请求类
|
||||
*
|
||||
* @author <a href="https://github.com/llw5181">小梁</a>
|
||||
* @version 1.0 Create by 2024/10/28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WxCpOaMeetingRoomCancelBookRequest implements Serializable, ToJson {
|
||||
private static final long serialVersionUID = 2825289798463742539L;
|
||||
/**
|
||||
* 会议室的预定id
|
||||
*/
|
||||
@SerializedName("booking_id")
|
||||
private String booking_id;
|
||||
/**
|
||||
* 是否保留日程,0-同步删除 1-保留,仅对非重复日程有效
|
||||
*/
|
||||
@SerializedName("keep_schedule")
|
||||
private Integer keep_schedule;
|
||||
/**
|
||||
* 对于重复日程,如果不填写此参数,表示取消所有重复预定;如果填写,则表示取消对应日期当天的会议室预定
|
||||
*/
|
||||
@SerializedName("cancel_date")
|
||||
private Integer cancel_date;
|
||||
|
||||
|
||||
@Override
|
||||
public String toJson() {
|
||||
return WxCpGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
@@ -423,6 +423,30 @@ public interface WxCpApiPathConsts {
|
||||
* The constant MEETINGROOM_DEL.
|
||||
*/
|
||||
String MEETINGROOM_DEL = "/cgi-bin/oa/meetingroom/del";
|
||||
/**
|
||||
* The constant MEETINGROOM_GET_BOOKING_INFO.
|
||||
*/
|
||||
String MEETINGROOM_GET_BOOKING_INFO = "/cgi-bin/oa/meetingroom/get_booking_info";
|
||||
/**
|
||||
* The constant MEETINGROOM_BOOK.
|
||||
*/
|
||||
String MEETINGROOM_BOOK = "/cgi-bin/oa/meetingroom/book";
|
||||
/**
|
||||
* The constant MEETINGROOM_BOOK_BY_SCHEDULE.
|
||||
*/
|
||||
String MEETINGROOM_BOOK_BY_SCHEDULE = "/cgi-bin/oa/meetingroom/book_by_schedule";
|
||||
/**
|
||||
* The constant MEETINGROOM_BOOK_BY_MEETING.
|
||||
*/
|
||||
String MEETINGROOM_BOOK_BY_MEETING = "/cgi-bin/oa/meetingroom//book_by_meeting";
|
||||
/**
|
||||
* The constant MEETINGROOM_CANCEL_BOOK.
|
||||
*/
|
||||
String MEETINGROOM_CANCEL_BOOK = "/cgi-bin/oa/meetingroom/cancel_book";
|
||||
/**
|
||||
* The constant MEETINGROOM_BOOKINFO_GET.
|
||||
*/
|
||||
String MEETINGROOM_BOOKINFO_GET = "/cgi-bin/oa/meetingroom/bookinfo/get";
|
||||
|
||||
/**
|
||||
* 微盘
|
||||
|
@@ -144,6 +144,21 @@ public class WxCpConsts {
|
||||
*/
|
||||
public static final String DELETE_SCHEDULE = "delete_schedule";
|
||||
|
||||
/**
|
||||
* 日程回执事件
|
||||
*/
|
||||
public static final String RESPOND_SCHEDULE = "respond_schedule";
|
||||
|
||||
/**
|
||||
* 会议室预定事件.
|
||||
*/
|
||||
public static final String BOOK_MEETING_ROOM = "book_meeting_room";
|
||||
|
||||
/**
|
||||
* 会议室取消事件.
|
||||
*/
|
||||
public static final String CANCEL_MEETING_ROOM = "cancel_meeting_room";
|
||||
|
||||
/**
|
||||
* 家校通讯录事件
|
||||
*/
|
||||
|
@@ -4,7 +4,7 @@ import com.google.inject.Inject;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.cp.api.ApiTestModule;
|
||||
import me.chanjar.weixin.cp.api.WxCpService;
|
||||
import me.chanjar.weixin.cp.bean.oa.meetingroom.WxCpOaMeetingRoom;
|
||||
import me.chanjar.weixin.cp.bean.oa.meetingroom.*;
|
||||
import org.testng.annotations.Guice;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -73,10 +73,10 @@ public class WxCpOaMeetingRoomServiceImplTest {
|
||||
public void testGet() throws WxErrorException {
|
||||
final List<WxCpOaMeetingRoom> meetingRooms =
|
||||
this.wxService.getOaMeetingRoomService().listMeetingRoom(WxCpOaMeetingRoom.builder()
|
||||
.building("腾讯大厦")
|
||||
.city("深圳")
|
||||
.equipment(Arrays.asList(1, 2))
|
||||
.build());
|
||||
.building("腾讯大厦")
|
||||
.city("深圳")
|
||||
.equipment(Arrays.asList(1, 2))
|
||||
.build());
|
||||
assertThat(meetingRooms).isNotEmpty();
|
||||
}
|
||||
|
||||
@@ -90,4 +90,56 @@ public class WxCpOaMeetingRoomServiceImplTest {
|
||||
Integer calId = 1;
|
||||
this.wxService.getOaMeetingRoomService().deleteMeetingRoom(calId);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetMeetingRoomBookingInfo() throws WxErrorException {
|
||||
final WxCpOaMeetingRoomBookingInfoResult meetingRoomBookingInfo = this.wxService.getOaMeetingRoomService().getMeetingRoomBookingInfo(WxCpOaMeetingRoomBookingInfoRequest.builder()
|
||||
.meetingroomId(19)
|
||||
.build());
|
||||
System.out.println(meetingRoomBookingInfo);
|
||||
assertThat(meetingRoomBookingInfo).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBookingMeetingRoom() throws WxErrorException {
|
||||
WxCpOaMeetingRoomBookResult wxCpOaMeetingRoomBookResult = this.wxService.getOaMeetingRoomService().bookingMeetingRoom(WxCpOaMeetingRoomBookRequest.builder().subject("测试会议").meetingroomId(19).startTime(1730118646).endTime(1730120446).booker("LiangLinWei").attendees(Arrays.asList("LiangLinWei", "ZhaoYuCheng")).build());
|
||||
System.out.println(wxCpOaMeetingRoomBookResult);
|
||||
assertThat(wxCpOaMeetingRoomBookResult).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBookingMeetingRoomBySchedule() throws WxErrorException {
|
||||
WxCpOaMeetingRoomBookResult wxCpOaMeetingRoomBookResult = this.wxService.getOaMeetingRoomService().bookingMeetingRoomBySchedule(WxCpOaMeetingRoomBookByScheduleRequest.builder()
|
||||
.booker("LiangLinWei")
|
||||
.meetingroomId(19)
|
||||
.schedule_id("bkWChLPrv9YpPRLeeYU-uFwl9BQX3G2_rQYQRg1W1uR3A")
|
||||
.build());
|
||||
System.out.println(wxCpOaMeetingRoomBookResult);
|
||||
assertThat(wxCpOaMeetingRoomBookResult).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBookingMeetingRoomByMeeting() throws WxErrorException {
|
||||
WxCpOaMeetingRoomBookResult wxCpOaMeetingRoomBookResult = this.wxService.getOaMeetingRoomService().bookingMeetingRoomByMeeting(WxCpOaMeetingRoomBookByMeetingRequest.builder()
|
||||
.booker("LiangLinWei")
|
||||
.meetingroomId(19)
|
||||
.meetingid("bkWChLPrv9YpPRLeeYU-uFwl9BQX3G2_rQYQRg1W1uR3A")
|
||||
.build());
|
||||
System.out.println(wxCpOaMeetingRoomBookResult);
|
||||
assertThat(wxCpOaMeetingRoomBookResult).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCancelBookMeetingRoom() throws WxErrorException {
|
||||
this.wxService.getOaMeetingRoomService().cancelBookMeetingRoom(WxCpOaMeetingRoomCancelBookRequest.builder().booking_id("bkWChLPrv9YpPRLeeYU-uFwl9BQX3G2_rQYQRg1W1uR3A").build());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetBookingInfoByBookingId() throws WxErrorException {
|
||||
WxCpOaMeetingRoomBookingInfoByBookingIdResult bookingInfoByBookingId = this.wxService.getOaMeetingRoomService().getBookingInfoByBookingId(WxCpOaMeetingRoomBookingInfoByBookingIdRequest.builder().meetingroom_id(19).booking_id("bkWChLPrv9YpPRLeeYU-uFwl9BQX3G2_rQYQRg1W1uR3A").build());
|
||||
System.out.println(bookingInfoByBookingId);
|
||||
assertThat(bookingInfoByBookingId).isNotNull();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user