@@ -110,157 +110,6 @@ public interface WxMpService {
110110 */
111111 public WxJsapiSignature createJsapiSignature (String url ) throws WxErrorException ;
112112
113- /**
114- * <pre>
115- * 新增临时素材
116- * 本接口即为原“上传多媒体文件”接口。
117- *
118- * 上传的多媒体文件有格式和大小限制,如下:
119- * 图片(image): 1M,支持JPG格式
120- * 语音(voice):2M,播放长度不超过60s,支持AMR\MP3格式
121- * 视频(video):10MB,支持MP4格式
122- * 缩略图(thumb):64KB,支持JPG格式
123- *
124- * 详情请见: <a href="http://mp.weixin.qq.com/wiki/15/2d353966323806a202cd2deaafe8e557.html">新增临时素材</a>
125- * </pre>
126- * @param mediaType 媒体类型, 请看{@link me.chanjar.weixin.common.api.WxConsts}
127- * @param fileType 文件类型,请看{@link me.chanjar.weixin.common.api.WxConsts}
128- * @param inputStream 输入流
129- * @throws WxErrorException
130- */
131- public WxMediaUploadResult mediaUpload (String mediaType , String fileType , InputStream inputStream ) throws WxErrorException , IOException ;
132-
133- /**
134- * <pre>
135- * 上传非图文永久素材
136- *
137- * 上传的多媒体文件有格式和大小限制,如下:
138- * 图片(image): 图片大小不超过2M,支持bmp/png/jpeg/jpg/gif格式
139- * 语音(voice):语音大小不超过5M,长度不超过60秒,支持mp3/wma/wav/amr格式
140- * 视频(video):在上传视频素材时需要POST另一个表单,id为description,包含素材的描述信息,内容格式为JSON
141- * 缩略图(thumb):文档未说明
142- *
143- * 详情请见: http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html
144- * </pre>
145- * @param mediaType 媒体类型, 请看{@link me.chanjar.weixin.common.api.WxConsts}
146- * @param material 上传的素材, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterial}
147- */
148- public WxMpMaterialUploadResult materialFileUpload (String mediaType , WxMpMaterial material ) throws WxErrorException ;
149-
150- /**
151- * <pre>
152- * 上传永久图文素材
153- *
154- * 详情请见: http://mp.weixin.qq.com/wiki/14/7e6c03263063f4813141c3e17dd4350a.html
155- * </pre>
156- * @param news 上传的图文消息, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterialNews}
157- */
158- public WxMpMaterialUploadResult materialNewsUpload (WxMpMaterialNews news ) throws WxErrorException ;
159-
160- /**
161- * <pre>
162- * 下载声音或者图片永久素材
163- *
164- * 详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
165- * </pre>
166- * @param media_id 永久素材的id
167- */
168- public InputStream materialImageOrVoiceDownload (String media_id ) throws WxErrorException ;
169-
170- /**
171- * <pre>
172- * 获取视频永久素材的信息和下载地址
173- *
174- * 详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
175- * </pre>
176- * @param media_id 永久素材的id
177- */
178- public WxMpMaterialVideoInfoResult materialVideoInfo (String media_id ) throws WxErrorException ;
179-
180- /**
181- * <pre>
182- * 获取图文永久素材的信息
183- *
184- * 详情请见: http://mp.weixin.qq.com/wiki/4/b3546879f07623cb30df9ca0e420a5d0.html
185- * </pre>
186- * @param media_id 永久素材的id
187- */
188- public WxMpMaterialNews materialNewsInfo (String media_id ) throws WxErrorException ;
189-
190- /**
191- * <pre>
192- * 更新图文永久素材
193- *
194- * 详情请见: http://mp.weixin.qq.com/wiki/4/19a59cba020d506e767360ca1be29450.html
195- * </pre>
196- * @param wxMpMaterialArticleUpdate 用来更新图文素材的bean, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterialArticleUpdate}
197- */
198- public boolean materialNewsUpdate (WxMpMaterialArticleUpdate wxMpMaterialArticleUpdate ) throws WxErrorException ;
199-
200- /**
201- * <pre>
202- * 删除永久素材
203- *
204- * 详情请见: http://mp.weixin.qq.com/wiki/5/e66f61c303db51a6c0f90f46b15af5f5.html
205- * </pre>
206- * @param media_id 永久素材的id
207- */
208- public boolean materialDelete (String media_id ) throws WxErrorException ;
209-
210- /**
211- * <pre>
212- * 获取各类素材总数
213- *
214- * 详情请见: http://mp.weixin.qq.com/wiki/16/8cc64f8c189674b421bee3ed403993b8.html
215- * </pre>
216- */
217- public WxMpMaterialCountResult materialCount () throws WxErrorException ;
218-
219- /**
220- * <pre>
221- * 分页获取图文素材列表
222- *
223- * 详情请见: http://mp.weixin.qq.com/wiki/12/2108cd7aafff7f388f41f37efa710204.html
224- * </pre>
225- * @param offset 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
226- * @param count 返回素材的数量,取值在1到20之间
227- */
228- public WxMpMaterialNewsBatchGetResult materialNewsBatchGet (int offset , int count ) throws WxErrorException ;
229-
230- /**
231- * <pre>
232- * 分页获取其他媒体素材列表
233- *
234- * 详情请见: http://mp.weixin.qq.com/wiki/12/2108cd7aafff7f388f41f37efa710204.html
235- * </pre>
236- * @param type 媒体类型, 请看{@link me.chanjar.weixin.common.api.WxConsts}
237- * @param offset 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
238- * @param count 返回素材的数量,取值在1到20之间
239- */
240- public WxMpMaterialFileBatchGetResult materialFileBatchGet (String type , int offset , int count ) throws WxErrorException ;
241-
242- /**
243- * 新增临时素材
244- * @see #mediaUpload(String, String, InputStream)
245- * @param mediaType
246- * @param file
247- * @throws WxErrorException
248- */
249- public WxMediaUploadResult mediaUpload (String mediaType , File file ) throws WxErrorException ;
250-
251- /**
252- * <pre>
253- * 获取临时素材
254- * 本接口即为原“下载多媒体文件”接口。
255- * 根据微信文档,视频文件下载不了,会返回null
256- * 详情请见: <a href="http://mp.weixin.qq.com/wiki/9/677a85e3f3849af35de54bb5516c2521.html">获取临时素材</a>
257- * </pre>
258- * @param media_id
259- * @return 保存到本地的临时文件
260- * @throws WxErrorException
261- */
262- public File mediaDownload (String media_id ) throws WxErrorException ;
263-
264113 /**
265114 * <pre>
266115 * 发送客服消息
@@ -881,17 +730,6 @@ public void markCardCode(String code, String cardId, String openId, boolean isMa
881730 */
882731 public WxMpMassSendResult massMessagePreview (WxMpMassPreviewMessage wxMpMassPreviewMessage ) throws Exception ;
883732
884- /**
885- * <pre>
886- * 上传图文消息内的图片获取URL
887- * 详情请见:http://mp.weixin.qq.com/wiki/15/40b6865b893947b764e2de8e4a1fb55f.html#.E4.B8.8A.E4.BC.A0.E5.9B.BE.E6.96.87.E6.B6.88.E6.81.AF.E5.86.85.E7.9A.84.E5.9B.BE.E7.89.87.E8.8E.B7.E5.8F.96URL.E3.80.90.E8.AE.A2.E9.98.85.E5.8F.B7.E4.B8.8E.E6.9C.8D.E5.8A.A1.E5.8F.B7.E8.AE.A4.E8.AF.81.E5.90.8E.E5.9D.87.E5.8F.AF.E7.94.A8.E3.80.91
888- * </pre>
889- * @param file
890- * @return WxMediaImgUploadResult 返回图片url
891- * @throws WxErrorException
892- */
893- public WxMediaImgUploadResult mediaImgUpload (File file ) throws WxErrorException ;
894-
895733 /**
896734 * <pre>
897735 * 设置所属行业
@@ -920,5 +758,16 @@ public void markCardCode(String code, String cardId, String openId, boolean isMa
920758 * @return WxMpKefuService
921759 */
922760 WxMpKefuService getKefuService ();
923-
761+
762+ /**
763+ * 返回客服接口方法实现类,以方便调用个其各种接口
764+ * @return WxMpMaterialService
765+ */
766+ WxMpMaterialService getMaterialService ();
767+
768+ /**
769+ * 获取WxMpConfigStorage 对象
770+ * @return WxMpConfigStorage
771+ */
772+ WxMpConfigStorage getWxMpConfigStorage ();
924773}
0 commit comments