wangyunpeng 1 週間 前
コミット
aad92c4320

+ 13 - 11
api-module/src/main/java/com/tzld/piaoquan/api/component/VideoApiService.java

@@ -31,7 +31,7 @@ public class VideoApiService {
             JSONObject data = res.getJSONObject("data");
             return data.getJSONArray("videoCoverImages").toJavaList(String.class);
         } catch (Exception e) {
-            log.error("getCoverImagePaths error", e);
+            log.error("VideoApiService getCoverImagePaths error", e);
         }
         return null;
     }
@@ -50,7 +50,7 @@ public class VideoApiService {
             JSONObject res = JSONObject.parseObject(post);
             return res.getObject("data", WxBaseUserInfoVO.class);
         } catch (Exception e) {
-            log.error("webLogin error", e);
+            log.error("VideoApiService webLogin error", e);
         }
         return null;
     }
@@ -64,7 +64,7 @@ public class VideoApiService {
             String post = httpPoolClient.post(url, param.toJSONString());
             JSONObject res = JSONObject.parseObject(post);
         } catch (Exception e) {
-            log.error("saveUserPhoneNumber error", e);
+            log.error("VideoApiService saveUserPhoneNumber error", e);
         }
     }
 
@@ -82,10 +82,11 @@ public class VideoApiService {
                     "&title=" + title +
                     "&viewStatus=1" +
                     "&versionCode=1";
+            log.info("VideoApiService publishVideo param={}", param);
             String post = httpPoolClient.post(url, param, "application/x-www-form-urlencoded;charset=UTF-8");
             res = JSONObject.parseObject(post);
         } catch (Exception e) {
-            log.error("publishVideo error", e);
+            log.error("VideoApiService publishVideo error", e);
         }
         if (Objects.isNull(res)) {
             return null;
@@ -97,7 +98,7 @@ public class VideoApiService {
         }
         JSONObject data = res.getJSONObject("data");
         Long videoId = data.getLong("id");
-        log.info("publishVideo success, uid:{} videoId={}", uid, videoId);
+        log.info("VideoApiService publishVideo success, uid:{} videoId={}", uid, videoId);
         return videoId;
     }
 
@@ -121,16 +122,17 @@ public class VideoApiService {
             param.put("price", chargeDetail.getLong("price"));
             param.put("allowIosPlay", chargeDetail.getLong("allowIosPlay"));
             param.put("allowDownload", 0);
+            log.info("VideoApiService updateVideo param={}", param.toJSONString());
             String post = httpPoolClient.post(url, param.toJSONString());
             res = JSONObject.parseObject(post);
         } catch (Exception e) {
-            log.error("updateVideo error", e);
+            log.error("VideoApiService updateVideo error", e);
         }
         if (Objects.isNull(res)) {
             throw new CommonException(ExceptionEnum.VIDEO_UPDATE_FAILED);
         }
         if (res.getInteger("code") != 0) {
-            log.error("updateVideo error, uid:{} videoId={} coverUrl={} title={} res={}", uid, videoId, coverUrl, title, res);
+            log.error("VideoApiService updateVideo error, uid:{} videoId={} coverUrl={} title={} res={}", uid, videoId, coverUrl, title, res);
             throw new CommonException(ExceptionEnum.VIDEO_UPDATE_FAILED.getCode(), res.getString("msg"));
         }
     }
@@ -144,13 +146,13 @@ public class VideoApiService {
             String post = httpPoolClient.post(url, param.toJSONString());
             res = JSONObject.parseObject(post);
         } catch (Exception e) {
-            log.error("getVideoInfo error", e);
+            log.error("VideoApiService getVideoInfo error", e);
         }
         if (Objects.isNull(res)) {
             throw new CommonException(ExceptionEnum.VIDEO_INFO_FAILED);
         }
         if (res.getInteger("code") != 0) {
-            log.error("getVideoInfo error, videoId={} res={}", videoId, res);
+            log.error("VideoApiService getVideoInfo error, videoId={} res={}", videoId, res);
             throw new CommonException(ExceptionEnum.VIDEO_INFO_FAILED.getCode(),
                     ExceptionEnum.VIDEO_INFO_FAILED.getMsg() + "," + res.getString("msg"));
         }
@@ -167,13 +169,13 @@ public class VideoApiService {
             String post = httpPoolClient.post(url, param.toJSONString());
             res = JSONObject.parseObject(post);
         } catch (Exception e) {
-            log.error("deleteVideo error", e);
+            log.error("VideoApiService deleteVideo error", e);
         }
         if (Objects.isNull(res)) {
             throw new CommonException(ExceptionEnum.VIDEO_DELETE_FAILED);
         }
         if (res.getInteger("code") != 0) {
-            log.error("getVideoInfo error, videoId={} res={}", videoId, res);
+            log.error("VideoApiService deleteVideo error, videoId={} res={}", videoId, res);
             throw new CommonException(ExceptionEnum.VIDEO_DELETE_FAILED.getCode(),
                     ExceptionEnum.VIDEO_DELETE_FAILED.getMsg() + "," + res.getString("msg"));
         }

+ 3 - 3
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformUploadContentServiceImpl.java

@@ -67,14 +67,14 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
         if (!param.getCoverUrl().startsWith("http")) {
             param.setCoverUrl(CdnUtil.VIDEO_CDN_URL_HOST + param.getCoverUrl());
         }
-        if (!param.getVideoUrl().startsWith("http")) {
-            param.setVideoUrl(CdnUtil.VIDEO_CDN_URL_HOST + param.getVideoUrl());
-        }
         // 调用视频发布 获取videoId
         Long videoId = videoApiService.publishVideo(pqAccountRel.getPqUid(), param.getVideoUrl(), param.getCoverUrl(), param.getTitle());
         if (videoId == null) {
             throw new CommonException(ExceptionEnum.VIDEO_PUBLISH_FAILED);
         }
+        if (!param.getVideoUrl().startsWith("http")) {
+            param.setVideoUrl(CdnUtil.VIDEO_CDN_URL_HOST + param.getVideoUrl());
+        }
         ContentPlatformUploadVideo uploadVideo = new ContentPlatformUploadVideo();
         uploadVideo.setVideoId(videoId);
         uploadVideo.setTitle(param.getTitle());