From 28231163c688c379a688ce6878a1126ee218aa52 Mon Sep 17 00:00:00 2001 From: huangzhen <867217663@qq.com> Date: 星期二, 26 九月 2023 16:53:48 +0800 Subject: [PATCH] 煤矿功能 --- exam-system/src/main/java/com/gkhy/exam/coalmine/utils/AttachmentUtil.java | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/exam-system/src/main/java/com/gkhy/exam/coalmine/utils/AttachmentUtil.java b/exam-system/src/main/java/com/gkhy/exam/coalmine/utils/AttachmentUtil.java new file mode 100644 index 0000000..faa4366 --- /dev/null +++ b/exam-system/src/main/java/com/gkhy/exam/coalmine/utils/AttachmentUtil.java @@ -0,0 +1,29 @@ +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; + } +} \ No newline at end of file -- Gitblit v1.9.2