package com.ai.da.model.enums;

import lombok.Data;
import lombok.Getter;

@Getter
public enum StyleEnum {
    // 定义风格及其对应的中英文描述
    NEW_CHINESE("新中式", "New Chinese"),
    COUNTRY_STYLE("田园风", "Country Style"),
    FUTURISM("未来主义", "Futurism"),
    MINIMALISM("极简风", "Minimalism"),
    LOLITA("洛丽塔", "Lolita"),
    Y2K("Y2K", "Y2K"),
    BUSINESS("商务风", "Business"),
    MERLAD("梅拉德", "Merlad"),
    OUTDOOR_FUNCTIONAL("户外机能", "Outdoor Functional"),
    ROCK("摇滚", "Rock"),
    DOPAMINE("多巴胺", "Dopamine"),
    GOTHIC("哥特风", "Gothic"),
    POST_APOCALYPTIC("废土", "Post-apocalyptic"),
    ROMANTIC("浪漫", "Romantic"),
    WABI_SABI("侘寂", "Wabi-sabi");

    private final String chinese;
    private final String english;

    // 构造函数
    StyleEnum(String chinese, String english) {
        this.chinese = chinese;
        this.english = english;
    }

    public static boolean isValidName(String name) {
        for (StyleEnum styleEnum : StyleEnum.values()) {
            if (styleEnum.name().equalsIgnoreCase(name)) {
                return true;
            }
        }
        return false;
    }

    // 获取中文描述
    public String getChinese() {
        return chinese;
    }

    // 获取英文描述
    public String getEnglish() {
        return english;
    }

    // 重写toString方法，返回格式化的描述
    @Override
    public String toString() {
        return chinese + " (" + english + ")";
    }
    public static StyleEnum fromName(String name) {
        for (StyleEnum style : StyleEnum.values()) {
            if (style.name().equals(name)) {
                return style;
            }
        }
        throw new IllegalArgumentException("No enum constant for name: " + name);
    }
}
