From 05a54025b1ae843f9d21a4450ec05c9e420e7f24 Mon Sep 17 00:00:00 2001
From: zf <1603559716@qq.com>
Date: 星期四, 28 九月 2023 10:47:37 +0800
Subject: [PATCH] bug修改

---
 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