Browse Source

update tt

master
xhxu 2 years ago
parent
commit
10e7b1c2ec
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      mallinkService/src/main/java/com/iformall/service/toutiao/api/impl/TtOpenMaServiceImpl.java

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/toutiao/api/impl/TtOpenMaServiceImpl.java View File

@@ -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);
}


Loading…
Cancel
Save