Przeglądaj źródła

渠道号。。。获取旧应用前做刷新操作

zhaoxian 3 lat temu
rodzic
commit
9fce4afe88

+ 10 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java

@@ -15,6 +15,7 @@ import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAppPackageService;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAppListService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelAppInfo;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelCreateStrategy;
@@ -94,6 +95,9 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
     private IKuaiShouAppListService kuaiShouAppListService;
 
     @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+
+    @Autowired
     private IAiKuaiShouAppInfoService appInfoService;
 
     @Autowired
@@ -324,6 +328,7 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                             log.error("通过账户ID(" + token.getAccountId() + ")获取图片Token失败,返回信息:" + tokenJson.getString("message"));
                         }
                         //使用范围是账户时,查询旧app来做匹配
+                        kuaishouInterfaceService.getAppList(accountId, token.getAccessToken());
                         List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(accountId);
                         strategy.setImageToken(tokenJson.getString("imageToken"));
                         strategy.setAccountId(accountId);
@@ -360,6 +365,7 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                     log.error("通过账户ID(" + token.getAccountId() + ")获取图片Token失败,返回信息:" + tokenJson.getString("message"));
                 }
                 //使用范围是账户时,查询旧app来做匹配
+                kuaishouInterfaceService.getAppList(strategy.getAccountId(), token.getAccessToken());
                 List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(strategy.getAccountId());
                 strategy.setImageToken(tokenJson.getString("imageToken"));
                 if (url.contains(CHANNEL_STR)) {
@@ -425,9 +431,9 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                         KuaishouChannelAppInfo channelAppInfo = new KuaishouChannelAppInfo();
                         BeanUtils.copyProperties(app, channelAppInfo);
                         channelAppInfo.setState(1);
-                        channelAppInfo.setUrl((String)app.getUrl());
+                        channelAppInfo.setUrl((String) app.getUrl());
                         channelAppInfo.setUseSdk(0);
-                        channelAppInfo.setAppIconUrl((String)app.getAppIconUrl());
+                        channelAppInfo.setAppIconUrl((String) app.getAppIconUrl());
                         channelAppInfo.setId(null);
                         channelAppInfo.setType("copy");
                         channelAppInfo.setRemark("copy原有App");
@@ -906,6 +912,7 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                                 log.error("通过账户ID(" + token.getAccountId() + ")获取图片Token失败,返回信息:" + tokenJson.getString("message"));
                             }
                             //使用范围是账户时,查询旧app来做匹配
+                            kuaishouInterfaceService.getAppList(strategy.getAccountId(), token.getAccessToken());
                             List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(accountId);
                             strategy.setImageToken(tokenJson.getString("imageToken"));
                             strategy.setAccountId(accountId);
@@ -927,6 +934,7 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                         log.error("通过账户ID(" + token.getAccountId() + ")获取图片Token失败,返回信息:" + tokenJson.getString("message"));
                     }
                     //使用范围是账户时,查询旧app来做匹配
+                    kuaishouInterfaceService.getAppList(strategy.getAccountId(), token.getAccessToken());
                     List<KuaiShouAppList> oldAppList = kuaiShouAppListService.getAppListByAccountId(strategy.getAccountId());
                     strategy.setImageToken(tokenJson.getString("imageToken"));
                     try {