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

import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;

/**
 * 养殖资讯查询入参校验。
 */
public final class FarmingNewsValidation
{
    public static final String MSG_TYPE_REQUIRED = "资讯类型不能为空";

    private FarmingNewsValidation()
    {
    }

    public static void validateType(String type)
    {
        if (StringUtils.isEmpty(type))
        {
            throw new ServiceException(MSG_TYPE_REQUIRED);
        }
    }

    public static void validateId(Long id)
    {
        if (id == null)
        {
            throw new ServiceException(FarmingNewsRules.MSG_ID_REQUIRED);
        }
    }
}
