|
@@ -60,7 +60,8 @@ public class VideoApiService {
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("uid", uid);
|
|
|
param.put("phoneNumber", phoneNumber);
|
|
|
- String res = httpPoolClient.post(url, param.toJSONString());
|
|
|
+ String post = httpPoolClient.post(url, param.toJSONString());
|
|
|
+ JSONObject res = JSONObject.parseObject(post);
|
|
|
} catch (Exception e) {
|
|
|
log.error("saveUserPhoneNumber error", e);
|
|
|
}
|
|
@@ -69,20 +70,24 @@ public class VideoApiService {
|
|
|
public Long publishVideo(Long uid, String videoUrl, String coverUrl, String title) {
|
|
|
String url = videoApiHost + "/longvideoapi/crawler/video/send";
|
|
|
try {
|
|
|
- String post = httpPoolClient.post(url, "videoPath=" + videoUrl +
|
|
|
- "&crawlerSrcCode=\"CONTENT\"" +
|
|
|
- "&crawlerSrcPublishTimestamp=\"" + System.currentTimeMillis() + "\"" +
|
|
|
- "&crawlerTaskTimestamp=\"" + System.currentTimeMillis() + "\"" +
|
|
|
+ String param = "videoPath=" + videoUrl +
|
|
|
+ "&crawlerSrcCode=CONTENT" +
|
|
|
+ "&crawlerSrcPublishTimestamp=" + System.currentTimeMillis() +
|
|
|
+ "&crawlerTaskTimestamp=" + System.currentTimeMillis() +
|
|
|
"&coverImgPath=" + coverUrl +
|
|
|
+ "&appType=888888" +
|
|
|
"&loginUid=" + uid +
|
|
|
- "&title=" + title, "application/x-www-form-urlencoded;charset=UTF-8");
|
|
|
+ "&title=" + title +
|
|
|
+ "&viewStatus=1" +
|
|
|
+ "&versionCode=1";
|
|
|
+ String post = httpPoolClient.post(url, param, "application/x-www-form-urlencoded;charset=UTF-8");
|
|
|
JSONObject res = JSONObject.parseObject(post);
|
|
|
if (res.getInteger("code") != 0) {
|
|
|
log.error("publishVideo error, uid:{} videoUrl={} coverUrl={} title={} res={}", uid, videoUrl, coverUrl, title, res);
|
|
|
throw new CommonException(ExceptionEnum.VIDEO_PUBLISH_FAILED.getCode(), res.getString("msg"));
|
|
|
}
|
|
|
JSONObject data = res.getJSONObject("data");
|
|
|
- Long videoId = data.getLong("videoId");
|
|
|
+ Long videoId = data.getLong("id");
|
|
|
log.info("publishVideo success, uid:{} videoId={}", uid, videoId);
|
|
|
return videoId;
|
|
|
} catch (Exception e) {
|
|
@@ -116,7 +121,8 @@ public class VideoApiService {
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("loginUid", uid);
|
|
|
param.put("videoId", videoId);
|
|
|
- String res = httpPoolClient.post(url, param.toJSONString());
|
|
|
+ String post = httpPoolClient.post(url, param.toJSONString());
|
|
|
+ JSONObject res = JSONObject.parseObject(post);
|
|
|
} catch (Exception e) {
|
|
|
log.error("deleteVideo error", e);
|
|
|
}
|