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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 内容类型：文本或图片等媒体。
 *
 * @author jeesharp
 * @since 2026-06-27
 */
@Getter
@AllArgsConstructor
public enum ContentTypeEnum {

    TEXT("TEXT", "文本"),
    IMAGE("IMAGE", "图片");

    private final String code;
    private final String desc;

    public static ContentTypeEnum fromCode(String code) {
        if (code == null) {
            return null;
        }
        for (ContentTypeEnum e : values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
