package com.cool.store.vo.role;

import com.cool.store.entity.SysRoleDO;
import com.google.common.collect.Lists;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangchenbiao
 * @FileName: RolePageVO
 * @Description:
 * @date 2023-07-25 15:10
 */
@Data
public class RolePageVO {

    private String roleId;

    private String roleName;

    public static List<RolePageVO> convertList(List<SysRoleDO> roleList){
        if(CollectionUtils.isEmpty(roleList)){
            return Lists.newArrayList();
        }
        List<RolePageVO> resultList = new ArrayList<>();
        for (SysRoleDO sysRole : roleList) {
            RolePageVO role = new RolePageVO();
            role.setRoleId(sysRole.getRoleId());
            role.setRoleName(sysRole.getRoleName());
            resultList.add(role);
        }
        return resultList;
    }

}
