syh vor 5 Jahren
Ursprung
Commit
8956909f12
42 geänderte Dateien mit 185 neuen und 171 gelöschten Zeilen
  1. 2 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/system/query/QueryGenerator.java
  2. 6 6
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java
  3. 2 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java
  4. 1 1
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/PasswordUtil.java
  5. 1 1
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/SpringContextUtils.java
  6. 2 2
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java
  7. 5 5
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/oConvertUtils.java
  8. 5 5
      jeecg-boot-module-system/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java
  9. 3 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceTemplateController.java
  10. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CrawlerController.java
  11. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAdvertiserController.java
  12. 4 7
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  13. 2 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ByteDanceAdvertisePlan.java
  14. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceAdvertisePlanServiceImpl.java
  15. 5 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceBudgetTemplateServiceImpl.java
  16. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceCampaignTemplateServiceImpl.java
  17. 4 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceAdvertisePlanTemplateServiceImpl.java
  18. 5 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceDeliveryTargetTemplateServiceImpl.java
  19. 5 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceUrlInfoServiceImpl.java
  20. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java
  21. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/FileInfoServiceImpl.java
  22. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/controller/KuaiShouController.java
  23. 9 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaishouInterfaceServiceImpl.java
  24. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/authc/ShiroRealm.java
  25. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/aspect/DictAspect.java
  26. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java
  27. 3 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysPermissionDataRuleImpl.java
  28. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysRolePermissionServiceImpl.java
  29. 2 1
      module-common/src/main/java/cn/com/ctop/common/utils/Base64Utils.java
  30. 1 0
      module-common/src/main/java/cn/com/ctop/common/utils/HttpUtils.java
  31. 1 0
      module-common/src/main/java/cn/com/ctop/common/utils/HttpUtils2.java
  32. 5 2
      module-common/src/main/java/cn/com/ctop/common/utils/TransfMediaTool.java
  33. 6 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/account/service/impl/KuaishouAdAccountServiceImpl.java
  34. 14 7
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/service/impl/KuaishouCrawlerServiceImpl.java
  35. 25 16
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/FateadmHttpUtil.java
  36. 4 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/FateadmUtil.java
  37. 4 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/KuaishouUtil.java
  38. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/AppAdServiceImpl.java
  39. 9 3
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/KuaishouAppServiceImpl.java
  40. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/KuaishouTest.java
  41. 12 8
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java
  42. 3 3
      module-toutiao/src/main/java/cn/com/ctop/toutiao/test/Test.java

+ 2 - 2
jeecg-boot-base-common/src/main/java/org/jeecg/common/system/query/QueryGenerator.java

