|
|
@@ -663,7 +663,9 @@ public class TtOpenMaServiceImpl extends TtMaServiceImpl implements TtOpenMaServ |
|
|
|
public String mediaUpload(Integer mediaType, String fileType, InputStream inputStream) throws WxErrorException { |
|
|
|
File tmpFile = null; |
|
|
|
try { |
|
|
|
log.info("--------"+fileType); |
|
|
|
tmpFile = FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType); |
|
|
|
log.info("--------"+fileType); |
|
|
|
return this.mediaUpload(mediaType, tmpFile); |
|
|
|
} catch (IOException 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() |
|
|
|
+"&authorizer_access_token="+getAccessToken(false) |
|
|
|
+"&material_type="+mediaType; |
|
|
|
log.info("-----"+uri); |
|
|
|
TtMediaUploadRequestExecutor executor = new TtMediaUploadRequestExecutor(this.getRequestHttp()); |
|
|
|
return this.execute(executor, uri, file); |
|
|
|
} |
|
|
|