com.github.sd4324530.fastweixin.api
类 MaterialAPI

java.lang.Object
  继承者 com.github.sd4324530.fastweixin.api.BaseAPI
      继承者 com.github.sd4324530.fastweixin.api.MaterialAPI

public class MaterialAPI
extends BaseAPI

==================================================================== 上海聚攒软件开发有限公司 --------------------------------------------------------------------

作者:
Nottyjay ====================================================================

字段摘要
 
从类 com.github.sd4324530.fastweixin.api.BaseAPI 继承的字段
BASE_API_URL, config
 
构造方法摘要
MaterialAPI(ApiConfig config)
           
 
方法摘要
 GetMaterialListResponse batchGetMaterial(MaterialType type, int offset, int count)
          获取素材列表
 GetMaterialTotalCountResponse countMaterial()
          获取已创建永久素材的数量
 ResultType deleteMaterial(String mediaId)
          删除一个永久素材
 DownloadMaterialResponse downloadMaterial(String mediaId, MaterialType type)
          下载永久素材
 DownloadMaterialResponse getMaterial(String mediaId)
          获得永久素材的信息、只获取信息、不进行下载
 UploadMaterialResponse uploadMaterialFile(File file)
          上传永久素材文件。
 UploadMaterialResponse uploadMaterialFile(File file, String title, String introduction)
          上传永久视频素材文件。
 UploadMaterialResponse uploadMaterialNews(List<Article> articles)
          上传图文消息素材
 
从类 com.github.sd4324530.fastweixin.api.BaseAPI 继承的方法
executeGet, executePost, executePost, isSuccess
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

MaterialAPI

public MaterialAPI(ApiConfig config)
方法详细信息

uploadMaterialFile

public UploadMaterialResponse uploadMaterialFile(File file)
上传永久素材文件。图片素材上限为5000,其他类型为1000

参数:
file - 素材文件
返回:
上传结果

uploadMaterialFile

public UploadMaterialResponse uploadMaterialFile(File file,
                                                 String title,
                                                 String introduction)
上传永久视频素材文件。

参数:
file - 素材文件
title - 素材标题
introduction - 素材描述信息
返回:
上传结果

uploadMaterialNews

public UploadMaterialResponse uploadMaterialNews(List<Article> articles)
上传图文消息素材

参数:
articles - 图文消息列表
返回:
上传结果

downloadMaterial

public DownloadMaterialResponse downloadMaterial(String mediaId,
                                                 MaterialType type)
下载永久素材

参数:
mediaId - 素材ID
type - 素材类型
返回:
下载结果

countMaterial

public GetMaterialTotalCountResponse countMaterial()
获取已创建永久素材的数量

返回:
永久素材数量结果

batchGetMaterial

public GetMaterialListResponse batchGetMaterial(MaterialType type,
                                                int offset,
                                                int count)
获取素材列表

参数:
type - 素材类型
offset - 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
count - 返回素材的数量,取值在1到20之间
返回:
素材列表结果

deleteMaterial

public ResultType deleteMaterial(String mediaId)
删除一个永久素材

参数:
mediaId - 素材ID
返回:
删除结果

getMaterial

public DownloadMaterialResponse getMaterial(String mediaId)
获得永久素材的信息、只获取信息、不进行下载

参数:
mediaId -
返回:


Copyright © 2017. All rights reserved.