Browse Source

Merge remote-tracking branch 'origin/master'

syh 5 năm trước cách đây
mục cha
commit
57c21ee554
13 tập tin đã thay đổi với 154 bổ sung22 xóa
  1. 2 0
      jeecg-boot-base-common/src/main/java/org/jeecg/common/util/LoadFileUtil.java
  2. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UserAllocationController.java
  3. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/controller/KuaiShouAppCreateController.java
  4. 6 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/entity/KuaiShouCreateAppTemplate.java
  5. 8 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/entity/KuaiShouImage.java
  6. 10 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/entity/KuaiShouVideo.java
  7. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/IKuaiShouImageService.java
  8. 41 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouCreateAppTemplateServiceImpl.java
  9. 6 8
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouCreateServiceImpl.java
  10. 33 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouImageServiceImpl.java
  11. 33 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouVideoServiceImpl.java
  12. 10 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaishouInterfaceServiceImpl.java
  13. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/shiro/authc/ShiroRealm.java

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

@@ -30,6 +30,8 @@ public class LoadFileUtil {
     public static String downLoadFromUrl(String urlStr, String savePath) throws IOException {
         String fileName = AesEncryptUtil.getURLDecoderString(urlStr.substring(urlStr.lastIndexOf("/") + 1));
         URL url = new URL(urlStr);
+
+        System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2,SSLv3");
         HttpURLConnection conn = (HttpURLConnection) url.openConnection();
         //设置超时间为3秒
         conn.setConnectTimeout(60 * 1000);

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

@@ -69,6 +69,7 @@ public class UserAllocationController {
         LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         QueryWrapper<UserAllocation> queryWrapper = QueryGenerator.initQueryWrapper(userAllocation, req.getParameterMap());
         queryWrapper.eq("user_id", user.getId());
+        queryWrapper.orderByDesc("id");
         Page<UserAllocation> page = new Page<UserAllocation>(pageNo, pageSize);
         IPage<UserAllocation> pageList = userAllocationService.page(page, queryWrapper);
         result.setSuccess(true);

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

@@ -66,6 +66,7 @@ public class KuaiShouAppCreateController {
         Result<IPage<KuaiShouAppCreate>> result = new Result<IPage<KuaiShouAppCreate>>();
         QueryWrapper<KuaiShouAppCreate> queryWrapper = QueryGenerator.initQueryWrapper(kuaiShouAppCreate, req.getParameterMap());
         Page<KuaiShouAppCreate> page = new Page<KuaiShouAppCreate>(pageNo, pageSize);
+        queryWrapper.orderByDesc("id");
         IPage<KuaiShouAppCreate> pageList = kuaiShouAppCreateService.page(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);

+ 6 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/entity/KuaiShouCreateAppTemplate.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.kuaishou.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -32,7 +33,7 @@ public class KuaiShouCreateAppTemplate {
      */
     @TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "id")
-    private Integer id;
+    private Long id;
     /**
      * app类型 安卓 ios
      */
@@ -91,6 +92,10 @@ public class KuaiShouCreateAppTemplate {
     private Integer uploadType;
 
 
+
+    private Long accountId;
+
+
     /**
      * 登录人id
      */

+ 8 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/entity/KuaiShouImage.java

@@ -33,6 +33,14 @@ public class KuaiShouImage {
     @TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "id")
     private Long id;
+
+    /**
+     * 图片保存本地地址
+     */
+    @Excel(name = "accountId", width = 15)
+    @ApiModelProperty(value = "accountId")
+    private Long accountId;
+
     /**
      * 图片保存本地地址
      */

+ 10 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/entity/KuaiShouVideo.java

@@ -32,7 +32,16 @@ public class KuaiShouVideo {
      */
     @TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "id")
-    private Integer id;
+    private Long id;
+
+
+    /**
+     * accountId
+     */
+    @Excel(name = "accountId", width = 15)
+    @ApiModelProperty(value = "accountId")
+    private Long accountId;
+
     /**
      * 视频保存本地地址
      */

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/IKuaiShouImageService.java

@@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IKuaiShouImageService extends IService<KuaiShouImage> {
 
-    void insert(JSONObject requestJson);
+    void insert(JSONObject requestJson) throws Exception;
 
     String localInsert( JSONObject imageJson);
 

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

@@ -1,12 +1,16 @@
 package org.jeecg.modules.kuaishou.service.impl;
 
 import cn.com.ctop.common.utils.Check;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import constant.KuaishouInterfaceConstant;
+import org.jeecg.modules.ctop.entity.CtopOauthToken;
+import org.jeecg.modules.ctop.service.ICtopOauthTokenService;
 import org.jeecg.modules.kuaishou.entity.KuaiShouCreateAppTemplate;
 import org.jeecg.modules.kuaishou.mapper.KuaiShouCreateAppTemplateMapper;
 import org.jeecg.modules.kuaishou.service.IKuaiShouCreateAppTemplateService;
+import org.jeecg.modules.kuaishou.service.IKuaishouInterfaceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -23,11 +27,21 @@ import java.util.Map;
 public class KuaiShouCreateAppTemplateServiceImpl extends ServiceImpl<KuaiShouCreateAppTemplateMapper, KuaiShouCreateAppTemplate> implements IKuaiShouCreateAppTemplateService {
     @Autowired
     private KuaiShouCreateAppTemplateMapper appTemplateMapper;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+    @Autowired
+    private IKuaishouInterfaceService interfaceService;
 
     @Override
     public Map<String, Object> insert(KuaiShouCreateAppTemplate appTemplate) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
+            Long accountId = appTemplate.getAccountId();
+            CtopOauthToken cTopOauthToken = oauthTokenService.getOauthTokenByAccountId(String.valueOf(accountId));
+            if (Check.isNull(cTopOauthToken)) {
+                throw new Exception("未获取到token信息");
+            }
+            String accessToken = cTopOauthToken.getAccessToken();
             String loginId = appTemplate.getLoginId();
             String appVersion = appTemplate.getAppVersion();
             QueryWrapper<KuaiShouCreateAppTemplate> queryWrapper = new QueryWrapper<>();
@@ -48,6 +62,33 @@ public class KuaiShouCreateAppTemplateServiceImpl extends ServiceImpl<KuaiShouCr
                     appTemplate.setImageUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + appTemplate.getImageUrl());
                 }
                 appTemplateMapper.insert(appTemplate);
+
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        JSONObject apkJson = new JSONObject();
+                        String platform = appTemplate.getPlatform();
+                        apkJson.put("app_name", appTemplate.getAppName());
+                        apkJson.put("app_version", appTemplate.getAppVersion());
+                        apkJson.put("platform", platform);
+                        if (!Check.isNull(appTemplate.getPackageName())) {
+                            apkJson.put("package_name", appTemplate.getPackageName());
+                        }
+                        if (!Check.isNull(appTemplate.getImageUrl()) && ("1".equals(platform) || "2".equals(platform))) {
+                            Map<String, Object> imageMap = interfaceService.imageUpload(accountId, accessToken, (String) appTemplate.getImageUrl(), 1);
+                            apkJson.put("image_token", imageMap.get("imageToken"));
+                        }
+                        if ("1".equals(platform) && appTemplate.getUploadType() == 1) {
+                            apkJson.put("file", appTemplate.getFile());
+                            interfaceService.appCreate(accountId, accessToken, apkJson);
+                        } else {
+                            apkJson.put("url", appTemplate.getUrl());
+                            interfaceService.urlAppCreate(accountId, accessToken, apkJson);
+                        }
+                    }
+
+                };
+                thread.start();
                 resultMap.put("success", true);
                 resultMap.put("message", "创建应用成功");
                 resultMap.put("code", 0);

+ 6 - 8
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouCreateServiceImpl.java

@@ -128,7 +128,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                 if (!Check.isNull(appTemplate.getPackageName())) {
                     apkJson.put("package_name", appTemplate.getPackageName());
                 }
-                if (!Check.isNull(appTemplate.getImageUrl()) && ("1".equals(platform) || "3".equals(platform))) {
+                if (!Check.isNull(appTemplate.getImageUrl()) && ("1".equals(platform) || "2".equals(platform))) {
                     Map<String, Object> imageMap = kuaishouInterfaceService.imageUpload(accountId, accessToken, (String) appTemplate.getImageUrl(), 1);
                     Integer imageCode = (Integer) imageMap.get("code");
                     if (imageCode != 0) {
@@ -136,7 +136,6 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                     }
                     apkJson.put("image_token", imageMap.get("imageToken"));
                 }
-
                 Map<String, Object> apkMap;
                 if ("1".equals(platform) && appTemplate.getUploadType() == 1) {
                     apkJson.put("file", appTemplate.getFile());
@@ -192,16 +191,13 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
             if (!Check.isNull(groupCreateTemplate.getUnitType())) {
                 groupJson.put("unit_type", groupCreateTemplate.getUnitType());
             }
-
             if (!Check.isNull(groupCreateTemplate.getDeepConversionType())) {
                 groupJson.put("deep_conversion_type", groupCreateTemplate.getDeepConversionType());
             }
-
             if (!Check.isNull(groupCreateTemplate.getDeepConversionBid()) && groupCreateTemplate.getDeepConversionBid() > 0) {
                 groupJson.put("deep_conversion_bid", groupCreateTemplate.getDeepConversionBid());
             }
 
-
             JSONObject targetJson = new JSONObject();
             groupJson.put("target", targetJson);
 
@@ -248,7 +244,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
 
     @Override
     public Map<String, Object> createCreative(JSONObject requestJson) {
-        System.err.println("广告类型: " +requestJson.getInteger("positionType"));
+        System.err.println("广告类型: " + requestJson.getInteger("positionType"));
         System.err.println("素材类型:" + requestJson.getInteger("creativeMaterialType"));
         System.err.println("后贴片图片横竖 :" + requestJson.getString("singlePicTiepianType"));
 
@@ -312,6 +308,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                 localVideoJson.put("videoUrl", requestJson.getString("videoUrl"));
                 localVideoJson.put("description", requestJson.getString("description"));
                 localVideoJson.put("positionType", requestJson.getString("positionType"));
+                localVideoJson.put("accountId", requestJson.getString("accountId"));
                 String videoUrl = videoService.localInsert(localVideoJson); // 校验文件是否在本地有留存记录
                 if (Check.isNull(videoUrl)) {
                     logger.error("创建创意视频为空,accountId:{}", accountId);
@@ -355,6 +352,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                     imageJson.put("loginId", requestJson.getString("loginId"));
                     imageJson.put("videoUploadType", requestJson.getString("creativeMaterialType"));
                     imageJson.put("url", imageUrl);
+                    imageJson.put("accountId", accountId);
                     imageJson.put("positionType", requestJson.getString("positionType"));
                     String imagePath = imageService.localInsert(imageJson);
 
@@ -395,6 +393,7 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                         JSONObject haveLocalVideoJson = new JSONObject();
                         haveLocalVideoJson.put("positionType", requestJson.getString("positionType"));
                         haveLocalVideoJson.put("videoUrl", haveSinglePicVideoUrl);
+                        haveLocalVideoJson.put("accountId", accountId);
                         haveLocalVideoJson.put("description", requestJson.getString("description"));
                         haveLocalVideoJson.put("login_id", requestJson.getString("loginId"));
                         haveLocalVideoJson.put("videoType", requestJson.getString("creativeMaterialType"));
@@ -441,12 +440,11 @@ public class KuaiShouCreateServiceImpl implements IKuaiShouCreateService {
                         }
                         JSONObject imageJson = new JSONObject();
                         imageJson.put("url", imageUrl);
+                        imageJson.put("accountId", accountId);
                         imageJson.put("positionType", requestJson.getInteger("positionType"));
                         imageJson.put("loginId", requestJson.getString("loginId"));
                         imageJson.put("videoUploadType", requestJson.getString("singlePicTiepianType"));
-
                         String imagePath = imageService.localInsert(imageJson);
-
                         Map<String, Object> imageMap = kuaishouInterfaceService.imageUpload(accountId, accessToken, imagePath, 0);
                         if ((Integer) imageMap.get("code") != 0) {
                             logger.error("上传后贴片单张图片素材失败,accountId:{}", accountId);

+ 33 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouImageServiceImpl.java

@@ -6,10 +6,13 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import constant.KuaishouInterfaceConstant;
 import org.jeecg.common.util.encryption.AesEncryptUtil;
+import org.jeecg.modules.ctop.entity.CtopOauthToken;
+import org.jeecg.modules.ctop.service.ICtopOauthTokenService;
 import org.jeecg.modules.kuaishou.entity.KuaiShouImage;
 import org.jeecg.modules.kuaishou.entity.KuaiShouVideo;
 import org.jeecg.modules.kuaishou.mapper.KuaiShouImageMapper;
 import org.jeecg.modules.kuaishou.service.IKuaiShouImageService;
+import org.jeecg.modules.kuaishou.service.IKuaishouInterfaceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -29,9 +32,20 @@ public class KuaiShouImageServiceImpl extends ServiceImpl<KuaiShouImageMapper, K
     @Autowired
     private KuaiShouImageMapper imageMapper;
 
+    @Autowired
+    private IKuaishouInterfaceService interfaceService;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+
     @Override
-    public void insert(JSONObject requestJson) {
+    public void insert(JSONObject requestJson) throws Exception {
         JSONArray imageArr = requestJson.getJSONArray("localImageUrl");
+        Long accountId = requestJson.getLong("accountId");
+        CtopOauthToken cTopOauthToken = oauthTokenService.getOauthTokenByAccountId(String.valueOf(accountId));
+        if (Check.isNull(cTopOauthToken)) {
+            throw new Exception("未获取到token信息");
+        }
+        String accessToken = cTopOauthToken.getAccessToken();
         if (!Check.isNull(imageArr)) {
             for (int i = 0; i < imageArr.size(); i++) {
                 KuaiShouImage image = new KuaiShouImage();
@@ -46,14 +60,26 @@ public class KuaiShouImageServiceImpl extends ServiceImpl<KuaiShouImageMapper, K
                 image.setLoginId(requestJson.getString("loginId"));
                 image.setMaterialType(requestJson.getString("materialType"));
                 image.setPositionType(requestJson.getString("positionType"));
-                image.setLocalUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + imageUrl);
+                image.setAccountId(accountId);
+                String imageUrlStr;
+                if (!imageUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX + imageUrl)) {
+                    imageUrlStr = KuaishouInterfaceConstant.HTTPS_PREFIX + imageUrl;
+                } else {
+                    imageUrlStr = imageUrl;
+                }
+                image.setLocalUrl(imageUrlStr);
                 imageMapper.insert(image);
 
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        interfaceService.imageUpload(accountId, accessToken, imageUrlStr, 0);
+                    }
+                };
+                thread.start();
             }
-
         }
 
-
     }
 
     @Override
@@ -62,9 +88,11 @@ public class KuaiShouImageServiceImpl extends ServiceImpl<KuaiShouImageMapper, K
         String positionType = imageJson.getString("positionType");
         String videoUploadType = imageJson.getString("videoUploadType");
         String loginId = imageJson.getString("loginId");
+        Long accountId = imageJson.getLong("accountId");
 
         QueryWrapper<KuaiShouImage> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("local_url", url);
+        queryWrapper.eq("account_id", accountId);
         queryWrapper.eq("position_type", positionType);
         queryWrapper.eq("material_type", videoUploadType);
         queryWrapper.eq("login_id", loginId);
@@ -90,6 +118,7 @@ public class KuaiShouImageServiceImpl extends ServiceImpl<KuaiShouImageMapper, K
             } else {
                 image.setLocalUrl(url);
             }
+            image.setAccountId(accountId);
 
             imageMapper.insert(image);
             return image.getLocalUrl().toString();

+ 33 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/kuaishou/service/impl/KuaiShouVideoServiceImpl.java

@@ -7,9 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import constant.KuaishouInterfaceConstant;
 import org.jeecg.common.util.encryption.AesEncryptUtil;
+import org.jeecg.modules.ctop.entity.CtopOauthToken;
+import org.jeecg.modules.ctop.service.ICtopOauthTokenService;
 import org.jeecg.modules.kuaishou.entity.KuaiShouVideo;
 import org.jeecg.modules.kuaishou.mapper.KuaiShouVideoMapper;
 import org.jeecg.modules.kuaishou.service.IKuaiShouVideoService;
+import org.jeecg.modules.kuaishou.service.IKuaishouInterfaceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -23,12 +26,22 @@ import org.springframework.stereotype.Service;
 public class KuaiShouVideoServiceImpl extends ServiceImpl<KuaiShouVideoMapper, KuaiShouVideo> implements IKuaiShouVideoService {
     @Autowired
     private KuaiShouVideoMapper kuaiShouVideoMapper;
+    @Autowired
+    private IKuaishouInterfaceService interfaceService;
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
 
     @Override
     public void insert(JSONObject requestJson) throws Exception {
         if (Check.isNull(requestJson)) {
             throw new Exception("传递参数不能为空");
         }
+        Long accountId = requestJson.getLong("accountId");
+        CtopOauthToken cTopOauthToken = oauthTokenService.getOauthTokenByAccountId(String.valueOf(accountId));
+        if (Check.isNull(cTopOauthToken)) {
+            throw new Exception("未获取到token信息");
+        }
+        String accessToken = cTopOauthToken.getAccessToken();
         JSONArray localArr = requestJson.getJSONArray("localUrl");
         if (!Check.isNull(localArr)) {
             for (int i = 0; i < localArr.size(); i++) {
@@ -42,11 +55,26 @@ public class KuaiShouVideoServiceImpl extends ServiceImpl<KuaiShouVideoMapper, K
                     fileNameStr = split[0];
                 }
                 video.setLoginId(requestJson.getString("loginId"));
+                video.setAccountId(accountId);
                 video.setVideoName(AesEncryptUtil.getURLDecoderString(fileNameStr));
-                video.setLocalUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
+                String urlStr;
+                if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    urlStr = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
+                } else {
+                    urlStr = url;
+                }
+                video.setLocalUrl(urlStr);
                 video.setMaterialType(requestJson.getString("materialType"));
                 video.setPositionType(requestJson.getString("positionType"));
                 kuaiShouVideoMapper.insert(video);
+                // 多线程上传文件
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        interfaceService.videoUpload(accountId, accessToken, urlStr);
+                    }
+                };
+                thread.start();
             }
         }
 
@@ -56,9 +84,11 @@ public class KuaiShouVideoServiceImpl extends ServiceImpl<KuaiShouVideoMapper, K
     public String localInsert(JSONObject requestJson) throws Exception {
         String loginId = requestJson.getString("login_id");
         String videoUrl = requestJson.getString("videoUrl");
+        Long accountId = requestJson.getLong("accountId");
         QueryWrapper<KuaiShouVideo> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("login_id", loginId);
         queryWrapper.eq("local_url", videoUrl);
+        queryWrapper.eq("account_id", accountId);
         queryWrapper.orderByDesc("create_time");
         queryWrapper.last("limit 1");
         KuaiShouVideo localVideo = kuaiShouVideoMapper.selectOne(queryWrapper);
@@ -73,7 +103,7 @@ public class KuaiShouVideoServiceImpl extends ServiceImpl<KuaiShouVideoMapper, K
                     fileNameStr = split[0];
                 }
 
-                if (!videoUrl.contains("https:")) {
+                if (!videoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
                     String url = KuaishouInterfaceConstant.HTTPS_PREFIX + videoUrl;
                     video.setLocalUrl(url);
                 } else {
@@ -82,6 +112,7 @@ public class KuaiShouVideoServiceImpl extends ServiceImpl<KuaiShouVideoMapper, K
 
                 video.setLoginId(loginId);
                 video.setMaterialType(requestJson.getString("videoType"));
+                video.setAccountId(accountId);
                 video.setPositionType(requestJson.getString("positionType"));
                 video.setVideoName(AesEncryptUtil.getURLDecoderString(fileNameStr));
                 kuaiShouVideoMapper.insert(video);

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

@@ -744,8 +744,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             logger.info(resultJson.toJSONString());
             if (!Check.isNullMap(resultJson)) {
                 Integer code = resultJson.getInteger("code");
-                Integer is_activate = null;
-                Integer is_form_submit = null;
+                Integer is_activate;
+                Integer is_form_submit;
                 if (code == 0) {
                     Map<String, Object> deleteMap = new HashMap<>();
                     deleteMap.put("account_id", advertiserId);
@@ -893,6 +893,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     @Override
     public Map<String, Object> videoUpload(Long advertiserId, String accessToken, String videoUrl) {
+        logger.info("开始上传视频");
         Map<String, Object> returnMap = new HashMap<>();
         try {
             QueryWrapper<KuaiShouVideoUpload> wrapper = new QueryWrapper<>();
@@ -1156,6 +1157,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     @Override
     public Map<String, Object> imageUpload(Long advertiserId, String accessToken, String filePath, Integer type) {
+        logger.info("上传快手图片");
         Map<String, Object> returnMap = new HashMap<>();
         try {
             QueryWrapper<KuaiShouImageUploand> queryWrapper = new QueryWrapper<>();
@@ -1253,6 +1255,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     @Override
     public Map<String, Object> appCreate(Long advertiserId, String accessToken, JSONObject requestJson) {
+        logger.info("快手创建file应用");
         Map<String, Object> returnMap = new HashMap<>();
         try {
             String filePath = requestJson.getString("file");
@@ -1262,6 +1265,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             queryWrapper.last("limit 1");
             KuaiShouAppCreate kuaiShouAppCreate = appCreateMapper.selectOne(queryWrapper);
             if (!Check.isNull(kuaiShouAppCreate)) {
+                logger.info("file应用已经存在");
                 returnMap.put("code", 0);
                 returnMap.put("message", "文件已上传");
                 returnMap.put("success", true);
@@ -1301,10 +1305,10 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                         if (i > 0) {
                             logger.info("快手创建应用成功");
                         }
-                        returnMap.put("code", 0);
-                        returnMap.put("message", "success");
                         returnMap.put("appId", dataJson.getLong("app_id"));
                         returnMap.put("success", true);
+                        returnMap.put("code", 0);
+                        returnMap.put("message", "success");
                     }
 
                 } else {
@@ -1340,6 +1344,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     @Override
     public Map<String, Object> urlAppCreate(Long accountId, String accessToken, JSONObject apkJson) {
+        logger.info("快手创建url应用");
         Map<String, Object> returnMap = new HashMap<>();
         try {
             String appUrl = apkJson.getString("url");
@@ -1350,6 +1355,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             queryWrapper.last("limit 1");
             KuaiShouAppCreate kuaiShouAppCreate = appCreateMapper.selectOne(queryWrapper);
             if (!Check.isNull(kuaiShouAppCreate)) {
+                logger.info("url应用已经存在");
                 returnMap.put("code", 0);
                 returnMap.put("message", "文件已上传");
                 returnMap.put("success", true);

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

@@ -102,7 +102,8 @@ public class ShiroRealm extends AuthorizingRealm {
         // 解密获得username,用于和数据库进行对比
         String username = JwtUtil.getUsername(token);
         if (username == null) {
-            throw new AuthenticationException("token非法无效!");
+            log.error("token非法无效!");
+            // throw new AuthenticationException("token非法无效!");
         }
 
         // 查询用户信息