package cn.sikey.mcdisk.enums;

import cn.hutool.core.util.ArrayUtil;
import cn.sikey.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @Author: nelson
 * @Date: 2025/5/30
 * @Description: 目录类型
 */
@AllArgsConstructor
@Getter
public enum CatalogTypeEnum implements IntArrayValuable {
    ORDINARY_PHOTO_ALBUM(1, "普通相册"),
    MUSIC_CATALOG(2, "音乐目录"),
    DOCUMENT_DIRECTORY(3, "文档目录"),
    AVATAR_DIRECTORY(4, "头像目录"),
    ALBUM_CATALOG(5, "影集目录"),
    MAGAZINE_CATALOG(6, "杂志目录");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CatalogTypeEnum::getValue).toArray();

    /**
     * value
     */
    private final Integer value;
    /**
     * name
     */
    private final String name;

    public static CatalogTypeEnum valueOf(Integer value) {
        return ArrayUtil.firstMatch(catalogTypeEnum -> catalogTypeEnum.getValue().equals(value), CatalogTypeEnum.values());
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }
}
