package com.ruoyi.web.modules.screen.support;

import com.ruoyi.common.exception.ServiceException;

/**
 * 大屏首页养殖标准 Tab 分类。
 */
public enum HomeScreenStandardCategory
{
    BREEDING_MGMT,
    FEEDING,
    EQUIPMENT,
    TREATMENT,
    GROWTH;

    public static HomeScreenStandardCategory parse(String value)
    {
        if (value == null || value.trim().isEmpty())
        {
            throw new ServiceException("标准分类不能为空");
        }
        try
        {
            return HomeScreenStandardCategory.valueOf(value.trim().toUpperCase());
        }
        catch (IllegalArgumentException ex)
        {
            throw new ServiceException("标准分类无效：" + value);
        }
    }
}
