package com.yingpaipay.business.enumeration;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.context.i18n.LocaleContextHolder;

/**
 * @Author: Huanyi
 * @CreateTime: 2025-12-08
 * @Description:
 * @Version: 1.0
 */

@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum ProjectStatusEnum {

    UNPLAYED(0, "未开始", "Not Start"),
    UNDERWAY(1, "进行中", "Underway"),
    PAUSED(2, "暂停中", "Pausing"),
    FINISHED(3, "已完成", "Finished"),
    ;

    private final Integer value;
    private final String zhLabel;
    private final String enLabel;

    public static String getLabel(Integer value) {
        for (ProjectStatusEnum status : values()) {
            if (value.equals(status.value)) {
                return LocaleContextHolder.getLocale().getLanguage().equals("zh") ? status.zhLabel : status.enLabel;
            }
        }
        throw new IllegalArgumentException("未知状态");
    }

}
