|
| 1 | +package me.chanjar.weixin.cp.bean.external.msg; |
| 2 | + |
| 3 | +import com.google.gson.annotations.SerializedName; |
| 4 | +import me.chanjar.weixin.cp.constant.WxCpConsts; |
| 5 | + |
| 6 | +import java.io.Serializable; |
| 7 | + |
| 8 | +public class Attachment implements Serializable { |
| 9 | + private static final long serialVersionUID = -8078748379570640198L; |
| 10 | + |
| 11 | + @SerializedName("msgtype") |
| 12 | + private String msgType; |
| 13 | + |
| 14 | + private Image image; |
| 15 | + |
| 16 | + private Link link; |
| 17 | + |
| 18 | + private MiniProgram miniprogram; |
| 19 | + |
| 20 | + private Video video; |
| 21 | + |
| 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 | + } |
| 44 | + |
| 45 | + public void setImage(Image image) { |
| 46 | + this.image = image; |
| 47 | + this.msgType = WxCpConsts.WelcomeMsgType.IMAGE; |
| 48 | + } |
| 49 | + |
| 50 | + public Link getLink() { |
| 51 | + return link; |
| 52 | + } |
| 53 | + |
| 54 | + public void setLink(Link link) { |
| 55 | + this.link = link; |
| 56 | + this.msgType = WxCpConsts.WelcomeMsgType.LINK; |
| 57 | + } |
| 58 | + |
| 59 | + public MiniProgram getMiniprogram() { |
| 60 | + return miniprogram; |
| 61 | + } |
| 62 | + |
| 63 | + public void setMiniprogram(MiniProgram miniprogram) { |
| 64 | + this.miniprogram = miniprogram; |
| 65 | + this.msgType = WxCpConsts.WelcomeMsgType.MINIPROGRAM; |
| 66 | + } |
| 67 | + |
| 68 | + public Video getVideo() { |
| 69 | + return video; |
| 70 | + } |
| 71 | + |
| 72 | + public void setVideo(Video video) { |
| 73 | + this.video = video; |
| 74 | + this.msgType = WxCpConsts.WelcomeMsgType.VIDEO; |
| 75 | + } |
| 76 | +} |
0 commit comments