package com.ningdatech.kqapi.common.util;

import cn.hutool.core.text.StrPool;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.stream.Collectors;

/**
 * @Classname CodeUtil
 * @Description
 * @Date 2023/6/20 16:06
 * @Author PoffyZhang
 */
@Slf4j
public class CodeUtil {

    public static Collection<String> convertStrToList(String str) {
        if(StringUtils.isBlank(str)){
            return Collections.emptyList();
        }
        return Arrays.stream(str.split(StrPool.COMMA)).collect(Collectors.toList());
    }
}
