yumeng 5 vuotta sitten
vanhempi
commit
8a0da1d48c

+ 66 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -1213,4 +1213,70 @@ public class BatchController {
     }
 
 
+    @Autowired
+    private IKuaiShouVideoGetService videoGetService;
+
+    /**
+     * 获取视频信息
+     *
+     * @param accountId
+     * @param photoId
+     * @return
+     */
+    @GetMapping(value = "/getVideoDetail")
+    public Result<KuaiShouVideoGet> getVideoDetail(Long accountId, String photoId) {
+        Result<KuaiShouVideoGet> result = new Result<>();
+        try {
+            if (Check.isNull(accountId) || Check.isNull(photoId)) {
+                throw new Exception("参数错误");
+            }
+            QueryWrapper<KuaiShouVideoGet> videoGetQueryWrapper = new QueryWrapper<>();
+            videoGetQueryWrapper.eq("account_id", accountId);
+            videoGetQueryWrapper.eq("photo_id", photoId);
+            videoGetQueryWrapper.orderByDesc("create_time").last("limit 1");
+            KuaiShouVideoGet video = videoGetService.getOne(videoGetQueryWrapper);
+            result.setResult(video);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+
+        }
+        return result;
+    }
+
+
+    @Autowired
+    private IKuaiShouImageGetService imageGetService;
+
+    /**
+     * 获取图片信息
+     *
+     * @param accountId
+     * @param imageToken
+     * @return
+     */
+    @GetMapping(value = "/getImageDetail")
+    public Result<KuaiShouImageGet> getImageDetail(Long accountId, String imageToken) {
+        Result<KuaiShouImageGet> result = new Result<>();
+        try {
+            if (Check.isNull(accountId) || Check.isNull(imageToken)) {
+                throw new Exception("参数错误");
+            }
+            QueryWrapper<KuaiShouImageGet> imageGetQueryWrapper = new QueryWrapper<>();
+            imageGetQueryWrapper.eq("account_id", accountId);
+            imageGetQueryWrapper.eq("image_token", imageToken);
+            imageGetQueryWrapper.orderByDesc("create_time").last("limit 1");
+            KuaiShouImageGet image = imageGetService.getOne(imageGetQueryWrapper);
+            result.setResult(image);
+            result.setSuccess(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+            result.setSuccess(false);
+
+        }
+        return result;
+    }
+
+
 }

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouVideoGetService.java

@@ -1,6 +1,8 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouImageGet;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
@@ -13,4 +15,5 @@ import java.util.List;
  */
 public interface IKuaiShouVideoGetService extends IService<KuaiShouVideoGet> {
     void replaceBatch(List<KuaiShouVideoGet> videoGets);
+
 }

+ 2 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -2324,14 +2324,13 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                 Integer code = resultJson.getInteger("code");
                 if (code == 0) {
                     JSONObject dataJson = resultJson.getJSONObject("data");
-
                     if (!Check.isNullMap(dataJson)) {
                         JSONObject returnJson = new JSONObject();
                         returnJson.put("isActivate", dataJson.getInteger("is_activate"));
                         returnJson.put("isFormSubmit", dataJson.getInteger("is_form_submit"));
                         JSONArray deep_conversion_types = dataJson.getJSONArray("deep_conversion_types");
+                        JSONArray deepConversionTypes = new JSONArray();
                         if (!Check.isNull(deep_conversion_types)) {
-                            JSONArray deepConversionTypes = new JSONArray();
                             for (int i = 0; i < deep_conversion_types.size(); i++) {
                                 JSONObject json = new JSONObject();
                                 JSONObject deepConversion = deep_conversion_types.getJSONObject(i);
@@ -2339,8 +2338,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                 json.put("deepConversionType", deepConversion.getInteger("deep_conversion_type"));
                                 deepConversionTypes.add(json);
                             }
-                            returnJson.put("deepConversionTypes", deepConversionTypes);
                         }
+                        returnJson.put("deepConversionTypes", deepConversionTypes);
                         return returnJson;
                     }
                 } else {
@@ -3707,6 +3706,4 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     }
 
 
-
-
 }