|
@@ -1,78 +1,92 @@
|
|
package cn.com.ctop.common.module.enums;
|
|
package cn.com.ctop.common.module.enums;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 素材类型
|
|
* 素材类型
|
|
*/
|
|
*/
|
|
public enum MaterialEnum {
|
|
public enum MaterialEnum {
|
|
|
|
|
|
|
|
|
|
- VerticalVideoSmall(1, 720, 1280),
|
|
|
|
- VerticalVideo787Small(1, 787, 1280),
|
|
|
|
- VerticalVideo846Small(1, 846, 1536),
|
|
|
|
- VerticalVideo1080mall(1, 1080, 2200),
|
|
|
|
- VerticalVideoBig(1, 1080, 1920),
|
|
|
|
- VerticalVideo360(1, 360, 640),
|
|
|
|
- VerticalVideo362(1, 362, 640),
|
|
|
|
- VerticalVideo368(1, 368, 490),
|
|
|
|
- VerticalVideo363(1, 363, 640),
|
|
|
|
- VerticalVideo438(1, 438, 640),
|
|
|
|
- VerticalVideo480(1, 480, 640),
|
|
|
|
- VerticalVideo525(1, 525, 640),
|
|
|
|
- VerticalVideo540(1, 540, 960),
|
|
|
|
- VerticalVideo544(1, 544, 726),
|
|
|
|
- VerticalVideo590(1, 590, 1280),
|
|
|
|
- VerticalVideo694(1, 694, 1236),
|
|
|
|
- VerticalVideo704(1, 704, 1252),
|
|
|
|
- VerticalVideo710(1, 710, 1264),
|
|
|
|
- VerticalVideo714(1, 714, 1270),
|
|
|
|
- VerticalVideo716(1, 716, 1276),
|
|
|
|
- VerticalVideo718(1, 718, 1278),
|
|
|
|
- VerticalVideo719(1, 719, 1170),
|
|
|
|
- VerticalVideo720(1, 720, 960),
|
|
|
|
- VerticalVideo750(1, 750, 1334),
|
|
|
|
- VerticalVideo787(1, 787, 1280),
|
|
|
|
- VerticalVideo864(1, 864, 1536),
|
|
|
|
- VerticalVideo1088(1, 1088, 1920),
|
|
|
|
- VerticalVideo1181(1, 1181, 1920),
|
|
|
|
- VerticalVideo1216(1, 1216, 2160),
|
|
|
|
- VerticalVideo1296(1, 1296, 2304),
|
|
|
|
- VerticalVideo1440(1, 1440, 2560),
|
|
|
|
- VerticalVideo2160(1, 2160, 3840),
|
|
|
|
- HorizontalVideoSmall(2, 1280, 720),
|
|
|
|
- HorizontalVideoBig(2, 1920, 1080),
|
|
|
|
- HorizontalVideo640(2, 640, 368),
|
|
|
|
- HorizontalVideo1281(2, 1281, 720),
|
|
|
|
- HorizontalVideo1400(2, 1400, 720),
|
|
|
|
- HorizontalVideo1700(2, 1700, 1080),
|
|
|
|
- HorizontalVideo1902(2, 1902, 1080),
|
|
|
|
- HorizontalVideo1920(2, 1920, 1080),
|
|
|
|
- BianlitieImageBig(4, 540, 540),
|
|
|
|
- BianLitieImageSmall(4, 450, 450);
|
|
|
|
|
|
+ VerticalVideoSmall(1, 720, 1280, 1),
|
|
|
|
+ VerticalVideo787Small(1, 787, 1280, 1),
|
|
|
|
+ VerticalVideo846Small(1, 846, 1536, 1),
|
|
|
|
+ VerticalVideo1080mall(1, 1080, 2200,1),
|
|
|
|
+ VerticalVideoBig(1, 1080, 1920, 1),
|
|
|
|
+ VerticalVideo360(1, 360, 640, 1),
|
|
|
|
+ VerticalVideo362(1, 362, 640, 1),
|
|
|
|
+ VerticalVideo368(1, 368, 490, 1),
|
|
|
|
+ VerticalVideo363(1, 363, 640, 1),
|
|
|
|
+ VerticalVideo438(1, 438, 640, 1),
|
|
|
|
+ VerticalVideo480(1, 480, 640, 1),
|
|
|
|
+ VerticalVideo525(1, 525, 640, 1),
|
|
|
|
+ VerticalVideo540(1, 540, 960, 1),
|
|
|
|
+ VerticalVideo544(1, 544, 726, 1),
|
|
|
|
+ VerticalVideo590(1, 590, 1280, 1),
|
|
|
|
+ VerticalVideo694(1, 694, 1236, 1),
|
|
|
|
+ VerticalVideo704(1, 704, 1252, 1),
|
|
|
|
+ VerticalVideo710(1, 710, 1264, 1),
|
|
|
|
+ VerticalVideo714(1, 714, 1270, 1),
|
|
|
|
+ VerticalVideo716(1, 716, 1276, 1),
|
|
|
|
+ VerticalVideo718(1, 718, 1278, 1),
|
|
|
|
+ VerticalVideo719(1, 719, 1170, 1),
|
|
|
|
+ VerticalVideo720(1, 720, 960, 1),
|
|
|
|
+ VerticalVideo750(1, 750, 1334, 1),
|
|
|
|
+ VerticalVideo787(1, 787, 1280, 1),
|
|
|
|
+ VerticalVideo864(1, 864, 1536, 1),
|
|
|
|
+ VerticalVideo1088(1, 1088, 1920, 1),
|
|
|
|
+ VerticalVideo1181(1, 1181, 1920, 1),
|
|
|
|
+ VerticalVideo1216(1, 1216, 2160, 1),
|
|
|
|
+ VerticalVideo1296(1, 1296, 2304, 1),
|
|
|
|
+ VerticalVideo1440(1, 1440, 2560, 1),
|
|
|
|
+ VerticalVideo2160(1, 2160, 3840, 1),
|
|
|
|
+ HorizontalVideoSmall(2, 1280, 720, 1),
|
|
|
|
+ HorizontalVideoBig(2, 1920, 1080, 1),
|
|
|
|
+ HorizontalVideo640(2, 640, 368, 1),
|
|
|
|
+ HorizontalVideo1281(2, 1281, 720, 1),
|
|
|
|
+ HorizontalVideo1400(2, 1400, 720, 1),
|
|
|
|
+ HorizontalVideo1700(2, 1700, 1080, 1),
|
|
|
|
+ HorizontalVideo1902(2, 1902, 1080, 1),
|
|
|
|
+ HorizontalVideo1920(2, 1920, 1080, 1),
|
|
|
|
+ BianlitieImageBig(4, 540, 540, 1),
|
|
|
|
+ BianLitieImageSmall(4, 450, 450, 1),
|
|
|
|
+ kaipingVideo1280(1, 720, 1280, 0),
|
|
|
|
+ kaipingVideo1440(1, 720, 1440, 0),
|
|
|
|
+ kaipingVideo1520(1, 720, 1520, 0),
|
|
|
|
+ kaipingVideo1560(1, 720, 1560, 0);
|
|
|
|
|
|
private Integer type;
|
|
private Integer type;
|
|
private Integer width;
|
|
private Integer width;
|
|
private Integer height;
|
|
private Integer height;
|
|
|
|
+ private Integer isKaiPing;
|
|
|
|
|
|
|
|
|
|
- private MaterialEnum(Integer type, Integer width, Integer height) {
|
|
|
|
|
|
+ private MaterialEnum(Integer type, Integer width, Integer height, Integer isKaiPing) {
|
|
this.type = type;
|
|
this.type = type;
|
|
this.width = width;
|
|
this.width = width;
|
|
this.height = height;
|
|
this.height = height;
|
|
|
|
+ this.isKaiPing = isKaiPing;
|
|
}
|
|
}
|
|
|
|
|
|
- public static Integer getTypeBySize(Integer widthStr, Integer heightStr) {
|
|
|
|
|
|
+ public static Map<String, Integer> getTypeBySize(Integer widthStr, Integer heightStr) {
|
|
|
|
+ Map<String, Integer> map = new HashMap<>();
|
|
for (MaterialEnum material : MaterialEnum.values()) {
|
|
for (MaterialEnum material : MaterialEnum.values()) {
|
|
Integer width = material.getWidth();
|
|
Integer width = material.getWidth();
|
|
Integer height = material.getHeight();
|
|
Integer height = material.getHeight();
|
|
if (widthStr.equals(width) && heightStr.equals(height)) {
|
|
if (widthStr.equals(width) && heightStr.equals(height)) {
|
|
- return material.getType();
|
|
|
|
|
|
+ map.put("type", material.getType());
|
|
|
|
+ map.put("isKaiPing", material.getIsKaiPing());
|
|
|
|
+
|
|
|
|
+ return map;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- return 1;
|
|
|
|
|
|
+ map.put("type", 1);
|
|
|
|
+ map.put("isKaiPing", 1);
|
|
|
|
+ return map;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
public Integer getType() {
|
|
public Integer getType() {
|
|
return type;
|
|
return type;
|
|
}
|
|
}
|
|
@@ -97,12 +111,21 @@ public enum MaterialEnum {
|
|
this.height = height;
|
|
this.height = height;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public Integer getIsKaiPing() {
|
|
|
|
+ return isKaiPing;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setIsKaiPing(Integer isKaiPing) {
|
|
|
|
+ this.isKaiPing = isKaiPing;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public String toString() {
|
|
public String toString() {
|
|
return "MaterialEnum{" +
|
|
return "MaterialEnum{" +
|
|
"type=" + type +
|
|
"type=" + type +
|
|
", width=" + width +
|
|
", width=" + width +
|
|
", height=" + height +
|
|
", height=" + height +
|
|
|
|
+ ", isKaiPing=" + isKaiPing +
|
|
'}';
|
|
'}';
|
|
}
|
|
}
|
|
}
|
|
}
|