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

import java.util.ArrayList;
import java.util.List;
import com.ruoyi.web.modules.category.domain.BizInformationCategory;
import com.ruoyi.web.modules.category.domain.vo.InformationCategoryItemVo;

/**
 * 资讯类别展示对象转换。
 */
public final class InformationCategoryConvert
{
    private InformationCategoryConvert()
    {
    }

    public static List<InformationCategoryItemVo> toItemList(List<BizInformationCategory> rows)
    {
        List<InformationCategoryItemVo> list = new ArrayList<>();
        if (rows == null)
        {
            return list;
        }
        for (BizInformationCategory row : rows)
        {
            if (row == null)
            {
                continue;
            }
            list.add(new InformationCategoryItemVo(row.getCategoryCode(), row.getCategoryName()));
        }
        return list;
    }
}
