4 Commits 2e6b1eca6b ... 1bb3b4ba49

Autore SHA1 Messaggio Data
  yqc 1bb3b4ba49 Merge remote-tracking branch 'origin/master' 3 mesi fa
  yqc 8eff7053f9 博物馆照片库更新 3 mesi fa
  yqc 8bc798de72 博物馆照片库更新 3 mesi fa
  yqc 21b44b17c9 博物馆照片库更新 3 mesi fa

+ 43 - 1
yudao-module-museum/yudao-module-museum-biz/src/main/java/cn/iocoder/yudao/module/museum/service/museumpicture/MuseumPictureServiceImpl.java

@@ -9,8 +9,9 @@ import cn.iocoder.yudao.module.museum.dal.mysql.museumpicture.MuseumPictureMappe
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.Collections;
+import java.io.File;
 import java.util.List;
+import java.io.IOException;
 
 @Service
 public  class MuseumPictureServiceImpl implements MuseumPictureService {
@@ -65,3 +66,44 @@ public  class MuseumPictureServiceImpl implements MuseumPictureService {
 //    }
 }
 
+//    public void unzipAndAddToGroup(String groupId, String zipFilePath) throws IOException {
+//    String photoGroupDir = "photos/" + groupId;
+//    File groupDir = new File(photoGroupDir);
+//    if (!groupDir.exists()) {
+//        groupDir.mkdirs();
+//    }
+//
+//    unzip(zipFilePath, photoGroupDir);
+//}
+//
+//private void unzip(String zipFilePath, String destDir) throws IOException {
+//    byte[] buffer = new byte[1024];
+//    try (
+//            FileInputStream fis = new FileInputStream(zipFilePath);
+//            ZipInputStream zis = new ZipInputStream(fis)
+//    ) {
+//        ZipEntry zipEntry = zis.getNextEntry();
+//        while (zipEntry != null) {
+//            String filePath = destDir + File.separator + zipEntry.getName();
+//            if (!zipEntry.isDirectory()) {
+//                extractFile(zis, buffer, filePath);
+//            } else {
+//                File dir = new File(filePath);
+//                dir.mkdir();
+//            }
+//            zis.closeEntry();
+//            zipEntry = zis.getNextEntry();
+//        }
+//        zis.closeEntry();
+//    }
+//}
+//
+//private void extractFile(ZipInputStream zis, byte[] buffer, String filePath) throws IOException {
+//    try (FileOutputStream fos = new FileOutputStream(filePath)) {
+//        int len;
+//        while ((len = zis.read(buffer)) > 0) {
+//            fos.write(buffer, 0, len);
+//        }
+//    }
+//}
+//}