1 package com.foxinmy.weixin4j.tuple;
2
3 import javax.xml.bind.annotation.XmlElement;
4
5 import com.alibaba.fastjson.annotation.JSONField;
6
7
8
9
10
11
12
13
14
15
16
17
18
19 public class Music implements NotifyTuple {
20
21 private static final long serialVersionUID = -5952134916367253297L;
22
23 @Override
24 public String getMessageType() {
25 return "music";
26 }
27
28
29
30
31 @XmlElement(name = "Title")
32 private String title;
33
34
35
36 @JSONField(name = "description")
37 @XmlElement(name = "Description")
38 private String desc;
39
40
41
42 @JSONField(name = "musicurl")
43 @XmlElement(name = "MusicUrl")
44 private String musicUrl;
45
46
47
48 @JSONField(name = "hqmusicurl")
49 @XmlElement(name = "HQMusicUrl")
50 private String hqMusicUrl;
51
52
53
54 @JSONField(name = "thumb_media_id")
55 @XmlElement(name = "ThumbMediaId")
56 private String thumbMediaId;
57
58
59
60
61
62
63
64
65
66
67 public Music(String musicUrl, String hqMusicUrl, String thumbMediaId) {
68 this(null, null, musicUrl, hqMusicUrl, thumbMediaId);
69 }
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84 public Music(@JSONField(name = "title") String title,
85 @JSONField(name = "desc") String desc,
86 @JSONField(name = "musicUrl") String musicUrl,
87 @JSONField(name = "hqMusicUrl") String hqMusicUrl,
88 @JSONField(name = "thumbMediaId") String thumbMediaId) {
89 this.title = title;
90 this.desc = desc;
91 this.musicUrl = musicUrl;
92 this.hqMusicUrl = hqMusicUrl;
93 this.thumbMediaId = thumbMediaId;
94 }
95
96 public String getTitle() {
97 return title;
98 }
99
100 public void setTitle(String title) {
101 this.title = title;
102 }
103
104 public String getDesc() {
105 return desc;
106 }
107
108 public void setDesc(String desc) {
109 this.desc = desc;
110 }
111
112 public String getMusicUrl() {
113 return musicUrl;
114 }
115
116 public String getHqMusicUrl() {
117 return hqMusicUrl;
118 }
119
120 public String getThumbMediaId() {
121 return thumbMediaId;
122 }
123
124 @Override
125 public String toString() {
126 return "Music [title=" + title + ", desc=" + desc + ", musicUrl="
127 + musicUrl + ", hqMusicUrl=" + hqMusicUrl + ", thumbMediaId="
128 + thumbMediaId + "]";
129 }
130 }