1010import me .chanjar .weixin .common .util .json .WxGsonBuilder ;
1111import me .chanjar .weixin .mp .api .WxMpMaterialService ;
1212import me .chanjar .weixin .mp .api .WxMpService ;
13- import me .chanjar .weixin .mp .bean .WxMpMaterial ;
14- import me .chanjar .weixin .mp .bean .WxMpMaterialArticleUpdate ;
15- import me .chanjar .weixin .mp .bean .WxMpMaterialNews ;
16- import me .chanjar .weixin .mp .bean .result .*;
13+ import me .chanjar .weixin .mp .bean .material . WxMpMaterial ;
14+ import me .chanjar .weixin .mp .bean .material . WxMpMaterialArticleUpdate ;
15+ import me .chanjar .weixin .mp .bean .material . WxMpMaterialNews ;
16+ import me .chanjar .weixin .mp .bean .material .*;
1717import me .chanjar .weixin .mp .util .http .*;
1818import me .chanjar .weixin .mp .util .json .WxMpGsonBuilder ;
1919
@@ -37,8 +37,13 @@ public WxMpMaterialServiceImpl(WxMpService wxMpService) {
3737 }
3838
3939 @ Override
40- public WxMediaUploadResult mediaUpload (String mediaType , String fileType , InputStream inputStream ) throws WxErrorException , IOException {
41- return this .mediaUpload (mediaType , FileUtils .createTmpFile (inputStream , UUID .randomUUID ().toString (), fileType ));
40+ public WxMediaUploadResult mediaUpload (String mediaType , String fileType , InputStream inputStream ) throws WxErrorException {
41+ try {
42+ return this .mediaUpload (mediaType , FileUtils .createTmpFile (inputStream , UUID .randomUUID ().toString (), fileType ));
43+ } catch (IOException e ) {
44+ e .printStackTrace ();
45+ throw new WxErrorException (WxError .newBuilder ().setErrorMsg (e .getMessage ()).build ());
46+ }
4247 }
4348
4449 @ Override
0 commit comments