@@ -84,7 +84,7 @@ public class QueryGenerator {
 		*/
 		
 		//区间条件组装 模糊查询 高级查询组装 简单排序 权限查询
-		PropertyDescriptor origDescriptors[] = PropertyUtils.getPropertyDescriptors(searchObj);
+		PropertyDescriptor[] origDescriptors = PropertyUtils.getPropertyDescriptors(searchObj);
 		Map<String,SysPermissionDataRule> ruleMap = getRuleMap();
 		
 		//权限规则自定义SQL表达式
@@ -564,7 +564,7 @@ public class QueryGenerator {
 	
 	private static String getInConditionValue(Object value,boolean isString) {
 		if(isString) {
-			String temp[] = value.toString().split(",");
+			String[] temp = value.toString().split(",");
 			String res="";
 			for (String string : temp) {
 				res+=",'"+string+"'";

+ 6 - 6
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -156,14 +156,14 @@ public class DateUtils extends PropertyEditorSupport {
      */
     public static String dateformat(String date, String format) {
         SimpleDateFormat sformat = new SimpleDateFormat(format);
-        Date _date = null;
+        Date getDate = null;
         try {
-            _date = sformat.parse(date);
+            getDate = sformat.parse(date);
         } catch (ParseException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }
-        return sformat.format(_date);
+        return sformat.format(getDate);
     }
 
     /**
@@ -565,7 +565,7 @@ public class DateUtils extends PropertyEditorSupport {
         long millisDiff = getMillis(calSrc) - getMillis(calDes);
 
         if (flag == 'y') {
-            return (calSrc.get(calSrc.YEAR) - calDes.get(calDes.YEAR));
+            return (calSrc.get(Calendar.YEAR) - calDes.get(Calendar.YEAR));
         }
 
         if (flag == 'd') {
@@ -596,9 +596,9 @@ public class DateUtils extends PropertyEditorSupport {
         if (StringUtils.hasText(text)) {
             try {
                 if (text.indexOf(":") == -1 && text.length() == 10) {
-                    setValue(this.date_sdf.parse(text));
+                    setValue(date_sdf.parse(text));
                 } else if (text.indexOf(":") > 0 && text.length() == 19) {
-                    setValue(this.datetimeFormat.parse(text));
+                    setValue(datetimeFormat.parse(text));
                 } else {
                     throw new IllegalArgumentException("Could not parse date, date format is error ");
                 }

+ 2 - 2
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/MD5Util.java

@@ -4,7 +4,7 @@ import java.security.MessageDigest;
 
 public class MD5Util {
 
-	public static String byteArrayToHexString(byte b[]) {
+    public static String byteArrayToHexString(byte[] b) {
 		StringBuffer resultSb = new StringBuffer();
 		for (int i = 0; i < b.length; i++){
 			resultSb.append(byteToHexString(b[i]));
@@ -37,7 +37,7 @@ public class MD5Util {
 		return resultString;
 	}
 
-	private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5",
+    private static final String[] hexDigits = {"0", "1", "2", "3", "4", "5",
 			"6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
 
 }

+ 1 - 1
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/PasswordUtil.java

@@ -157,7 +157,7 @@ public class PasswordUtil {
 	 * @return
 	 */
 	public static byte[] hexStringToBytes(String hexString) {
-		if (hexString == null || hexString.equals("")) {
+        if (hexString == null || "".equals(hexString)) {
 			return null;
 		}
 		hexString = hexString.toUpperCase();

+ 1 - 1
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/SpringContextUtils.java

@@ -19,7 +19,7 @@ public class SpringContextUtils implements ApplicationContextAware {
 
 	@Override
 	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
-		this.applicationContext = applicationContext;
+        SpringContextUtils.applicationContext = applicationContext;
 	}
 
 	/**

+ 2 - 2
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java

@@ -47,7 +47,7 @@ public class AesEncryptUtil {
             cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec);
             byte[] encrypted = cipher.doFinal(plaintext);
 
-            return new Base64().encodeToString(encrypted);
+            return Base64.encodeToString(encrypted);
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -66,7 +66,7 @@ public class AesEncryptUtil {
      */
     public static String desEncrypt(String data, String key, String iv) throws Exception {
         try {
-            byte[] encrypted1 = new Base64().decode(data);
+            byte[] encrypted1 = Base64.decode(data);
 
             Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
             SecretKeySpec keyspec = new SecretKeySpec(key.getBytes(), "AES");

+ 5 - 5
jeecg-boot-base-common/src/main/java/org/jeecg/common/util/oConvertUtils.java

@@ -43,7 +43,7 @@ public class oConvertUtils {
 	}
 	
 	public static boolean isNotEmpty(Object object) {
-		if (object != null && !object.equals("") && !object.equals("null")) {
+        if (object != null && !"".equals(object) && !"null".equals(object)) {
 			return (true);
 		}
 		return (false);
@@ -68,7 +68,7 @@ public class oConvertUtils {
 
 	private static String code2code(String strIn, String sourceCode, String targetCode) {
 		String strOut = null;
-		if (strIn == null || (strIn.trim()).equals("")) {
+        if (strIn == null || "".equals(strIn.trim())) {
 			return strIn;
 		}
 		try {
@@ -398,7 +398,7 @@ public class oConvertUtils {
 		long bEnd = getIpNum("172.31.255.255");
 		long cBegin = getIpNum("192.168.0.0");
 		long cEnd = getIpNum("192.168.255.255");
-		isInnerIp = isInner(ipNum, aBegin, aEnd) || isInner(ipNum, bBegin, bEnd) || isInner(ipNum, cBegin, cEnd) || ipAddress.equals("127.0.0.1");
+        isInnerIp = isInner(ipNum, aBegin, aEnd) || isInner(ipNum, bBegin, bEnd) || isInner(ipNum, cBegin, cEnd) || "127.0.0.1".equals(ipAddress);
 		return isInnerIp;
 	}
 
@@ -440,7 +440,7 @@ public class oConvertUtils {
 			//update-end--Author:zhoujf  Date:20180503 for:TASK #2500 【代码生成器】代码生成器开发一通用模板生成功能
 		}
 		// 用下划线将原始字符串分割
-		String camels[] = name.split("_");
+        String[] camels = name.split("_");
 		for (String camel : camels) {
 			// 跳过原始字符串中开头、结尾的下换线或双重下划线
 			if (camel.isEmpty()) {
@@ -469,7 +469,7 @@ public class oConvertUtils {
 	 * @return 转换后的驼峰式命名的字符串
 	 */
 	public static String camelNames(String names) {
-		if(names==null||names.equals("")){
+        if (names == null || "".equals(names)) {
 			return null;
 		}
 		StringBuffer sf = new StringBuffer();

+ 5 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java

@@ -55,7 +55,7 @@ public class MybatisInterceptor implements Interceptor {
 						field.setAccessible(true);
 						Object local_createBy = field.get(parameter);
 						field.setAccessible(false);
-						if (local_createBy == null || local_createBy.equals("")) {
+                        if (local_createBy == null || "".equals(local_createBy)) {
 							String createBy = "jeecg";
 							if (sysUser != null) {
 								// 登录账号
@@ -73,7 +73,7 @@ public class MybatisInterceptor implements Interceptor {
 						field.setAccessible(true);
 						Object local_createDate = field.get(parameter);
 						field.setAccessible(false);
-						if (local_createDate == null || local_createDate.equals("")) {
+                        if (local_createDate == null || "".equals(local_createDate)) {
 							field.setAccessible(true);
 							field.set(parameter, new Date());
 							field.setAccessible(false);
@@ -84,7 +84,7 @@ public class MybatisInterceptor implements Interceptor {
 						field.setAccessible(true);
 						Object local_sysOrgCode = field.get(parameter);
 						field.setAccessible(false);
-						if (local_sysOrgCode == null || local_sysOrgCode.equals("")) {
+                        if (local_sysOrgCode == null || "".equals(local_sysOrgCode)) {
 							String sysOrgCode = "";
 							// 获取登录用户信息
 							if (sysUser != null) {
@@ -119,7 +119,7 @@ public class MybatisInterceptor implements Interceptor {
 						field.setAccessible(true);
 						Object local_updateBy = field.get(parameter);
 						field.setAccessible(false);
-						if (local_updateBy == null || local_updateBy.equals("")) {
+                        if (local_updateBy == null || "".equals(local_updateBy)) {
 							String updateBy = "jeecg";
 							// 获取登录用户信息
 							LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -138,7 +138,7 @@ public class MybatisInterceptor implements Interceptor {
 						field.setAccessible(true);
 						Object local_updateDate = field.get(parameter);
 						field.setAccessible(false);
-						if (local_updateDate == null || local_updateDate.equals("")) {
+                        if (local_updateDate == null || "".equals(local_updateDate)) {
 							field.setAccessible(true);
 							field.set(parameter, new Date());
 							field.setAccessible(false);

Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ByteDanceTemplateController.java


+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CrawlerController.java

@@ -0,0 +1,4 @@
+package org.jeecg.modules.ctop.controller;
+
+public class CrawlerController {
+}

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/KuaishouAdvertiserController.java

@@ -81,13 +81,13 @@ public class KuaishouAdvertiserController {
                     .eq("second_industry", sysCategory.getName());
         }
         if (dataProcess != null) {
-            if (dataProcess.equals("industry")) {
+            if ("industry".equals(dataProcess)) {
                 queryWrapper.isNull("industry_category").or().isNull("first_industry").or().isNull("second_industry").isNull("industry_category").or().isNull("first_industry").or().isNull("second_industry").or().eq("second_industry", "").or().eq("second_industry", "").or().eq("second_industry", "");
-            } else if (dataProcess.equals("company")) {
+            } else if ("company".equals(dataProcess)) {
                 queryWrapper.isNull("company").or().eq("company", "");
-            } else if (dataProcess.equals("product")) {
+            } else if ("product".equals(dataProcess)) {
                 queryWrapper.isNull("product").or().eq("product", "");
-            } else if (dataProcess.equals("full")) {
+            } else if ("full".equals(dataProcess)) {
                 queryWrapper.isNotNull("industry_category");
                 queryWrapper.ne("industry_category", "");
                 queryWrapper.isNotNull("first_industry");

+ 4 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -6,10 +6,10 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.ctop.entity.BindAccountAuth;
 import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/test")
@@ -21,8 +21,5 @@ public class TestController {
     public void authorization(@RequestBody JSONObject json) {
         System.err.println(json);
         createInternalService.createInternal(json);
-
-
     }
-
 }

+ 2 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/ByteDanceAdvertisePlan.java

@@ -1,23 +1,17 @@
 package org.jeecg.modules.ctop.entity;
 
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.math.BigDecimal;
+
 /**
  * @Description: 今日头条广告计划信息
  * @Author: jeecg-boot

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceAdvertisePlanServiceImpl.java

@@ -89,14 +89,14 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
                 put("advertiser_id", advertiser_id);
             }
         };
-        if (targetTemplate.getDownloadType().equals("EXTERNAL_URL")) {//落地页
+        if ("EXTERNAL_URL".equals(targetTemplate.getDownloadType())) {//落地页
             data.put("external_url", targetTemplate.getDownloadUrl());
         }
-        if (targetTemplate.getDownloadType().equals("DOWNLOAD_URL")) {//落地页
-            if (targetTemplate.getDownloadMode().equals("ios")) {
+        if ("DOWNLOAD_URL".equals(targetTemplate.getDownloadType())) {//落地页
+            if ("ios".equals(targetTemplate.getDownloadMode())) {
                 data.put("download_url", targetTemplate.getDownloadUrl());
             }
-            if (targetTemplate.getDownloadMode().equals("android")) {
+            if ("android".equals(targetTemplate.getDownloadMode())) {
                 data.put("package_name", targetTemplate.getPackageName());
             }
         }

+ 5 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceBudgetTemplateServiceImpl.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.ctop.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.exec.DaemonExecutor;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.subject.Subject;
 import org.jeecg.common.api.vo.Result;
@@ -24,6 +25,7 @@ import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -65,6 +67,9 @@ public class ByteDanceBudgetTemplateServiceImpl extends ServiceImpl<ByteDanceBud
         }
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         template.setAdvertiserId(user.getId());
+        Date now = new Date();
+        template.setCreateTime(now);
+        template.setUpdateTime(now);
         this.saveOrUpdate(template);
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
         return resultMap;

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/ByteDanceCampaignTemplateServiceImpl.java

@@ -71,6 +71,9 @@ public class ByteDanceCampaignTemplateServiceImpl extends ServiceImpl<ByteDanceC
         template.setStatus(1);
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         template.setAdvertiserId(user.getId());
+        Date now = new Date();
+        template.setCreateTime(now);
+        template.setUpdateTime(now);
         this.saveOrUpdate(template);
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
         return resultMap;

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceAdvertisePlanTemplateServiceImpl.java

@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -31,6 +32,9 @@ public class BytedanceAdvertisePlanTemplateServiceImpl extends ServiceImpl<Byted
     public Map<String, Object> insertTemplate(BytedanceAdvertisePlanTemplate template, String accountId) {
         Map<String, Object> resultMap = new HashMap<>();
         template.setStatus(1);
+        Date now = new Date();
+        template.setCreateTime(now);
+        template.setUpdateTime(now);
         templateMapper.insert(template);
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
         return resultMap;

+ 5 - 63
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceDeliveryTargetTemplateServiceImpl.java

@@ -35,6 +35,7 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.URI;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ConcurrentLinkedDeque;
@@ -71,13 +72,16 @@ public class BytedanceDeliveryTargetTemplateServiceImpl extends ServiceImpl<Byte
         template.setAdvertiserId(user.getId());
         BytedanceUrlInfo urlInfo = urlInfoMapper.selectById(template.getUrlId());
         //落地页
-        if (null != urlInfo.getType() && urlInfo.getType().equals("page")) {
+        if (null != urlInfo.getType() && "page".equals(urlInfo.getType())) {
             template.setExternalUrl(urlInfo.getUrl());
         } else {
             template.setDownloadUrl(urlInfo.getUrl());
             template.setPackageName(urlInfo.getPackageName());
         }
         template.setStatus(1);
+        Date now = new Date();
+        template.setCreateTime(now);
+        template.setUpdateTime(now);
         this.saveOrUpdate(template);
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
         return resultMap;
@@ -122,68 +126,6 @@ public class BytedanceDeliveryTargetTemplateServiceImpl extends ServiceImpl<Byte
         return result;
     }
 
-    public JSONObject getSite() {
-        String access_token = "xxx";
-        final Long advertiser_id = 0L;
-        final int page = 1;
-        final int page_size = 10;
-        // 请求地址
-        String open_api_url_prefix = "https://ad.toutiao.com/open_api/2/";
-        String uri = "tools/site/get/";
-
-        // 请求参数
-        Map data = new HashMap() {
-            {
-                put("advertiser_id", advertiser_id);
-                put("page", page);
-                put("page_size", page_size);
-            }
-        };
-
-        // 构造请求
-        HttpEntityEnclosingRequestBase httpEntity = new HttpEntityEnclosingRequestBase() {
-            @Override
-            public String getMethod() {
-                return "GET";
-            }
-        };
-
-        httpEntity.setHeader("Access-Token", access_token);
-
-        CloseableHttpResponse response = null;
-        CloseableHttpClient client = null;
-
-        try {
-            client = HttpClientBuilder.create().build();
-            httpEntity.setURI(URI.create(open_api_url_prefix + uri));
-            httpEntity.setEntity(new StringEntity(JSONObject.toJSONString(data), ContentType.APPLICATION_JSON));
-
-            response = client.execute(httpEntity);
-            if (response != null && response.getStatusLine().getStatusCode() == 200) {
-                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
-                StringBuffer result = new StringBuffer();
-                String line = "";
-                while ((line = bufferedReader.readLine()) != null) {
-                    result.append(line);
-                }
-                bufferedReader.close();
-                return JSONObject.parseObject(result.toString());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                client.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return null;
-    }
-
     @Autowired
     private ICTopOauthTokenService tokenService;
     @Autowired

+ 5 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BytedanceUrlInfoServiceImpl.java

@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -35,7 +36,7 @@ public class BytedanceUrlInfoServiceImpl extends ServiceImpl<BytedanceUrlInfoMap
             return resultMap;
         }
         String urlType = template.getType();
-        if (null != urlType && urlType.equals("落地页")) {
+        if (null != urlType && "落地页".equals(urlType)) {
             template.setPackageName(null);
         }
         QueryWrapper<BytedanceUrlInfo> queryWrapper = new QueryWrapper<>();
@@ -50,6 +51,9 @@ public class BytedanceUrlInfoServiceImpl extends ServiceImpl<BytedanceUrlInfoMap
         }
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         template.setAdvertiserId(user.getId());
+        Date now = new Date();
+        template.setCreateTime(now);
+        template.setUpdateTime(now);
 //        template.setStatus(1);
         this.saveOrUpdate(template);
         ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/CreateInternalServiceImpl.java

@@ -115,7 +115,7 @@ public class CreateInternalServiceImpl implements ICreateInternalService {
 
 //                webDriver.get("https://ad.toutiao.com/pages/campaign/create.html");
                 for (Cookie cookie : webDriver.manage().getCookies()) {
-                    if (cookie.getName().equals("csrftoken")) {
+                    if ("csrftoken".equals(cookie.getName())) {
                         csrftoken = cookie.getValue();
                     }
                     BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/FileInfoServiceImpl.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.io.FileUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -37,11 +38,13 @@ import org.jeecg.modules.system.service.ISysCategoryService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.FileSystemResource;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.*;
 import java.net.URI;
+import java.net.URL;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -350,4 +353,12 @@ public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> i
     }
     @Autowired
     private ICTopOauthTokenService tokenService;
+
+    public static void main(String[] args) throws Exception {
+
+//        FileUtils.copyURLToFile(new URL("https://ctop-media.oss-cn-beijing.aliyuncs.com/%E9%AB%98%E6%B8%85%E7%89%882-1565344662650.mp4"),new File("D://1234.mp4"));
+//        File file = new File("https://ctop-media.oss-cn-beijing.aliyuncs.com/%E9%AB%98%E6%B8%85%E7%89%882-1565344662650.mp4");
+//        FileInputStream fis = new FileInputStream(file);
+//        fis.read();
+    }
 }

+ 0 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/controller/KuaiShouController.java

@@ -219,7 +219,6 @@ public class KuaiShouController {
         Long advertiserId = 23212L;
         JSONObject requestJson = new JSONObject();
         kuaishouInterfaceService.appUpdate(advertiserId, accessToken, requestJson, multipartFile, request);
-
     }
 
     @Autowired

+ 9 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaishouInterfaceServiceImpl.java

@@ -46,6 +46,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     private static final Logger logger = LoggerFactory.getLogger(KuaishouInterfaceServiceImpl.class);
 
 
+    @Override
     public KuaishouResult<KuaishouReportHourlyAccount> getAccountHourlyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ACCOUNT_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
@@ -75,6 +76,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return kuaishouResult;
     }
 
+    @Override
     public KuaishouResult<KuaishouReportDailyAccount> getAccountDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ACCOUNT_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
@@ -101,6 +103,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return kuaishouResult;
     }
 
+    @Override
     public KuaishouResult<KuaishouReportDailyCampaign> getCampaignDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
@@ -127,6 +130,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return kuaishouResult;
     }
 
+    @Override
     public KuaishouResult<KuaishouReportHourlyCampaign> getCampaignHourlyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
@@ -153,6 +157,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return kuaishouResult;
     }
 
+    @Override
     public KuaishouResult<KuaishouReportDailyGroup> getGroupDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GTOUP_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
@@ -179,6 +184,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return kuaishouResult;
     }
 
+    @Override
     public KuaishouResult<KuaishouReportHourlyGroup> getGroupHourlyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.GTOUP_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
@@ -205,6 +211,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return kuaishouResult;
     }
 
+    @Override
     public KuaishouResult<KuaishouReportDailyCreative> getCreativeDailyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
@@ -231,6 +238,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         return kuaishouResult;
     }
 
+    @Override
     public KuaishouResult<KuaishouReportHourlyCreative> getCreativeHourlyReport(String accessToken, Long advertiserId, String startDate, String endDate, int pageSize, int pageNum) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CREATIVE_REPORT;
         Map<String, String> headers = new HashMap<String, String>();
@@ -1342,6 +1350,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     @Autowired
     private RestTemplate rest;
 
+    @Override
     public String exceptInfoForRestTemplate(String url, Map<String, Object> paramMap, Map<String, String> headerMap, String filePath) throws ParseException {
 
         try {

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/authc/ShiroRealm.java

@@ -78,8 +78,8 @@ public class ShiroRealm extends AuthorizingRealm {
 
 	/**
 	 * 功能: 用来进行身份认证,也就是说验证用户输入的账号和密码是否正确,获取身份验证信息,错误抛出异常
-	 * 
-	 * @param authenticationToken 用户身份信息 token
+	 *
+	 * @param auth 用户身份信息 token
 	 * @return 返回封装了用户信息的 AuthenticationInfo 实例
 	 */
 	@Override

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/aspect/DictAspect.java

@@ -111,7 +111,7 @@ public class DictAspect {
                             item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue);
                         }
                         //date类型默认转换string格式化日期
-                        if (field.getType().getName().equals("java.util.Date")&&field.getAnnotation(JsonFormat.class)==null&&item.get(field.getName())!=null){
+                        if ("java.util.Date".equals(field.getType().getName()) && field.getAnnotation(JsonFormat.class) == null && item.get(field.getName()) != null) {
                             SimpleDateFormat aDate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                             item.put(field.getName(), aDate.format(new Date((Long) item.get(field.getName()))));
                         }

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysPermissionController.java

@@ -219,7 +219,7 @@ public class SysPermissionController {
 	public Result<SysPermission> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
 		Result<SysPermission> result = new Result<>();
 		try {
-			String arr[] = ids.split(",");
+            String[] arr = ids.split(",");
 			for (String id : arr) {
 				if (oConvertUtils.isNotEmpty(id)) {
 					sysPermissionService.deletePermission(id);

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysPermissionDataRuleImpl.java

@@ -69,7 +69,7 @@ public class SysPermissionDataRuleImpl extends ServiceImpl<SysPermissionDataRule
 			if(ids==null) {
 				continue;
 			}
-			String arr[] = ids.split(",");
+            String[] arr = ids.split(",");
 			for (String id : arr) {
 				if(oConvertUtils.isNotEmpty(id)) {
 					set.add(id);
@@ -89,7 +89,7 @@ public class SysPermissionDataRuleImpl extends ServiceImpl<SysPermissionDataRule
 		this.save(sysPermissionDataRule);
 		SysPermission permission = sysPermissionMapper.selectById(sysPermissionDataRule.getPermissionId());
 
-		if(permission!=null && (permission.getRuleFlag()==null || permission.getRuleFlag()==CommonConstant.RULE_FLAG_0)) {
+        if (permission != null && (permission.getRuleFlag() == null || permission.getRuleFlag().equals(CommonConstant.RULE_FLAG_0))) {
 			permission.setRuleFlag(CommonConstant.RULE_FLAG_1);
 			sysPermissionMapper.updateById(permission);
 		}
@@ -106,7 +106,7 @@ public class SysPermissionDataRuleImpl extends ServiceImpl<SysPermissionDataRule
 			if(count==null || count==0) {
 				SysPermission permission = sysPermissionMapper.selectById(dataRule.getPermissionId());
 
-				if(permission!=null && permission.getRuleFlag()==CommonConstant.RULE_FLAG_1) {
+                if (permission != null && permission.getRuleFlag().equals(CommonConstant.RULE_FLAG_1)) {
 					permission.setRuleFlag(CommonConstant.RULE_FLAG_0);
 					sysPermissionMapper.updateById(permission);
 				}

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysRolePermissionServiceImpl.java

@@ -37,7 +37,7 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
 		LambdaQueryWrapper<SysRolePermission> query = new QueryWrapper<SysRolePermission>().lambda().eq(SysRolePermission::getRoleId, roleId);
 		this.remove(query);
 		List<SysRolePermission> list = new ArrayList<SysRolePermission>();
-		String arr[] = permissionIds.split(",");
+        String[] arr = permissionIds.split(",");
 		for (String p : arr) {
 			if(oConvertUtils.isNotEmpty(p)) {
 				SysRolePermission rolepms = new SysRolePermission(roleId, p);

+ 2 - 1
module-common/src/main/java/cn/com/ctop/common/utils/Base64Utils.java

@@ -47,8 +47,9 @@ public class Base64Utils {
     }
 
     public static String decode(String s) {
-        if (s == null)
+        if (s == null) {
             return null;
+        }
         BASE64Decoder decoder = new BASE64Decoder();
         try {
             byte[] b = decoder.decodeBuffer(s);

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/utils/HttpUtils.java

@@ -53,6 +53,7 @@ public class HttpUtils {
         try {
             SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
                 //信任所有证书
+                @Override
                 public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                     return true;
                 }

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/utils/HttpUtils2.java

@@ -53,6 +53,7 @@ public class HttpUtils2 {
         try {
             SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
                 //信任所有证书
+                @Override
                 public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                     return true;
                 }

+ 5 - 2
module-common/src/main/java/cn/com/ctop/common/utils/TransfMediaTool.java

@@ -109,19 +109,22 @@ public class TransfMediaTool {
 
 class PrintStream extends Thread {
     java.io.InputStream __is = null;
+    java.io.InputStream ___is = null;
 
     public PrintStream(java.io.InputStream is) {
         __is = is;
     }
 
+    @Override
     public void run() {
         try {
             while (this != null) {
                 int _ch = __is.read();
-                if (_ch != -1)
+                if (_ch != -1) {
                     System.out.print((char) _ch);
-                else
+                } else {
                     break;
+                }
             }
         } catch (Exception e) {
             e.printStackTrace();

+ 6 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/account/service/impl/KuaishouAdAccountServiceImpl.java

@@ -13,12 +13,18 @@ import java.util.List;
 public class KuaishouAdAccountServiceImpl extends ServiceImpl<KuaishouAdAccountMapper, KuaishouAdAccount> implements IKuaishouAdAccountService {
     @Autowired
     private KuaishouAdAccountMapper kuaishouAdAccountMapper;
+
+    @Override
     public List<KuaishouAdAccount> querySyncAccount(){
         return kuaishouAdAccountMapper.querySyncAccount();
     }
+
+    @Override
     public List<String> companySugest(String company){
         return kuaishouAdAccountMapper.companySugest(company);
     }
+
+    @Override
     public List<String> productSugest(String product){
         return kuaishouAdAccountMapper.productSugest(product);
     }

Datei-Diff unterdrückt, da er zu groß ist
+ 14 - 7
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/service/impl/KuaishouCrawlerServiceImpl.java


+ 25 - 16
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/FateadmHttpUtil.java

@@ -29,8 +29,9 @@ public class FateadmHttpUtil {
                 char c = json.charAt( next_idx);
                 if( (c<=32) || (c=='\\')){
                     next_idx ++;
-                }else
+                } else {
                     break;
+                }
             }
         }
         public String NextSToken( ) {
@@ -38,8 +39,9 @@ public class FateadmHttpUtil {
             String ret = "";
             while(next_idx < json.length()){
                 char c = json.charAt(next_idx);
-                if( c== '\"')
+                if (c == '\"') {
                     break;
+                }
                 if( (c=='\\') && (next_idx+1<json.length())){
                     if(json.charAt(next_idx+1) == '\\')
                     {
@@ -76,17 +78,17 @@ public class FateadmHttpUtil {
             return ret;
         }
         public void Key2Val(HttpResp rsp, String key, String val){
-            if ( key.equals("RetCode")){
+            if ("RetCode".equals(key)) {
                 rsp.ret_code    = Integer.parseInt( val);
-            }else if( key.equals("ErrMsg")){
+            } else if ("ErrMsg".equals(key)) {
                 rsp.err_msg     = val;
-            }else if( key.equals("RequestId")){
+            } else if ("RequestId".equals(key)) {
                 rsp.req_id      = val;
-            }else if( key.equals("RspData")){
+            } else if ("RspData".equals(key)) {
                 rsp.rsp_data    = val;
-            }else if( key.equals("result")){
+            } else if ("result".equals(key)) {
                 rsp.pred_resl   = val;
-            }else if( key.equals( "cust_val")){
+            } else if ("cust_val".equals(key)) {
                 rsp.cust_val    = Double.parseDouble(val);
             }
         }
@@ -112,8 +114,9 @@ public class FateadmHttpUtil {
                         next_idx++;
                         sval = NextSToken();
                         Skip();
-                        if (next_idx >= json.length())
+                        if (next_idx >= json.length()) {
                             break;
+                        }
                         if( json.charAt(next_idx+1) == ':'){
                             key = sval;
                             next_idx ++;
@@ -139,7 +142,7 @@ public class FateadmHttpUtil {
                     case 'n':
                     case 'N':
                         sval    = json.substring(next_idx, 4).toLowerCase();
-                        if( !sval.equals("null")){
+                        if (!"null".equals(sval)) {
                             //error
                             break;
                         }
@@ -223,24 +226,30 @@ public class FateadmHttpUtil {
             byte[] buf = new byte[1024];
             while (true) {
                 int len = dataIn.read(buf);
-                if (len < 0)
+                if (len < 0) {
                     break;
+                }
                 dos.write(buf, 0, len);
             }
             bArray = bos.toByteArray();
         }catch( Exception e){
             return bArray;
         }finally {
-            if (in != null)
+            if (in != null) {
                 in.close();
-            if (dataIn != null)
+            }
+            if (dataIn != null) {
                 dataIn.close();
-            if (buffer != null)
+            }
+            if (buffer != null) {
                 buffer.close();
-            if (bos != null)
+            }
+            if (bos != null) {
                 bos.close();
-            if (dos != null)
+            }
+            if (dos != null) {
                 dos.close();
+            }
         }
         return bArray;
     }

+ 4 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/FateadmUtil.java

@@ -32,7 +32,7 @@ public class FateadmUtil {
      *      resp.err_msg:异常时返回异常详情
      */
     public FateadmHttpUtil.HttpResp QueryBalc() throws Exception{
-        long cur_tm     = new Date().getTime()/1000;    // 时间戳精确到秒。所以除以1000
+        long cur_tm = System.currentTimeMillis() / 1000;    // 时间戳精确到秒。所以除以1000
         String stm      = String.valueOf(cur_tm);
         String sign     = FateadmHttpUtil.CalcSign( pd_id, pd_key, stm);
         String url      = this.pred_url + "/api/custval";
@@ -60,7 +60,7 @@ public class FateadmUtil {
      *      resp.err_msg:异常时返回异常详情
      */
     public FateadmHttpUtil.HttpResp Charge(String cardid, String cardkey) throws Exception{
-        long cur_tm     = new Date().getTime()/1000;    // 时间戳精确到秒。所以除以1000
+        long cur_tm = System.currentTimeMillis() / 1000;    // 时间戳精确到秒。所以除以1000
         String stm      = String.valueOf(cur_tm);
         String sign     = FateadmHttpUtil.CalcSign( pd_id, pd_key, stm);
         String csign    = FateadmHttpUtil.CalcMd5(pd_key + stm + cardid + cardkey);
@@ -123,7 +123,7 @@ public class FateadmUtil {
      *      resp.pred_resl:识别的结果
      */
     public FateadmHttpUtil.HttpResp Predict(String pred_type, byte[] img_data) throws Exception{
-        long cur_tm     = new Date().getTime()/1000;    // 时间戳精确到秒。所以除以1000
+        long cur_tm = System.currentTimeMillis() / 1000;    // 时间戳精确到秒。所以除以1000
         String stm      = String.valueOf(cur_tm);
         String sign     = FateadmHttpUtil.CalcSign(pd_id,pd_key,stm);
         String asign 	= "";
@@ -160,7 +160,7 @@ public class FateadmUtil {
      *      退款仅在正常识别出结果后,无法通过网站验证的情况,请勿非法或者滥用,否则可能进行封号处理
      */
     public FateadmHttpUtil.HttpResp Justice(String req_id) throws Exception{
-        long cur_tm     = new Date().getTime()/1000;     // 时间戳精确到秒。所以除以1000
+        long cur_tm = System.currentTimeMillis() / 1000;     // 时间戳精确到秒。所以除以1000
         String stm      = String.valueOf(cur_tm);
         String sign     = FateadmHttpUtil.CalcSign( pd_id, pd_key, stm);
         String url      = pred_url + "/api/capjust";

+ 4 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/KuaishouUtil.java

@@ -31,7 +31,7 @@ import java.util.*;
 
 public class KuaishouUtil {
     public static CrawlerLog requestData(HttpEntity httpEntity){
-        long beginTime = new Date().getTime();
+        long beginTime = System.currentTimeMillis();
         CrawlerLog crawlerLog = new CrawlerLog();
         String salt = "382700b563f4";
         Map<String,String> staticParams = httpEntity.getHttpBody().getStaticParams();
@@ -43,7 +43,7 @@ public class KuaishouUtil {
         Map<String,String> allMap = new HashMap<String,String>();
         allMap.putAll(staticParams);
         allMap.putAll(dynamicParams);
-        if(staticParams.get("kpf") != null && staticParams.get("kpf").equals("ANDROID_PHONE")){
+        if (staticParams.get("kpf") != null && "ANDROID_PHONE".equals(staticParams.get("kpf"))) {
             String sig = SignUtil.getMD5Sign(HttpParamUtil.mapToString(SortUtil.sortMapByKey(allMap),ignoreKeyList),salt);
             dynamicParams.put("sig",sig);
             allMap.put("sig",sig);
@@ -59,6 +59,7 @@ public class KuaishouUtil {
         try {
             SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
                 //信任所有证书
+                @Override
                 public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
                     return true;
                 }
@@ -79,7 +80,7 @@ public class KuaishouUtil {
             int code = response.getStatusLine().getStatusCode();
             org.apache.http.HttpEntity respentity = response.getEntity();
             String strReturn = EntityUtils.toString(respentity);
-            long endTime = new Date().getTime();
+            long endTime = System.currentTimeMillis();
             crawlerLog.setUrl(httpEntity.getUrl());
             crawlerLog.setPath(httpEntity.getPath());
             crawlerLog.setMethod("POST");

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/AppAdServiceImpl.java

@@ -15,6 +15,7 @@ public class AppAdServiceImpl extends ServiceImpl<AppAdMapper, AppAd> implements
     @Autowired
     private AppAdMapper appAdMapper;
 
+    @Override
     public List<AppAd> queryAdFeeds(String userName, String industry, String company, String product, String start, String end, String orderByColumn, String orderByType, Integer pageStart, Integer pageSize) {
         return appAdMapper.queryAdFeeds(userName, industry, company, product, start, end, orderByColumn, orderByType, pageStart, pageSize);
     }

+ 9 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/app/service/impl/KuaishouAppServiceImpl.java

@@ -35,7 +35,9 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
     private IAppVideoService appVideoService;
     @Autowired
     private IKuaishouAdAccountService kuaishouAdAccountService;
-    public void adFetch(KuaishouAppAccount kuaishouAppAccount,Integer page){
+
+    @Override
+    public void adFetch(KuaishouAppAccount kuaishouAppAccount, Integer page) {
         String videoFeeds = kuaishouCrawlerService.getVideoFeeds(kuaishouAppAccount,page);
         ObjectMapper mapper = new ObjectMapper();
         mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
@@ -96,7 +98,9 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
             e.printStackTrace();
         }
     }
-    public void adAccountFetch(KuaishouAdAccount kuaishouAdAccount,String pcursor){
+
+    @Override
+    public void adAccountFetch(KuaishouAdAccount kuaishouAdAccount, String pcursor) {
         String userProfileStr = kuaishouCrawlerService.getUserProfile(kuaishouAdAccount.getKsid());
         ObjectMapper mapper = new ObjectMapper();
         mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
@@ -126,13 +130,15 @@ public class KuaishouAppServiceImpl implements IKuaishouAppService {
                 }
             }
             Thread.sleep(10000);
-            if(pcursor != null && !pcursor.equals("no_more")){
+            if (pcursor != null && !"no_more".equals(pcursor)) {
                 adAccountFetch(kuaishouAdAccount,pcursor);
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
+
+    @Override
     public void adFetch(KuaishouIosAccount kuaishouIosAccount){
         String videoFeeds = kuaishouCrawlerService.getVideoFeeds(kuaishouIosAccount);
         ObjectMapper mapper = new ObjectMapper();

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/KuaishouTest.java

@@ -293,7 +293,7 @@ import okhttp3.Response;
      * @return
      */
     public static Map getSigUrl(String userid) {
-        long time = new Date().getTime();
+        long time = System.currentTimeMillis();
 
         return getSigUrl(userid,time,0,0);
     }
@@ -361,7 +361,7 @@ import okhttp3.Response;
             Set<String> keySet = sortedMap.keySet();
             for (String key : keySet) {
                 //sign不参与算法
-                if (key.equals("sig") || key.equals("__NStokensig")) {
+                if ("sig".equals(key) || "__NStokensig".equals(key)) {
                     continue;
                 }
                 String value = sortedMap.get(key);

+ 12 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/graphql/service/impl/KuaishouWebInterfaceServiceImpl.java

@@ -166,7 +166,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
                     kuaishouVideoService.saveOrUpdate(video);
                 }
             }
-            if (feeds.getPcursor() == null || !feeds.getPcursor().equals("no_more")) {
+            if (feeds.getPcursor() == null || !"no_more".equals(feeds.getPcursor())) {
                 Thread.sleep((int) Math.random() * 5000 + 10000);
                 getVedioList(principalId, feeds.getPcursor(), ttf, ++times);
             }
@@ -186,6 +186,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
         }
     }
 
+    @Override
     public void adkuaishouWebLogin(String phone, String password) {
 //        System.getProperties().setProperty("webdriver.chrome.driver", "D:/chromedriver.exe");
         System.getProperties().setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
@@ -243,6 +244,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
         }
     }
 
+    @Override
     public void getVideoList(String uid) {
 //        System.getProperties().setProperty("webdriver.chrome.driver", "D:/chromedriver.exe");
         System.getProperties().setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
@@ -295,28 +297,29 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
         BasicClientCookie cookie = new BasicClientCookie("clientid", "3");
         cookie.setDomain("live.kuaishou.com");   //设置范围
         cookie.setPath("/");
-        cookie.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
+        cookie.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 365));
         HttpUtils2.cookieStore.addCookie(cookie);
 
         BasicClientCookie cookie1 = new BasicClientCookie("did", "web_1615d3ad757d4fb8558ed4d7dbecf5fc");
         cookie1.setDomain("live.kuaishou.com");   //设置范围web_a5735c4f9f02ad9ee48677499927341c
         cookie1.setPath("/");
-        cookie1.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
+        cookie1.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 365));
         HttpUtils2.cookieStore.addCookie(cookie1);
 
         BasicClientCookie cookie2 = new BasicClientCookie("client_key", "65890b29");
         cookie2.setDomain("live.kuaishou.com");   //设置范围
         cookie2.setPath("/");
-        cookie2.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
+        cookie2.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 365));
         HttpUtils2.cookieStore.addCookie(cookie2);
 
         BasicClientCookie cookie3 = new BasicClientCookie("kuaishou.live.bfb1s", "3e261140b0cf7444a0ba411c6f227d88");
         cookie3.setDomain("live.kuaishou.com");   //设置范围
         cookie3.setPath("/");
-        cookie3.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
+        cookie3.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 365));
         HttpUtils2.cookieStore.addCookie(cookie3);
     }
 
+    @Override
     public String checkKuaishouUser(String videoUrl) {
         String html = HttpUtils2.httpGetRequest(videoUrl);
         HttpUtils2.cookieStore.clear();
@@ -326,7 +329,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
 
         while (m.find()) {
             uid = m.group().replace("/profile/", "").replace("\"", "");
-            if (uid != null && !uid.equals("") && !uid.equals("null")) {
+            if (uid != null && !"".equals(uid) && !"null".equals(uid)) {
                 return uid;
             }
         }
@@ -373,7 +376,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
                     Long commentId = commentNode.get("comment_id").asLong();
                     deleteCommentById(photoId, commentId, headers);
                 }
-                if (pcursor != null && !pcursor.equals("no_more")) {
+                if (pcursor != null && !"no_more".equals(pcursor)) {
                     deletePhotoComment(photoId, pcursor, headers);
                 }
             }
@@ -382,6 +385,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
         }
     }
 
+    @Override
     public void deleteAllComment(Map<String, String> pcursorMap) {
         try {
             Map<String, String> headers = new HashMap<>();
@@ -405,7 +409,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
                     Long photoId = photoNode.get("photoId").asLong();
                     deletePhotoComment(photoId, "", headers);
                 }
-                if (pcursor != null && !pcursor.equals("no_more")) {
+                if (pcursor != null && !"no_more".equals(pcursor)) {
                     pcursorMap = mapper.readValue(node.get("pcursorMap").toString(), new TypeReference<Map<String, String>>() {
                     });
                     deleteAllComment(pcursorMap);

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/test/Test.java

@@ -133,7 +133,7 @@ public class Test {
 
 //                webDriver.get("https://ad.toutiao.com/pages/campaign/create.html");
                 for (Cookie cookie : webDriver.manage().getCookies()){
-                    if(cookie.getName().equals("csrftoken")){
+                    if ("csrftoken".equals(cookie.getName())) {
                         csrftoken = cookie.getValue();
                     }
                     BasicClientCookie ck = new BasicClientCookie(cookie.getName(),cookie.getValue());
@@ -173,8 +173,8 @@ public class Test {
                     HttpUtils.cookieStore.addCookie(ck);
                     System.out.println(cookie.getName()+","+cookie.getValue()+","+cookie.getDomain());
                 }
-                String siteStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/adv_site/get_site_list/?_="+String.valueOf(new Date().getTime()));
-                String convStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/get_tetris_action/?external_url=&type=external&pricing=9&landing_type=3&_="+String.valueOf(new Date().getTime()));
+                String siteStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/adv_site/get_site_list/?_=" + String.valueOf(System.currentTimeMillis()));
+                String convStr = HttpUtils.httpGetRequest("https://ad.oceanengine.com/overture/api/get_tetris_action/?external_url=&type=external&pricing=9&landing_type=3&_=" + String.valueOf(System.currentTimeMillis()));
                 JsonNode siteNode = mapper.readTree(siteStr);
                 JsonNode convNode = mapper.readTree(convStr);