Forráskód Böngészése

修改巨量创意爬虫封面数据获取逻辑

syh 4 éve
szülő
commit
bbd2083c2a

+ 6 - 19
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -21,9 +21,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.entity.KuaishouEffectVideoInfo;
 import org.jeecg.modules.ctop.entity.KuaishouEffectVideoInfo;
 import org.jeecg.modules.ctop.service.IKuaishouEffectVideoInfoService;
 import org.jeecg.modules.ctop.service.IKuaishouEffectVideoInfoService;
+import org.jeecg.modules.ctop.service.IProjectMemberService;
 import org.jeecg.modules.ctop.service.IRuleEngineService;
 import org.jeecg.modules.ctop.service.IRuleEngineService;
-import org.jeecg.modules.ctop.vo.QueryParam;
-import org.jeecg.modules.ctop.vo.RuleResult;
 import org.junit.Test;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runner.RunWith;
 import org.kie.api.runtime.KieSession;
 import org.kie.api.runtime.KieSession;
@@ -227,24 +226,12 @@ public class SampleTest {
     private KieSession kieSession;
     private KieSession kieSession;
     @Autowired
     @Autowired
     private IRuleEngineService ruleEngineService;
     private IRuleEngineService ruleEngineService;
-
+    @Autowired
+    private IProjectMemberService projectMemberService;
     @Test
     @Test
-    public void testEngine() {
-        QueryParam queryParam1 = new QueryParam();
-        queryParam1.setParamId("1");
-        queryParam1.setParamSign("+");
-        QueryParam queryParam2 = new QueryParam();
-        queryParam2.setParamId("2");
-        queryParam2.setParamSign("-");
-        // 入参
-        kieSession.insert(queryParam1);
-        kieSession.insert(queryParam2);
-        kieSession.insert(this.ruleEngineService);
-        // 返参
-        RuleResult resultParam = new RuleResult();
-        kieSession.insert(resultParam);
-        kieSession.fireAllRules();
-        System.out.println(resultParam.isPostCodeResult());
+    public void testLoadAccount() {
+        String userId = "c3611c88d0c8414abd3d2ee2a5a0ee7a";
+        List<Map<String, Object>> result = projectMemberService.getProjectAccountByUserId(userId);
     }
     }
 }
 }
 
 

+ 2 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/oceanengine/service/impl/OceanEngineServiceImpl.java

@@ -56,8 +56,7 @@ public class OceanEngineServiceImpl implements IOceanEngineService {
             conn.addRequestProperty("User-Agent",
             conn.addRequestProperty("User-Agent",
                     "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.8) Firefox/3.6.8");
                     "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.8) Firefox/3.6.8");
             conn.connect();
             conn.connect();
-            String location = conn.getHeaderField("Location");
-            return location;
+            return conn.getHeaderField("Location");
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
@@ -76,7 +75,7 @@ public class OceanEngineServiceImpl implements IOceanEngineService {
                 if (node.get("data") != null&&node.get("data").get("materials")!=null) {
                 if (node.get("data") != null&&node.get("data").get("materials")!=null) {
                     String dataJson = node.get("data").get("materials").toString();
                     String dataJson = node.get("data").get("materials").toString();
                     List<HotMaterial> list = mapper.readValue(dataJson,new TypeReference<List<HotMaterial>>() {});
                     List<HotMaterial> list = mapper.readValue(dataJson,new TypeReference<List<HotMaterial>>() {});
-                    if(list != null && list.size() > 0){
+                    if(list != null && !list.isEmpty()){
                         for (HotMaterial material : list){
                         for (HotMaterial material : list){
                             material.setAppCode(appCode);
                             material.setAppCode(appCode);
                             material.setAppName(appName);
                             material.setAppName(appName);