BUGFIX:衣服图层添加优先级后对之前数据不兼容的修复-漏提交

This commit is contained in:
2023-12-14 15:49:29 +08:00
parent 86ab0806fd
commit 2de3a73fef

View File

@@ -0,0 +1,56 @@
package com.ai.da.common.enums;
import lombok.Getter;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
public enum LayersPriorityEnum {
EARRING_FRONT("earring_front","Earring",99),
BAG_FRONT("bag_front","Bag",98),
HAIRSTYLE_FRONT("hairstyle_front","Hairstyle",97),
OUTWEAR_FRONT("outwear_front","Outwear",20),
TOPS_FRONT("tops_front","Tops",19),
DRESS_FRONT("dress_front","Dress",18),
BLOUSE_FRONT("blouse_front","Blouse",17),
SKIRT_FRONT("skirt_front","Skirt",16),
TROUSERS_FRONT("trousers_front","Trousers",15),
BOTTOMS_FRONT("bottoms_front","Bottoms",14),
SHOES_RIGHT("shoes_right","Shoes",1),
SHOES_LEFT("shoes_left","Shoes",1),
BODY("body","Body",0),
BOTTOMS_BACK("bottoms_back","Bottoms",-14),
TROUSERS_BACK("trousers_back","Trousers",-15),
SKIRT_BACK("skirt_back","Skirt",-16),
BLOUSE_BACK("blouse_back","Blouse",-17),
DRESS_BACK("dress_back","Dress",-18),
TOPS_BACK("tops_back","Tops",-19),
OUTWEAR_BACK("outwear_back","Outwear",-20),
HAIRSTYLE_BACK("hairstyle_back","Hairstyle",-97),
BAG_BACK("bag_back","Bag",-98),
EARRING_BACK("earring_back","Earring",-99);
@Getter
private String realName;
@Getter
private String type;
@Getter
private Integer value;
LayersPriorityEnum(String realName, String type,Integer value) {
this.realName = realName;
this.type = type;
this.value = value;
}
public static LayersPriorityEnum getValueByType(String type){
return Stream.of(LayersPriorityEnum.values()).filter(l -> l.getType().equals(type)).findFirst().orElse(null);
}
public static LayersPriorityEnum getValueByLayerCategory(String layerCategory){
return Stream.of(LayersPriorityEnum.values()).filter(l -> l.getRealName().equals(layerCategory)).findFirst().orElse(null);
}
}