yumeng 5 лет назад
Родитель
Сommit
aa2b9dc8c9

+ 15 - 13
module-common/src/main/java/cn/com/ctop/common/module/enums/MaterialEnum.java

@@ -3,26 +3,26 @@ package cn.com.ctop.common.module.enums;
 public enum MaterialEnum {
 
 
-    VerticalVideoSmall(1, 720, 1280),
-    VerticalVideoBig(1, 1080, 1920),
-    HorizontalVideoSmall(2, 1280, 720),
-    HorizontalVideoBig(2, 1920, 1080);
+    VerticalVideoSmall(1, 720L, 1280L),
+    VerticalVideoBig(1, 1080L, 1920L),
+    HorizontalVideoSmall(2, 1280L, 720L),
+    HorizontalVideoBig(2, 1920L, 1080L);
 
     private Integer type;
-    private Integer width;
-    private Integer height;
+    private Long width;
+    private Long height;
 
 
-    private MaterialEnum(Integer type, Integer width, Integer height) {
+    private MaterialEnum(Integer type, Long width, Long height) {
         this.type = type;
         this.width = width;
         this.width = width;
         this.height = height;
     }
 
-    public static Integer getTypeBySize(Integer width, Integer height) {
+    public static Integer getTypeBySize(Long width, Long height) {
         for (MaterialEnum material : MaterialEnum.values()) {
-            if (width.equals(material.width) && height.equals(material.height)) {
+            if (width == material.width && height == material.height) {
                 return material.type;
             }
         }
@@ -30,6 +30,8 @@ public enum MaterialEnum {
         return 0;
     }
 
+
+
     public Integer getType() {
         return type;
     }
@@ -38,19 +40,19 @@ public enum MaterialEnum {
         this.type = type;
     }
 
-    public Integer getWidth() {
+    public Long getWidth() {
         return width;
     }
 
-    public void setWidth(Integer width) {
+    public void setWidth(Long width) {
         this.width = width;
     }
 
-    public Integer getHeight() {
+    public Long getHeight() {
         return height;
     }
 
-    public void setHeight(Integer height) {
+    public void setHeight(Long height) {
         this.height = height;
     }
 }

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouImageGet.java

@@ -49,13 +49,13 @@ public class KuaiShouImageGet {
      */
     @Excel(name = "宽", width = 15)
     @ApiModelProperty(value = "宽")
-    private Integer width;
+    private Long width;
     /**
      * 高
      */
     @Excel(name = "高", width = 15)
     @ApiModelProperty(value = "高")
-    private Integer height;
+    private Long height;
     /**
      * 图片大小
      */

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaiShouVideoGet.java

@@ -49,13 +49,13 @@ public class KuaiShouVideoGet {
      */
     @Excel(name = "宽", width = 15)
     @ApiModelProperty(value = "宽")
-    private Integer width;
+    private Long width;
     /**
      * 高
      */
     @Excel(name = "高", width = 15)
     @ApiModelProperty(value = "高")
-    private Integer height;
+    private Long height;
     /**
      * 视频预览链接
      */

+ 12 - 14
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -1905,8 +1905,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                 KuaiShouVideoGet videoGet = new KuaiShouVideoGet();
                                 videoGet.setId(detailJson.getString("photo_id"));
                                 videoGet.setAccountId(advertiserId);
-                                videoGet.setWidth(detailJson.getInteger("width"));
-                                videoGet.setHeight(detailJson.getInteger("height"));
+                                videoGet.setWidth(detailJson.getLong("width"));
+                                videoGet.setHeight(detailJson.getLong("height"));
                                 videoGet.setUrl(detailJson.getString("url"));
                                 videoGet.setCoverUrl(detailJson.getString("creative_name"));
                                 videoGet.setPhotoId(detailJson.getString("photo_id"));
@@ -2459,14 +2459,12 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                                 KuaiShouVideoGet videoGet = new KuaiShouVideoGet();
                                 videoGet.setAccountId(advertiserId);
                                 videoGet.setId(advertiserId + signature);
-                                Integer width = Integer.valueOf(dataJson.getString("width"));
-                                videoGet.setWidth(width);
-                                Integer height = Integer.valueOf(dataJson.getString("height"));
-                                videoGet.setHeight(height);
+                                videoGet.setWidth(dataJson.getLong("width"));
+                                videoGet.setHeight(dataJson.getLong("height"));
                                 videoGet.setUrl(dataJson.getString("url"));
                                 videoGet.setPhotoId(dataJson.getString("photo_id"));
                                 videoGet.setCoverUrl(dataJson.getString("cover_url"));
-                                Integer type = MaterialEnum.getTypeBySize(width, height);
+                                Integer type = MaterialEnum.getTypeBySize(dataJson.getLong("width"), dataJson.getLong("height"));
                                 if (!Check.isNull(type)) {
                                     videoGet.setMaterialType(type);
                                 }
@@ -2521,14 +2519,14 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                         imageGet.setAccountId(advertiserId);
                         imageGet.setUrl(dataJson.getString("url"));
 
-                        Integer width = Integer.valueOf(dataJson.getString("width"));
-                        Integer height = Integer.valueOf(dataJson.getString("height"));
+                    /*    Integer width = Integer.valueOf(dataJson.getLong("width"));
+                        Integer height = Integer.valueOf(dataJson.getLong("height"));*/
 
-                        imageGet.setWidth(width);
-                        imageGet.setHeight(height);
+                        imageGet.setWidth(dataJson.getLong("width"));
+                        imageGet.setHeight(dataJson.getLong("height"));
                         imageGet.setSize(dataJson.getLong("size"));
                         imageGet.setFormat(dataJson.getString("format"));
-                        Integer type = MaterialEnum.getTypeBySize(width, height);
+                        Integer type = MaterialEnum.getTypeBySize(dataJson.getLong("width"), dataJson.getLong("height"));
                         if (!Check.isNull(type)) {
                             imageGet.setMaterialType(type);
                         }
@@ -3237,8 +3235,8 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
         List<KuaiShouImageGet> list = new ArrayList<>();
         KuaiShouImageGet kuaiShouImageGet1 = new KuaiShouImageGet();
         kuaiShouImageGet1.setUrl("http://static.yximgs.com/udata/pkg/markb21f94845c4350.jpg");
-        kuaiShouImageGet1.setWidth(720);
-        kuaiShouImageGet1.setHeight(1280);
+        kuaiShouImageGet1.setWidth(720L);
+        kuaiShouImageGet1.setHeight(1280L);
         kuaiShouImageGet1.setSize(441029L);
         kuaiShouImageGet1.setFormat("jpg");
         kuaiShouImageGet1.setImageToken("market0a8a3104ee6b4f148ab21f94845c4350.jpg");