package com.jeesharp.business.modules.setting.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 开屏媒体类型，与 {@code cfg_app_splash.media_type} 存库值一致。
 *
 * @author jeesharp
 * @since 2026-04-21
 */
@Getter
@AllArgsConstructor
public enum SplashMediaTypeEnum {

    /**
     * 图片
     */
    IMAGE(1, "图片"),

    /**
     * 视频
     */
    VIDEO(2, "视频");

    private final Integer value;
    private final String desc;

    public static SplashMediaTypeEnum fromValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (SplashMediaTypeEnum e : values()) {
            if (e.getValue().equals(value)) {
                return e;
            }
        }
        return null;
    }
}
