fixed #45
This commit is contained in:
parent
5b31f1c8f0
commit
c27cd13852
@ -336,9 +336,9 @@ public class WeixinProxy {
|
||||
* "https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738732&token=&lang=zh_CN">
|
||||
* 更新永久图文素材</a>
|
||||
*/
|
||||
public JsonResult updateMaterialArticle(String mediaId, int index, List<MpArticle> articles)
|
||||
public JsonResult updateMaterialArticle(String mediaId, int index, MpArticle article)
|
||||
throws WeixinException {
|
||||
return mediaApi.updateMaterialArticle(mediaId, index, articles);
|
||||
return mediaApi.updateMaterialArticle(mediaId, index, article);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -355,11 +355,11 @@ public class MediaApi extends MpApi {
|
||||
* href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738732&token=&lang=zh_CN">更新永久图文素材</a>
|
||||
*/
|
||||
public JsonResult updateMaterialArticle(String mediaId, int index,
|
||||
List<MpArticle> articles) throws WeixinException {
|
||||
MpArticle article) throws WeixinException {
|
||||
Token token = tokenHolder.getToken();
|
||||
String material_article_update_uri = getRequestUri("material_article_update_uri");
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("articles", articles);
|
||||
obj.put("articles", article);
|
||||
obj.put("media_id", mediaId);
|
||||
obj.put("index", index);
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
|
||||
@ -107,15 +107,13 @@ public class MediaTest extends TokenTest {
|
||||
|
||||
@Test
|
||||
public void updateMaterialArticle() throws WeixinException {
|
||||
MpArticle mpArticle = new MpArticle("8790403529", "title", "content");
|
||||
mpArticle.setAuthor("author_update");
|
||||
mpArticle.setDigest("digest_update");
|
||||
mpArticle.setShowCoverPic(false);
|
||||
mpArticle.setSourceUrl("http://www.baidu.com");
|
||||
List<MpArticle> articles = new ArrayList<MpArticle>();
|
||||
articles.add(mpArticle);
|
||||
MpArticle article = new MpArticle("8790403529", "title", "content");
|
||||
article.setAuthor("author_update");
|
||||
article.setDigest("digest_update");
|
||||
article.setShowCoverPic(false);
|
||||
article.setSourceUrl("http://www.baidu.com");
|
||||
JsonResult result = mediaApi.updateMaterialArticle("17385064953", 0,
|
||||
articles);
|
||||
article);
|
||||
System.err.println(result);
|
||||
// 17385065153
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user