This repository has been archived by the owner on Jan 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from codepiano/develop
实现永久素材相关接口 @codepiano
- Loading branch information
Showing
30 changed files
with
1,745 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
193 changes: 140 additions & 53 deletions
193
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/WxMpMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package me.chanjar.weixin.mp.bean; | ||
|
||
import java.io.File; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class WxMpMaterial { | ||
|
||
private String name; | ||
private File file; | ||
private String videoTitle; | ||
private String videoIntroduction; | ||
|
||
public WxMpMaterial() { | ||
} | ||
|
||
public WxMpMaterial(String name, File file, String videoTitle, String videoIntroduction) { | ||
this.name = name; | ||
this.file = file; | ||
this.videoTitle = videoTitle; | ||
this.videoIntroduction = videoIntroduction; | ||
} | ||
|
||
public Map<String, String> getForm() { | ||
Map<String, String> form = new HashMap<String, String>(); | ||
form.put("title", videoTitle); | ||
form.put("introduction", videoIntroduction); | ||
return form; | ||
} | ||
|
||
public String getVideoTitle() { | ||
return videoTitle; | ||
} | ||
|
||
public void setVideoTitle(String videoTitle) { | ||
this.videoTitle = videoTitle; | ||
} | ||
|
||
public String getVideoIntroduction() { | ||
return videoIntroduction; | ||
} | ||
|
||
public void setVideoIntroduction(String videoIntroduction) { | ||
this.videoIntroduction = videoIntroduction; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public File getFile() { | ||
return file; | ||
} | ||
|
||
public void setFile(File file) { | ||
this.file = file; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "WxMpMaterial [" + "name=" + name + ", file=" + file + ", videoTitle=" + videoTitle + ", videoIntroduction=" + videoIntroduction + "]"; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/WxMpMaterialArticleUpdate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package me.chanjar.weixin.mp.bean; | ||
|
||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; | ||
|
||
import java.io.Serializable; | ||
|
||
public class WxMpMaterialArticleUpdate implements Serializable { | ||
|
||
private String mediaId; | ||
private int index; | ||
private WxMpMaterialNews.WxMpMaterialNewsArticle articles; | ||
|
||
public String getMediaId() { | ||
return mediaId; | ||
} | ||
|
||
public void setMediaId(String mediaId) { | ||
this.mediaId = mediaId; | ||
} | ||
|
||
public int getIndex() { | ||
return index; | ||
} | ||
|
||
public void setIndex(int index) { | ||
this.index = index; | ||
} | ||
|
||
public WxMpMaterialNews.WxMpMaterialNewsArticle getArticles() { | ||
return articles; | ||
} | ||
|
||
public void setArticles(WxMpMaterialNews.WxMpMaterialNewsArticle articles) { | ||
this.articles = articles; | ||
} | ||
|
||
public String toJson() { | ||
return WxMpGsonBuilder.create().toJson(this); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "WxMpMaterialArticleUpdate [" + "mediaId=" + mediaId + ", index=" + index + ", articles=" + articles + "]"; | ||
} | ||
} |
141 changes: 141 additions & 0 deletions
141
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/WxMpMaterialNews.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
package me.chanjar.weixin.mp.bean; | ||
|
||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class WxMpMaterialNews implements Serializable { | ||
|
||
private List<WxMpMaterialNewsArticle> articles = new ArrayList<WxMpMaterialNewsArticle>(); | ||
|
||
public List<WxMpMaterialNewsArticle> getArticles() { | ||
return articles; | ||
} | ||
|
||
public void addArticle(WxMpMaterialNewsArticle article) { | ||
this.articles.add(article); | ||
} | ||
|
||
public String toJson() { | ||
return WxMpGsonBuilder.INSTANCE.create().toJson(this); | ||
} | ||
|
||
public boolean isEmpty() { | ||
return articles == null || articles.isEmpty(); | ||
} | ||
|
||
/** | ||
* <pre> | ||
* 群发图文消息article | ||
* 1. thumbMediaId (必填) 图文消息缩略图的media_id,可以在基础支持-上传多媒体文件接口中获得 | ||
* 2. author 图文消息的作者 | ||
* 3. title (必填) 图文消息的标题 | ||
* 4. contentSourceUrl 在图文消息页面点击“阅读原文”后的页面链接 | ||
* 5. content (必填) 图文消息页面的内容,支持HTML标签 | ||
* 6. digest 图文消息的描述 | ||
* 7, showCoverPic 是否显示封面,true为显示,false为不显示 | ||
* </pre> | ||
* | ||
* @author chanjarster | ||
*/ | ||
public static class WxMpMaterialNewsArticle { | ||
/** | ||
* (必填) 图文消息缩略图的media_id,可以在基础支持-上传多媒体文件接口中获得 | ||
*/ | ||
private String thumbMediaId; | ||
/** | ||
* 图文消息的作者 | ||
*/ | ||
private String author; | ||
/** | ||
* (必填) 图文消息的标题 | ||
*/ | ||
private String title; | ||
/** | ||
* 在图文消息页面点击“阅读原文”后的页面链接 | ||
*/ | ||
private String contentSourceUrl; | ||
/** | ||
* (必填) 图文消息页面的内容,支持HTML标签 | ||
*/ | ||
private String content; | ||
/** | ||
* 图文消息的描述 | ||
*/ | ||
private String digest; | ||
/** | ||
* 是否显示封面,true为显示,false为不显示 | ||
*/ | ||
private boolean showCoverPic; | ||
|
||
public String getThumbMediaId() { | ||
return thumbMediaId; | ||
} | ||
|
||
public void setThumbMediaId(String thumbMediaId) { | ||
this.thumbMediaId = thumbMediaId; | ||
} | ||
|
||
public String getAuthor() { | ||
return author; | ||
} | ||
|
||
public void setAuthor(String author) { | ||
this.author = author; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
public String getContentSourceUrl() { | ||
return contentSourceUrl; | ||
} | ||
|
||
public void setContentSourceUrl(String contentSourceUrl) { | ||
this.contentSourceUrl = contentSourceUrl; | ||
} | ||
|
||
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 boolean isShowCoverPic() { | ||
return showCoverPic; | ||
} | ||
|
||
public void setShowCoverPic(boolean showCoverPic) { | ||
this.showCoverPic = showCoverPic; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "WxMpMassNewsArticle [" + "thumbMediaId=" + thumbMediaId + ", author=" + author + ", title=" + title + | ||
", contentSourceUrl=" + contentSourceUrl + ", content=" + content + ", digest=" + digest + | ||
", showCoverPic=" + showCoverPic + "]"; | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "WxMpMaterialNews [" + "articles=" + articles + "]"; | ||
} | ||
} |
Oops, something went wrong.