Prechádzať zdrojové kódy

Merge branch '20250925-wyp-uploadVideo' into test

wangyunpeng 3 týždňov pred
rodič
commit
0bd767ada1

+ 14 - 8
api-module/src/main/java/com/tzld/piaoquan/api/component/VideoApiService.java

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

+ 4 - 2
api-module/src/main/resources/mapper/contentplatform/ContentPlatformUploadVideoMapper.xml

@@ -110,7 +110,8 @@
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformUploadVideo">
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformUploadVideo"
+          useGeneratedKeys="true" keyProperty="id">
     insert into content_platform_upload_video (id, video_id, title, 
       cover, video, audit_status, 
       audit_reason, score, is_delete, 
@@ -122,7 +123,8 @@
       #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT}
       )
   </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformUploadVideo">
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformUploadVideo"
+          useGeneratedKeys="true" keyProperty="id">
     insert into content_platform_upload_video
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">