微信公众平台 客服接口发消息的实现代码(Java接(2)

public class Message { private String touser; private String msgtype; private TextContent text; private MediaContent image; private MediaContent voice; private MediaContent video; private MusicContent music; private Articles news; public String getTouser() { return touser; } public void setTouser(String touser) { this.touser = touser; } public String getMsgtype() { return msgtype; } public void setMsgtype(String msgtype) { this.msgtype = msgtype; } public TextContent getText() { return text; } public void setText(TextContent text) { this.text = text; } public MediaContent getImage() { return image; } public void setImage(MediaContent image) { this.image = image; } public MediaContent getVoice() { return voice; } public void setVoice(MediaContent voice) { this.voice = voice; } public MediaContent getVideo() { return video; } public void setVideo(MediaContent video) { this.video = video; } public MusicContent getMusic() { return music; } public void setMusic(MusicContent music) { this.music = music; } public Articles getNews() { return news; } public void setNews(Articles news) { this.news = news; } @Override public String toString() { return "Message [touser=" + touser + ", msgtype=" + msgtype + ", text=" + text + ", image=" + image + ", voice=" + voice + ", video=" + video + ", music=" + music + ", news=" + news + "]"; } }

(2)TextContent文本消息内容封装对象

public class TextContent { private String content; public String getContent() { return content; } public void setContent(String content) { this.content = content; } }

(3)MediaContent媒体ID封装对象

public class MediaContent { private String media_id; public String getMedia_id() { return media_id; } public void setMedia_id(String media_id) { this.media_id = media_id; } }

(4)MusicContent音乐消息封装对象

public class MusicContent { private String title; private String description; private String musicurl; private String hqmusicurl; private String thumb_media_id; 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; } public String getMusicurl() { return musicurl; } public void setMusicurl(String musicurl) { this.musicurl = musicurl; } public String getHqmusicurl() { return hqmusicurl; } public void setHqmusicurl(String hqmusicurl) { this.hqmusicurl = hqmusicurl; } public String getThumb_media_id() { return thumb_media_id; } public void setThumb_media_id(String thumb_media_id) { this.thumb_media_id = thumb_media_id; } }

(5)Articles图文集合封装对象

public class Articles { private Article[] articles; public Article[] getArticles() { return articles; } public void setArticles(Article[] articles) { this.articles = articles; } }

(6)Article图文消息封装对象

public class Article { private String title; private String description; private String url; private String picurl; private String thumb_media_id; private String author; private String content_source_url; private String content; private String digest; private Integer show_cover_pic; 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; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getPicurl() { return picurl; } public void setPicurl(String picurl) { this.picurl = picurl; } public String getThumb_media_id() { return thumb_media_id; } public void setThumb_media_id(String thumb_media_id) { this.thumb_media_id = thumb_media_id; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getContent_source_url() { return content_source_url; } public void setContent_source_url(String content_source_url) { this.content_source_url = content_source_url; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getDigest() { return digest; } public void setDigest(String digest) { this.digest = digest; } public Integer getShow_cover_pic() { return show_cover_pic; } public void setShow_cover_pic(Integer show_cover_pic) { this.show_cover_pic = show_cover_pic; } }

(7)客服消息请求接口

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/7376f5f258a3ad0509838cdbe2c6893e.html