Bladeren bron

Merge remote-tracking branch 'origin/master'

songyh 4 jaren geleden
bovenliggende
commit
cb0807ca15

+ 3 - 0
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/AiBytedanceAdvertiserStrategyServiceImpl.java

@@ -953,6 +953,9 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         }
         // api 获取行业列表
         Result listResult = marketingService.getToolIndustryList(token,type);
+        if (!listResult.isSuccess()){
+            return Result.errorMsg(listResult.getMessage());
+        }
         List<Map<String,Object>> industryListMap = (List<Map<String,Object>>) listResult.getResult();
         // list map 数据格式 转 list entity 数据格式
         List<IndustryVo> industryList = Check.convertListMap2ListBean(industryListMap,IndustryVo.class);

+ 7 - 5
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/common/utils/ApkUtils.java

@@ -69,12 +69,13 @@ public class ApkUtils {
                             }
                         }
                     }
+                    map.put("code", "1");
 
                 }
             }
             zipFile.close();
         } catch (Exception e) {
-            map.put("code", "fail");
+            map.put("code", "-1");
             map.put("error","读取apk失败");
         }
         return map;
@@ -216,6 +217,7 @@ public class ApkUtils {
             //应用版本号
             parameters = (NSString) rootDict.get("CFBundleVersion");
             map.put("versionCode", parameters.toString());
+            map.put("code", "1");
 
             infoIs.close();
             is.close();
@@ -232,13 +234,13 @@ public class ApkUtils {
     public static void main(String[] args) {
        // Map map = ApkUtils.readAPK("https://apps.bytesfield.com/download/basic/cur/1c728178004c8d4d6c83444a05c414c1a1cfae48");
 
-        //String filePath = LoadFileUtil.downLoadFromUrl("https://apps.bytesfield.com/download/basic/cur/1c728178004c8d4d6c83444a05c414c1a1cfae48","apkFile");
-        String filePath = LoadFileUtil.downLoadFromUrl("https://apps.bytesfield.com/download/basic/cur/96e5f2491826db22962149059da9e4eee7589764","apkFile");
+        String filePath = LoadFileUtil.downLoadFromUrl("https://apps.bytesfield.com/download/basic/cur/1c728178004c8d4d6c83444a05c414c1a1cfae48-","E:\\appFiles");
+        //String filePath = LoadFileUtil.downLoadFromUrl("https://apps.bytesfield.com/download/basic/cur/96e5f2491826db22962149059da9e4eee7589764","E:\\appFiles");
 
         System.out.println(filePath);
 
-        Map map = ApkUtils.readAPK("C:\\Users\\Administrator\\Downloads\\489586631a2c162f812e03be33ca7e87.apk");
-        Map map2 = ApkUtils.readAPK(filePath);
+        Map map = ApkUtils.readAPK(filePath);
+        Map map2 = ApkUtils.readIPA(filePath);
 
         System.out.println(map);
         System.out.println(map2);

+ 13 - 10
jeecg-boot-module-system/src/main/java/org/jeecg/modules/bytedance/advertise/controller/AiBytedanceAdvertiserStrategyController.java

@@ -351,24 +351,27 @@ public class AiBytedanceAdvertiserStrategyController {
 	 *
 	 * 根据下载链接获取应用包名
 	 *
-	 * @param downloadType 类型
 	 * @param urlPath 下载链接
 	 * @return org.jeecg.common.api.vo.Result
 	 * @author zianY
 	 */
 	@ApiOperation(value="根据下载链接获取应用包名", notes="根据下载链接获取应用包名")
 	@GetMapping(value = "/getPackageNameByUrl")
-	public Result getPackageNameByUrl(@RequestParam("downloadType") String downloadType,@RequestParam("urlPath") String urlPath) {
+	public Result getPackageNameByUrl(@RequestParam("urlPath") String urlPath) {
 		try {
-			Map map = new HashMap();
+			Map<String,Object> map = new HashMap();
 			//根据下载链接上传附件
 			urlPath = LoadFileUtil.downLoadFromUrl(urlPath, "appFiles");
-			if ("android".equalsIgnoreCase(downloadType)){
-				// 根据附件地址 读取 apk 信息
-				 map = ApkUtils.readAPK(urlPath);
-			}
-			if ("ios".equalsIgnoreCase(downloadType)){
-				 map = ApkUtils.readIPA(urlPath);
+			// android 根据附件地址 读取 apk 信息
+			map = ApkUtils.readAPK(urlPath);
+			if (!map.get("code").toString().equals("-1")){
+				map.put("platform", "android");
+			}else {
+				//ios
+				map = ApkUtils.readIPA(urlPath);
+				if (!map.get("code").toString().equals("-1")){
+					map.put("platform", "ios");
+				}
 			}
 			return Result.successMsg("根据下载链接获取应用包名成功", map);
 		}catch (Exception e){
@@ -397,7 +400,7 @@ public class AiBytedanceAdvertiserStrategyController {
 	@ApiOperation(value="获取行动号召", notes="获取行动号召")
 	@GetMapping(value = "/getAdAudiencePackage")
 	public Result getAdAudiencePackage(@RequestParam("accountId") String accountId,
-								  @RequestParam(value = "landingType",required = false) String landingType,
+								  @RequestParam(value = "landingType") String landingType,
 								  @RequestParam(value = "deliveryRange",required = false) String deliveryRange) {
 		try {
 			return aiBytedanceAdvertiserStrategyService.getAdAudiencePackage(accountId,landingType,deliveryRange);

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-test.yml

@@ -131,7 +131,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
         master:
-          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.165.84:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
           username: hcst
           password: hcst@2020
           driver-class-name: com.mysql.jdbc.Driver