OutVideoMsg.java
2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* Copyright (c) 2011-2014, James Zhan 詹波 (jfinal@126.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
*/
package com.jfinal.weixin.sdk.msg.out;
import com.jfinal.weixin.sdk.msg.in.InMsg;
/**
* <pre>
回复视频消息
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[video]]></MsgType>
<Video>
<MediaId><![CDATA[media_id]]></MediaId>
<Title><![CDATA[title]]></Title>
<Description><![CDATA[description]]></Description>
</Video>
</xml>
</pre>
*/
@SuppressWarnings("serial")
public class OutVideoMsg extends OutMsg {
private String mediaId;
private String title; // 不是必须
private String description; // 不是必须
public OutVideoMsg() {
this.msgType = "video";
}
public OutVideoMsg(InMsg inMsg) {
super(inMsg);
this.msgType = "video";
}
@Override
protected void subXml(StringBuilder sb) {
if (null == mediaId) {
throw new NullPointerException("mediaId is null");
}
sb.append("<Video>\n");
sb.append("<MediaId><![CDATA[").append(mediaId).append("]]></MediaId>\n");
sb.append("<Title><![CDATA[").append(nullToBlank(title)).append("]]></Title>\n");
sb.append("<Description><![CDATA[").append(nullToBlank(description)).append("]]></Description>\n");
sb.append("</Video>\n");
}
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}