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

import com.ruoyi.common.utils.StringUtils;

/**
 * 健康源数据地区键构建（按牧场维度集中判断）。
 */
public final class HealthRecordRegionSupport
{
    private HealthRecordRegionSupport()
    {
    }

    public static String buildRegionKey(Long farmId, String farmName)
    {
        if (farmId != null)
        {
            return "F:" + farmId;
        }
        return trimOrEmpty(farmName);
    }

    private static String trimOrEmpty(String value)
    {
        return StringUtils.isEmpty(value) ? "" : value.trim();
    }
}
