1 package com.foxinmy.weixin4j.tuple;
2
3 import javax.xml.bind.annotation.XmlElement;
4 import javax.xml.bind.annotation.XmlTransient;
5
6 import com.alibaba.fastjson.annotation.JSONCreator;
7 import com.alibaba.fastjson.annotation.JSONField;
8
9
10
11
12
13
14
15
16
17
18
19
20
21 public class Video implements NotifyTuple {
22
23 private static final long serialVersionUID = 2167437425244069128L;
24
25 @Override
26 public String getMessageType() {
27 return "video";
28 }
29
30
31
32
33 @JSONField(name = "media_id")
34 @XmlElement(name = "MediaId")
35 private String mediaId;
36
37
38
39 @JSONField(name = "thumb_media_id")
40 @XmlTransient
41 private String thumbMediaId;
42
43
44
45 @XmlElement(name = "Title")
46 private String title;
47
48
49
50 @JSONField(name = "description")
51 @XmlElement(name = "Description")
52 private String desc;
53
54
55
56
57
58
59
60
61
62
63
64 public Video(String mediaId, String title, String desc) {
65 this(mediaId, null, title, desc);
66 }
67
68
69
70
71
72
73
74
75
76
77
78
79
80 @JSONCreator
81 public Video(@JSONField(name = "mediaId") String mediaId,
82 @JSONField(name = "thumbMediaId") String thumbMediaId,
83 @JSONField(name = "title") String title,
84 @JSONField(name = "desc") String desc) {
85 this.mediaId = mediaId;
86 this.thumbMediaId = thumbMediaId;
87 this.title = title;
88 this.desc = desc;
89 }
90
91 public String getMediaId() {
92 return mediaId;
93 }
94
95 public String getThumbMediaId() {
96 return thumbMediaId;
97 }
98
99 public String getTitle() {
100 return title;
101 }
102
103 public String getDesc() {
104 return desc;
105 }
106
107 @Override
108 public String toString() {
109 return "Video [thumbMediaId=" + thumbMediaId + ", title=" + title
110 + ", desc=" + desc + ", mediaId=" + mediaId + "]";
111 }
112 }