| @@ -663,7 +663,9 @@ public class TtOpenMaServiceImpl extends TtMaServiceImpl implements TtOpenMaServ | |||||
| public String mediaUpload(Integer mediaType, String fileType, InputStream inputStream) throws WxErrorException { | public String mediaUpload(Integer mediaType, String fileType, InputStream inputStream) throws WxErrorException { | ||||
| File tmpFile = null; | File tmpFile = null; | ||||
| try { | try { | ||||
| log.info("--------"+fileType); | |||||
| tmpFile = FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType); | tmpFile = FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType); | ||||
| log.info("--------"+fileType); | |||||
| return this.mediaUpload(mediaType, tmpFile); | return this.mediaUpload(mediaType, tmpFile); | ||||
| } catch (IOException e) { | } catch (IOException e) { | ||||
| throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg(e.getMessage()).build(), e); | throw new WxErrorException(WxError.builder().errorCode(-1).errorMsg(e.getMessage()).build(), e); | ||||
| @@ -679,6 +681,7 @@ public class TtOpenMaServiceImpl extends TtMaServiceImpl implements TtOpenMaServ | |||||
| String uri = API_UPLOAD_MATERIAL +"?component_appid="+ttOpenComponentService.getWxOpenConfigStorage().getComponentAppId() | String uri = API_UPLOAD_MATERIAL +"?component_appid="+ttOpenComponentService.getWxOpenConfigStorage().getComponentAppId() | ||||
| +"&authorizer_access_token="+getAccessToken(false) | +"&authorizer_access_token="+getAccessToken(false) | ||||
| +"&material_type="+mediaType; | +"&material_type="+mediaType; | ||||
| log.info("-----"+uri); | |||||
| TtMediaUploadRequestExecutor executor = new TtMediaUploadRequestExecutor(this.getRequestHttp()); | TtMediaUploadRequestExecutor executor = new TtMediaUploadRequestExecutor(this.getRequestHttp()); | ||||
| return this.execute(executor, uri, file); | return this.execute(executor, uri, file); | ||||
| } | } | ||||