package com.ai.da.common.enums;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author yanglei
 * @description 系统文件 二级类型枚举 bag earrings hairstyle shoes icon blouse dress outwear skirt trousers
 * @create 2022-10-6 17:33
 **/
public enum SysFileLevel2TypeEnum {
    /**
     * ICON
     */
    ICON("Icon", "icon"),

    BAG("Bag", "bag"),

    EARRINGS("Earring", "earring"),

    HAIRSTYLE("Hairstyle", "hairstyle"),

    SHOES("Shoes", "shoes"),

    BODY("Body", "body"),

    BLOUSE("Blouse", "blouse"),

    DRESS("Dress", "dress"),

    OUTWEAR("Outwear", "outwear"),

    SKIRT("Skirt", "skirt"),

    TROUSERS("Trousers", "trousers");

    private String realName;
    /**
     * 上传路径名字
     */
    private String uploadPathName;

    SysFileLevel2TypeEnum(String realName, String uploadPathName) {
        this.realName = realName;
        this.uploadPathName = uploadPathName;
    }

    public String getRealName() {
        return realName;
    }

    public String getUploadPathName() {
        return uploadPathName;
    }

    public static SysFileLevel2TypeEnum uploadOf(String uploadPathName) {
        return Stream.of(SysFileLevel2TypeEnum.values()).filter(v -> v.getUploadPathName().equals(uploadPathName)).findFirst().orElse(null);
    }

    public static SysFileLevel2TypeEnum realNameOf(String realName) {
        return Stream.of(SysFileLevel2TypeEnum.values()).filter(v -> v.getRealName().equals(realName)).findFirst().orElse(null);
    }

    public static SysFileLevel2TypeEnum realNameOfPython(String realName) {
        return Stream.of(BLOUSE, DRESS, OUTWEAR, SKIRT, TROUSERS).filter(v -> v.getRealName().equals(realName)).findFirst().orElse(null);
    }

    public static List<String> ofPython() {
        return Stream.of(BLOUSE, DRESS, OUTWEAR, SKIRT, TROUSERS).map(SysFileLevel2TypeEnum::getRealName).collect(Collectors.toList());
    }

    public static List<String> ofPythonPath() {
        return Stream.of(BLOUSE, DRESS, OUTWEAR, SKIRT, TROUSERS).map(SysFileLevel2TypeEnum::getUploadPathName).collect(Collectors.toList());
    }

    public static final List<String> ACCESSORIES_LIST = Arrays.asList(
            SysFileLevel2TypeEnum.BAG.getRealName(),
            SysFileLevel2TypeEnum.EARRINGS.getRealName(),
            SysFileLevel2TypeEnum.HAIRSTYLE.getRealName(),
            SysFileLevel2TypeEnum.SHOES.getRealName(),
            SysFileLevel2TypeEnum.BODY.getRealName()
    );

    public static final List<String> IMAGES_LIST = Arrays.asList(
            SysFileLevel2TypeEnum.BLOUSE.getRealName(),
            SysFileLevel2TypeEnum.DRESS.getRealName(),
            SysFileLevel2TypeEnum.OUTWEAR.getRealName(),
            SysFileLevel2TypeEnum.SKIRT.getRealName(),
            SysFileLevel2TypeEnum.TROUSERS.getRealName()
    );

}
