1
1
package me .chanjar .weixin .cp .bean .external .msg ;
2
2
3
3
import com .google .gson .annotations .SerializedName ;
4
+ import lombok .Data ;
4
5
import me .chanjar .weixin .cp .constant .WxCpConsts ;
5
6
6
7
import java .io .Serializable ;
7
8
9
+ /**
10
+ * @author chutian0124
11
+ */
12
+ @ Data
8
13
public class Attachment implements Serializable {
9
14
private static final long serialVersionUID = -8078748379570640198L ;
10
15
@@ -15,62 +20,35 @@ public class Attachment implements Serializable {
15
20
16
21
private Link link ;
17
22
18
- private MiniProgram miniprogram ;
23
+ @ SerializedName ("miniprogram" )
24
+ private MiniProgram miniProgram ;
19
25
20
26
private Video video ;
21
27
22
- @ Override
23
- public String toString () {
24
- return "Attachment{" +
25
- "msgType='" + msgType + '\'' +
26
- ", image=" + image +
27
- ", link=" + link +
28
- ", miniprogram=" + miniprogram +
29
- ", video=" + video +
30
- '}' ;
31
- }
32
-
33
- private String getMsgType () {
34
- return msgType ;
35
- }
36
-
37
- private void setMsgType (String msgType ) {
38
- this .msgType = msgType ;
39
- }
40
-
41
- public Image getImage () {
42
- return image ;
43
- }
28
+ private File file ;
44
29
45
30
public void setImage (Image image ) {
46
31
this .image = image ;
47
32
this .msgType = WxCpConsts .WelcomeMsgType .IMAGE ;
48
33
}
49
34
50
- public Link getLink () {
51
- return link ;
52
- }
53
-
54
35
public void setLink (Link link ) {
55
36
this .link = link ;
56
37
this .msgType = WxCpConsts .WelcomeMsgType .LINK ;
57
38
}
58
39
59
- public MiniProgram getMiniprogram () {
60
- return miniprogram ;
61
- }
62
-
63
- public void setMiniprogram (MiniProgram miniprogram ) {
64
- this .miniprogram = miniprogram ;
40
+ public void setMiniProgram (MiniProgram miniProgram ) {
41
+ this .miniProgram = miniProgram ;
65
42
this .msgType = WxCpConsts .WelcomeMsgType .MINIPROGRAM ;
66
43
}
67
44
68
- public Video getVideo () {
69
- return video ;
70
- }
71
-
72
45
public void setVideo (Video video ) {
73
46
this .video = video ;
74
47
this .msgType = WxCpConsts .WelcomeMsgType .VIDEO ;
75
48
}
49
+
50
+ public void setFile (File file ) {
51
+ this .file = file ;
52
+ this .msgType = WxCpConsts .WelcomeMsgType .FILE ;
53
+ }
76
54
}
0 commit comments