package com.gkhy.exam.coalmine.utils;
|
|
import com.ruoyi.file.entity.AttachmentInfo;
|
|
import java.util.List;
|
import java.util.regex.Pattern;
|
import java.util.stream.Collectors;
|
|
/**
|
* @author Mr.huang
|
* @decription
|
* @date 2023/9/14 9:59
|
*/
|
public class AttachmentUtil {
|
|
public static List<Long> stringConvertIds(String str){
|
List<Long> list = Pattern.compile(",\\s*")
|
.splitAsStream(str)
|
.map(Long::parseLong)
|
.collect(Collectors.toList());
|
return list;
|
}
|
|
public static String idConvertString(List<AttachmentInfo> attachmentInfos){
|
String attachmentIds = attachmentInfos.stream().map(AttachmentInfo::getId).map(Object::toString)
|
.collect(Collectors.joining(","));
|
return attachmentIds;
|
}
|
}
|