package com.ai.da.model.enums;

import com.fasterxml.jackson.annotation.JsonValue;

public enum DesignElementsEnum implements IEnumDisplay {
    EMBROIDERY("刺绣", "Embroidery"),
    BEADING("钉珠", "Beading"),
    PEARL("珍珠", "Pearl"),
    RIVET("铆钉", "Rivet"),
    BUTTON("纽扣", "Button"),
    BELT("腰带", "Belt"),
    CORSAGE("胸花", "Corsage"),
    ZIPPER("拉链", "Zipper"),
    POCKET("口袋", "Pocket");

    private final String chinese;
    private final String english;

    @Override
    @JsonValue
    public String getValue() {
        return this.english;
    }

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

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

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

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