1
0

4 Commits 0762127770 ... 45ba9c87db

Autor SHA1 Nachricht Datum
  seamew 45ba9c87db 孙浩博,fixed:算法管理编辑算法模块 vor 11 Monaten
  seamew a1c0c9732b 孙浩博,fixed:传统算法训练训练 vor 11 Monaten
  seamew 39ddf357fd 孙浩博,fixed:文件夹数据集上传功能 vor 1 Jahr
  seamew 0a4d329da8 孙浩博,fixed:单文件数据集上传功能 vor 1 Jahr
21 geänderte Dateien mit 596 neuen und 384 gelöschten Zeilen
  1. 5 0
      pom.xml
  2. 1 0
      src/main/java/io/renren/RenrenApplication.java
  3. 18 9
      src/main/java/io/renren/common/utils/DockerClientUtils.java
  4. 38 18
      src/main/java/io/renren/common/utils/FTPUtils.java
  5. 132 6
      src/main/java/io/renren/common/utils/MinIoUtils.java
  6. 33 0
      src/main/java/io/renren/modules/dataSet/enumeration/DataSetType.java
  7. 3 0
      src/main/java/io/renren/modules/dataSet/service/impl/DynamicSystemServiceImpl.java
  8. 40 3
      src/main/java/io/renren/modules/dataSet/upload/UpLoadController.java
  9. 5 6
      src/main/java/io/renren/modules/oss/controller/SysOssController.java
  10. 2 5
      src/main/java/io/renren/modules/sys/controller/VisiAlgorithmnodeController.java
  11. 4 2
      src/main/java/io/renren/modules/sys/controller/VisiWorkflowController.java
  12. 38 18
      src/main/java/io/renren/modules/sys/controller/algs/algTrainController.java
  13. 88 32
      src/main/java/io/renren/modules/sys/controller/algs/algsController.java
  14. 0 8
      src/main/java/io/renren/modules/sys/controller/dataaccess/getTemplateController.java
  15. 44 18
      src/main/java/io/renren/modules/sys/controller/dataset/DataSetController.java
  16. 9 0
      src/main/java/io/renren/modules/sys/controller/dataset/DataSetDyController.java
  17. 70 197
      src/main/java/io/renren/modules/sys/controller/minIo/MinioController.java
  18. 2 0
      src/main/java/io/renren/modules/sys/entity/VisiWorkflowEntity.java
  19. 23 15
      src/main/resources/application-dev.yml
  20. 38 43
      src/main/resources/application.yml
  21. 3 4
      src/test/java/io/renren/JwtTest.java

+ 5 - 0
pom.xml

@@ -291,6 +291,11 @@
 			<artifactId>pinyin4j</artifactId>
 			<version>2.5.0</version>
 		</dependency>
+		<dependency>
+			<groupId>org.dom4j</groupId>
+			<artifactId>dom4j</artifactId>
+			<version>2.1.4</version>
+		</dependency>
 		<!--<dependency>-->
 			<!--<groupId>jdk.tools</groupId>-->
 			<!--<artifactId>jdk.tools</artifactId>-->

+ 1 - 0
src/main/java/io/renren/RenrenApplication.java

@@ -8,6 +8,7 @@
 
 package io.renren;
 
+import lgh.springboot.starter.hbase.template.HBaseTemplate;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.ConfigurableApplicationContext;

+ 18 - 9
src/main/java/io/renren/common/utils/DockerClientUtils.java

@@ -7,6 +7,7 @@ import com.spotify.docker.client.LogStream;
 import com.spotify.docker.client.exceptions.DockerCertificateException;
 import com.spotify.docker.client.exceptions.DockerException;
 import com.spotify.docker.client.messages.*;
+import org.apache.commons.lang3.StringUtils;
 
 import java.net.URI;
 import java.nio.file.Paths;
@@ -143,7 +144,7 @@ public class DockerClientUtils {
     public static String execPython(String containerId,String filePath,String fileName) throws DockerException, InterruptedException {
 
         //创建要执行的命令
-        String[] execPython1={"nohup","python","-u","/opt/"+filePath+"/"+fileName,">output.log","2>&1","&"};
+        String[] execPython1={"nohup","python","-u","/opt/"+filePath+"/"+getOriginFileName(fileName),">output.log","2>&1","&"};
         ExecCreation execCreation=docker.execCreate(containerId,execPython1,DockerClient.ExecCreateParam.attachStdout(),
                 DockerClient.ExecCreateParam.attachStderr(), DockerClient.ExecCreateParam.attachStdin(),
                 DockerClient.ExecCreateParam.tty(), DockerClient.ExecCreateParam.detach());
@@ -164,6 +165,11 @@ public class DockerClientUtils {
         return execPythonOutput;
     }
 
+    private static String getOriginFileName(String fileName) {
+        String[] names = fileName.split("/");
+        return names[names.length - 1];
+    }
+
     /**
      * Description 在docker容器中执行运行python文件的命令,并附带参数
      * @param containerId 容器id
@@ -225,9 +231,11 @@ public class DockerClientUtils {
      * @param toFile 复制到的路径
      */
     public static void copyFile(String containerId,String formFile,String toFile) throws DockerException, InterruptedException {
-        String execCp=docker.execCreate(containerId,new String[]{"cp","-r",formFile,toFile}).id();
-        try (LogStream stream=docker.execStart(execCp)){
-            stream.readFully();
+        if (docker.inspectContainer(containerId).state().running()) {
+            String execCp=docker.execCreate(containerId,new String[]{"cp","-r",formFile,toFile}).id();
+            try (LogStream stream=docker.execStart(execCp)){
+                stream.readFully();
+            }
         }
     }
 
@@ -258,11 +266,12 @@ public class DockerClientUtils {
      * @throws InterruptedException
      */
     public static void deleteContainer(String containerId) throws DockerException, InterruptedException {
-
-        //首先要停止容器
-        docker.stopContainer(containerId,0);
-        //然后删除容器
-        docker.removeContainer(containerId);
+        if (StringUtils.isNotEmpty(containerId)) {
+            //首先要停止容器
+            docker.stopContainer(containerId, 0);
+            //然后删除容器
+            docker.removeContainer(containerId);
+        }
     }
 
 

+ 38 - 18
src/main/java/io/renren/common/utils/FTPUtils.java

@@ -41,17 +41,17 @@ public class FTPUtils {
         initFTPUtil();
     }
 
-    public void initFTPUtil(){
-        FTPClient ftp=new FTPClient();
+    public static void initFTPUtil() {
+        FTPClient ftp = new FTPClient();
         try {
-            JSch jsch=new JSch();
+            JSch jsch = new JSch();
             System.out.println("是否需要秘钥"+key_needed);
-            if(key_needed){
+            if (key_needed) {
                 jsch.addIdentity(key_location);
             }
-            //获取sshSession  账号-ip-端口
+            // 获取sshSession  账号-ip-端口
             Session sshSession=jsch.getSession(username,host,port);
-            //添加密码
+            // 添加密码
             sshSession.setPassword(password);
             Properties sshConfig=new Properties();
 
@@ -60,26 +60,35 @@ public class FTPUtils {
 
             sshSession.setConfig(sshConfig);
 
-            //开启sshSession连接
+            // 开启sshSession连接
             sshSession.connect();
-            //获取sftp通道
+            // 获取sftp通道
             channel=sshSession.openChannel("sftp");
             channel.connect();
 
-            sftp=(ChannelSftp) channel;
-
+            sftp = (ChannelSftp) channel;
             ftp.enterLocalPassiveMode();
         } catch (JSchException e) {
             e.printStackTrace();
         }
     }
 
+    /**
+     * 检查连接是否建立,如何没有则重新获取链接
+     */
+    private static void checkIsConnect() {
+        if (!sftp.isConnected()) {
+            initFTPUtil();
+        }
+    }
+
     /**
      * Description: 在服务器创建文件夹
      * @param filePath 要创建的文件夹名,创建位置在basePath下
      * @return 成功返回true,否则false
      */
-    public static boolean mkdir(String filePath){
+    public static boolean mkdir(String filePath) {
+        checkIsConnect();
         boolean result=false;
         try {
             sftp.cd("/");
@@ -100,13 +109,14 @@ public class FTPUtils {
      * @param input 输入流
      * @return 成功返回true,否则false
      */
-    public static boolean uploadFile(String filePath,String filename, InputStream input){
+    public static boolean uploadFile(String filePath,String filename, InputStream input) {
+        checkIsConnect();
         boolean result=false;
         try {
             sftp.cd("/");
             sftp.cd(basePath);
             sftp.cd(filePath);
-            sftp.put(input,filename);
+            sftp.put(input,getOriginFileName(filename));
             return true;
         } catch (SftpException e) {
             e.printStackTrace();
@@ -114,14 +124,21 @@ public class FTPUtils {
         return result;
     }
 
+    private static String getOriginFileName(String filename) {
+        checkIsConnect();
+        String[] names = filename.split("/");
+        return names[names.length - 1];
+    }
+
     /**
      * Description: 从FTP服务器下载文件
      * @param filePath FTP服务器文件存放路径。文件的路径为basePath+filePath
      * @return 成功返回true,否则false
      */
-    public static InputStream downloadFile(String filePath){
+    public static InputStream downloadFile(String filePath) {
+        checkIsConnect();
         try {
-            InputStream inputStream=sftp.get(filePath);
+            InputStream inputStream = sftp.get(filePath);
             return inputStream;
         } catch (SftpException e) {
             e.printStackTrace();
@@ -134,7 +151,8 @@ public class FTPUtils {
      * @param filePath
      * @return
      */
-    public static boolean isDirExist(String filePath){
+    public static boolean isDirExist(String filePath) {
+        checkIsConnect();
         boolean isDirExistFlag=false;
         try {
             SftpATTRS sftpATTRS=sftp.lstat(basePath+"/"+filePath);
@@ -153,7 +171,8 @@ public class FTPUtils {
      * @param filePath 要删除的文件夹
      * @return 成功返回true,否则false
      */
-    public static boolean removeDir(String filePath){
+    public static boolean removeDir(String filePath) {
+        checkIsConnect();
         boolean result=false;
         FTPClient ftp=new FTPClient();
         try {
@@ -198,7 +217,8 @@ public class FTPUtils {
      * @param filePath
      * @return
      */
-    public static Vector<ChannelSftp.LsEntry> showFiles(String filePath){
+    public static Vector<ChannelSftp.LsEntry> showFiles(String filePath) {
+        checkIsConnect();
         Vector vector=new Vector();
         try {
             vector=sftp.ls(basePath+"/"+filePath);

+ 132 - 6
src/main/java/io/renren/common/utils/MinIoUtils.java

@@ -8,18 +8,20 @@ import io.minio.http.Method;
 import io.minio.messages.Item;
 import io.renren.modules.sys.entity.algs.FileTest;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
 import java.text.DecimalFormat;
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
 
 /**
  * @Author: Ivan Q
@@ -88,6 +90,57 @@ public class MinIoUtils {
         return objectUrl;
     }
 
+    public static String getFileContent(String bucket,String fileName) {
+        try {
+            InputStream inputStream = minioClient.getObject(bucket, fileName);
+            StringWriter writer = new StringWriter();
+            IOUtils.copy(inputStream, writer, StandardCharsets.UTF_8);
+            return writer.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * Description 下载目标文件夹并打包成ZIP文件
+     *
+     * @param bucket 文件所在桶名称
+     * @param folderName 文件夹名
+     * @return ZIP文件的URL
+     */
+    public static byte[] downloadAndZipFolder(String bucket, String folderName) {
+        // 创建一个内存中的ZIP输出流
+        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream);
+        try {
+            Iterable<Result<Item>> minioObjects = minioClient.listObjects(bucket, folderName);
+            for (Result<Item> result : minioObjects) {
+                Item item = result.get();
+                String fileName = item.objectName();
+                // 创建ZIP条目
+                ZipEntry zipEntry = new ZipEntry(fileName);
+                zipOutputStream.putNextEntry(zipEntry);
+                // 下载文件内容到ZIP输出流
+                InputStream inputStream = minioClient.getObject(bucket, fileName);
+                byte[] buffer = new byte[1024 * 10];
+                BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream, 1024 * 10);
+                int bytesRead;
+                while ((bytesRead = bufferedInputStream.read(buffer)) != -1) {
+                    zipOutputStream.write(buffer, 0, bytesRead);
+                }
+                bufferedInputStream.close();
+                zipOutputStream.closeEntry();
+            }
+            // 关闭ZIP输出流
+            zipOutputStream.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return outputStream.toByteArray();
+    }
+
     /**
      * Description:获取指定文件的InputStream
      * @param bucketName
@@ -158,7 +211,8 @@ public class MinIoUtils {
         for(Result<Item> result:minioObjects){
             Item item=result.get();
             FileTest fileTest=new FileTest();
-            fileTest.setFilename(item.objectName().substring(prefix.length()+1));
+            // fileTest.setFilename(item.objectName().substring(prefix.length()+1));
+            fileTest.setFilename(item.objectName());
             //设置大小显示
             DecimalFormat df=new DecimalFormat("#.00");
             if (item.size()>=1024*1024*1024){
@@ -181,6 +235,41 @@ public class MinIoUtils {
         return fileList;
     }
 
+    /**
+     * Description 根据桶名和前缀(即文件夹名)查询文件夹
+     * @param bucketName 桶名称
+     * @param prefix 前缀(文件夹名)
+     * @return List<FileTest> 文件夹列表
+     */
+    public static List<FileTest> listFolders(String bucketName, String prefix) throws XmlParserException, NoSuchAlgorithmException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, InvalidBucketNameException, ErrorResponseException, IOException {
+        Iterable<Result<Item>> minioObjects = minioClient.listObjects(bucketName, prefix, false);
+        Set<FileTest> fileSet = new HashSet<>();
+        for (Result<Item> result : minioObjects) {
+            Item item = result.get();
+            String folder = getFolderFromObjectName(item.objectName(), prefix);
+            if (StringUtils.isNotEmpty(folder)) {
+                FileTest fileTest=new FileTest();
+                fileTest.setFilename(prefix);
+                fileSet.add(fileTest);
+            }
+        }
+        return new ArrayList<>(fileSet);
+    }
+
+    /**
+     * 从对象名称中提取文件夹名
+     * @param objectName 对象名称
+     * @param prefix 前缀(文件夹名)
+     * @return 文件夹名
+     */
+    private static String getFolderFromObjectName(String objectName, String prefix) {
+        int index = objectName.indexOf('/', prefix.length()); // 搜索第一个目录分隔符
+        if (index > 0) {
+            return objectName.substring(0, prefix.length());
+        }
+        return "";
+    }
+
     /**
      * Description 复制文件
      * @param bucketName 存放复制文件的存储桶
@@ -192,6 +281,30 @@ public class MinIoUtils {
         minioClient.copyObject(bucketName,objectName,null,null,srcBucketName,srcObjectName,null,null);
     }
 
+
+    /**
+     * Description 复制文件夹
+     *
+     * @param bucketName 存放复制文件夹的存储桶
+     * @param folderName 复制文件夹名称
+     * @param srcBucketName 源文件夹所在桶
+     * @param srcFolderName 源文件夹名称
+     */
+    public static void copyFolder(String bucketName,String folderName,String srcBucketName,String srcFolderName) throws IOException, InvalidKeyException, InvalidResponseException, InsufficientDataException, NoSuchAlgorithmException, InternalException, XmlParserException, InvalidBucketNameException, ErrorResponseException {
+        if (StringUtils.isEmpty(folderName)) {
+            folderName = "";
+        }
+        Iterable<Result<Item>> results = minioClient.listObjects(srcBucketName, srcFolderName, false);
+        for (Result<Item> result : results) {
+            Item item = result.get();
+            if (item.isDir()) {
+                copyFolder(bucketName, folderName, srcBucketName, item.objectName());
+            } else {
+                copyFile(bucketName, folderName + item.objectName(), srcBucketName, item.objectName());
+            }
+        }
+    }
+
     /**
      * Description 删除指定文件
      * @param bucketName
@@ -202,6 +315,19 @@ public class MinIoUtils {
 
     }
 
+    /**
+     * Description 删除一个文件夹(包括其中的所有文件)
+     * @param bucketName 存储桶名称
+     * @param dirName 文件夹路径名/文件夹名
+     */
+    public static void deleteDir(String bucketName, String dirName) throws InvalidBucketNameException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, IOException, XmlParserException, ErrorResponseException, InternalException {
+        Iterable<Result<Item>> myObjects = minioClient.listObjects(bucketName, dirName, true);
+        for (Result<Item> result : myObjects) {
+            Item item = result.get();
+            minioClient.removeObject(bucketName, item.objectName());
+        }
+    }
+
     /**
      * Description 批量删除指定前缀的文件
      * @param bucketName

+ 33 - 0
src/main/java/io/renren/modules/dataSet/enumeration/DataSetType.java

@@ -0,0 +1,33 @@
+package io.renren.modules.dataSet.enumeration;
+
+/**
+ * @Author: seamew
+ * @Title: DataSetType
+ * @CreateTime: 2023年09月19日 22:38:00
+ * @Description: 数据集枚举类
+ * @Version: 1.0
+ */
+public enum DataSetType {
+    STATIC_DATASET("dataset", ""),
+    DYNAMIC_DATASET("dydataset", ""),
+    FILE_DATASET("dataset", "单文件"),
+    DIR_DATASET("dataset", "文件夹"),
+    ALG_DATASET("algorithm", "");
+
+    private final String bucketName;
+
+    private final String classificationName;
+
+    DataSetType(String bucketName, String classificationName) {
+        this.bucketName = bucketName;
+        this.classificationName = classificationName;
+    }
+
+    public String getBucketName() {
+        return bucketName;
+    }
+
+    public String getClassificationName() {
+        return classificationName;
+    }
+}

+ 3 - 0
src/main/java/io/renren/modules/dataSet/service/impl/DynamicSystemServiceImpl.java

@@ -21,6 +21,8 @@ import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.*;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Conditional;
 import org.springframework.stereotype.Service;
 
 import java.io.*;
@@ -31,6 +33,7 @@ import java.util.*;
 @Service
 public class DynamicSystemServiceImpl implements DynamicSystemService {
 
+
     @Autowired
     HBaseTemplate hBaseTemplate;
 

+ 40 - 3
src/main/java/io/renren/modules/dataSet/upload/UpLoadController.java

@@ -2,8 +2,14 @@ package io.renren.modules.dataSet.upload;
 
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.fastjson.JSON;
+import com.google.gson.Gson;
 import io.renren.common.exception.RRException;
+import io.renren.common.utils.MinIoUtils;
 import io.renren.common.utils.R;
+import io.renren.modules.dataSet.enumeration.DataSetType;
+import io.renren.modules.sys.entity.dataset.DataSet;
+import io.renren.modules.sys.service.CategoryService;
+import io.renren.modules.sys.service.DataSetService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
@@ -38,6 +44,13 @@ public class UpLoadController {
      */
     @Autowired
     private UpLoadService upLoadService;
+
+    @Autowired
+    private DataSetService dataSetService;
+
+    @Autowired
+    private CategoryService categoryService;
+
     @PostMapping("upload")
     @ResponseBody
     public R uploadExcel(MultipartFile file) throws IOException {
@@ -50,20 +63,44 @@ public class UpLoadController {
 
     }
 
+    @RequestMapping("uploadFile")
+    public R uploadFile(@RequestPart("file") MultipartFile file, @RequestParam("dataSet") String dataSetJson) throws Exception {
+        MinIoUtils.uploadMultipartFile(file, DataSetType.FILE_DATASET.getBucketName(), file.getOriginalFilename());
+        DataSet dataSet = new Gson().fromJson(dataSetJson, DataSet.class);
+        dataSet.setCreateTime(new Date());
+        dataSet.setCategoryId(categoryService.getByName(DataSetType.FILE_DATASET.getClassificationName()));
+        dataSetService.save(dataSet);
+        return R.ok();
+    }
+
+    @PostMapping("/uploadDir")
+    public R uploadDir(@RequestPart("files") MultipartFile[] files, @RequestParam("dataSet") String dataSetJson) throws Exception {
+        DataSet dataSet = new Gson().fromJson(dataSetJson, DataSet.class);
+        dataSet.setCreateTime(new Date());
+        dataSet.setCategoryId(categoryService.getByName(DataSetType.DIR_DATASET.getClassificationName()));
+        for (MultipartFile file : files) {
+            MinIoUtils.uploadMultipartFile(file, DataSetType.DIR_DATASET.getBucketName(), file.getOriginalFilename());
+        }
+        dataSetService.save(dataSet);
+        return R.ok();
+    }
+
+
     @RequestMapping("uploadcsv")
     public R uploadCSV(MultipartFile file) throws Exception {
         System.out.println(file);
         Map map = upLoadService.uploadCSV(file);
 //        System.out.println(map);
-        return R.ok().put("data",map);
+        return R.ok().put("data", map);
     }
+
     @RequestMapping("getstapre")
-    public R getstaticprecontent(@RequestBody Map map){
+    public R getstaticprecontent(@RequestBody Map map) {
 
         final List getstaticprecontent = upLoadService.getstaticprecontent(map);
 //        System.out.println(datas);
 
 //        subeqpdemoService.getPrecontent(subeqpments);
-        return R.ok().put("data",getstaticprecontent);
+        return R.ok().put("data", getstaticprecontent);
     }
 }

+ 5 - 6
src/main/java/io/renren/modules/oss/controller/SysOssController.java

@@ -22,7 +22,6 @@ import io.renren.common.validator.group.AliyunGroup;
 import io.renren.common.validator.group.QcloudGroup;
 import io.renren.common.validator.group.QiniuGroup;
 import io.renren.modules.oss.cloud.CloudStorageConfig;
-import io.renren.modules.oss.cloud.OSSFactory;
 import io.renren.modules.oss.entity.SysOssEntity;
 import io.renren.modules.oss.service.SysOssService;
 import io.renren.modules.sys.service.SysConfigService;
@@ -55,7 +54,7 @@ public class SysOssController {
 	String secret_key;
 
 	@Value("${minio.bucket}")
-	String buctek;
+	String bucket;
 
 	@Autowired
 	private SysOssService sysOssService;
@@ -132,21 +131,21 @@ public class SysOssController {
 		// 使用MinIO服务的URL,端口,Access key和Secret key创建一个MinioClient对象
 		MinioClient minioClient = new MinioClient(endpoint, access_key, secret_key);
 		// 检查存储桶是否已经存在
-		boolean isExist = minioClient.bucketExists(buctek);
+		boolean isExist = minioClient.bucketExists(bucket);
 		if(isExist) {
 			System.out.println("Bucket already exists.");
 		}else {
-			minioClient.makeBucket(buctek);
+			minioClient.makeBucket(bucket);
 		}
 		// 使用putObject上传一个文件到存储桶中。
 		String a = file.getOriginalFilename() ;//.split("\\.")[1];
 		PutObjectOptions putObjectOptions = new PutObjectOptions(file.getSize(), PutObjectOptions.MIN_MULTIPART_SIZE);
 		putObjectOptions.setContentType(file.getContentType());
 		String objectName = UUID.randomUUID().toString()+"$"+a;
-		minioClient.putObject(buctek, "1/"+objectName,file.getInputStream(),putObjectOptions);
+		minioClient.putObject(bucket, "1/"+objectName,file.getInputStream(),putObjectOptions);
 		System.out.println("-----------------");
 
-		String url = minioClient.getPresignedObjectUrl(Method.GET, buctek, "1/"+objectName, 1000, null);
+		String url = minioClient.getPresignedObjectUrl(Method.GET, bucket, "1/"+objectName, 1000, null);
 
 		//保存文件信息
 		SysOssEntity ossEntity = new SysOssEntity();

+ 2 - 5
src/main/java/io/renren/modules/sys/controller/VisiAlgorithmnodeController.java

@@ -34,15 +34,12 @@ public class VisiAlgorithmnodeController {
 
     /**
      * 列表
-     * @param params 页面配置信息
      * @return 结果
      */
     @RequestMapping("/list")
 //    @RequiresPermissions("sys:visialgorithmnode:list")
-    public R list(@RequestParam Map<String, Object> params){
-        PageUtils page = visiAlgorithmnodeService.queryPage(params);
-
-        return R.ok().put("page", page);
+    public R list(){
+        return R.ok().put("list", visiAlgorithmnodeService.list());
     }
 
 

+ 4 - 2
src/main/java/io/renren/modules/sys/controller/VisiWorkflowController.java

@@ -90,7 +90,7 @@ public class VisiWorkflowController extends AbstractController {
     @RequestMapping("/save")
 //    @RequiresPermissions("sys:visiworkflow:save")
     public R save(@RequestBody VisiWorkflowEntity visiWorkflow) {
-        visiWorkflowService.save(visiWorkflow);
+        visiWorkflowService.saveOrUpdate(visiWorkflow);
 
         return R.ok();
     }
@@ -235,7 +235,7 @@ public class VisiWorkflowController extends AbstractController {
     public R Submit(@RequestBody Map<String, Object> params) {
         System.out.println(params.toString());
         System.out.println(params.get("addorupdate"));
-        Boolean addorupdate = (Boolean) params.get("addorupdate");
+        Boolean addorupdate = Boolean.valueOf(params.get("addorupdate").toString());
         System.out.println("//true表示update,新增  false表示add "+ addorupdate);
         Long  workflowId = null;
         if(addorupdate){
@@ -569,6 +569,8 @@ public class VisiWorkflowController extends AbstractController {
                 containertemp.setCommand(command);   //List<String> command
                 containertemp.args(args);  //List<String> args
                 containertemp.setEnv(envlist);   //20211208
+                // 设置代码拉取规则
+                containertemp.setImagePullPolicy("IfNotPresent");
 
                 template.setContainer(containertemp);
                 //添加至workflowTemplate的List<Template> templateslist中

+ 38 - 18
src/main/java/io/renren/modules/sys/controller/algs/algTrainController.java

@@ -18,6 +18,7 @@ import io.renren.modules.sys.service.impl.AlgTrainServiceImpl;
 import io.renren.modules.sys.service.impl.AlgsModelsServiceImpl;
 import io.renren.modules.sys.service.impl.AlgsServiceImpl;
 import io.swagger.models.auth.In;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -25,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 
+import javax.validation.constraints.Min;
 import java.io.*;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
@@ -116,10 +118,15 @@ public class algTrainController {
         algTrain.setUid(Long.parseLong(map.get("uid")));
         algTrain.setAlgorithmId(Long.parseLong(map.get("algorithmId")));
         ValidatorUtils.validateEntity(algTrain, AddGroup.class);
-        List<AlgTrain> list = algTrainService.list();
-        for(AlgTrain train : list){
-            if(train.getMissName().equals(algTrain.getMissName())) return R.error("已经存在重复名称的任务");
+
+        if (algTrainService.selectByMissName(algTrain.getMissName()) != null) {
+            return R.error("已经存在重复名称的任务");
         }
+
+        // List<AlgTrain> list = algTrainService.list();
+        // for(AlgTrain train : list){
+        //     if(train.getMissName().equals(algTrain.getMissName())) return R.error("已经存在重复名称的任务");
+        // }
         Algorithm alg=algsService.getById(algTrain.getAlgorithmId());
         //如果是智能算法
         if(alg.getFrameId()!=-1){
@@ -159,7 +166,7 @@ public class algTrainController {
             List<FileTest> fileList=MinIoUtils.listFiles("algorithm","alg"+map.get("algorithmId"));
             for(FileTest file:fileList){
                 //从minio中获得目标文件的输入流
-                InputStream input= MinIoUtils.getFileInputStream("algorithm","alg"+map.get("algorithmId")+"/"+file.getFilename());
+                InputStream input= MinIoUtils.getFileInputStream("algorithm",file.getFilename());
                 //从minio中获取的文件上传至服务器
                 FTPUtils.uploadFile("algTrain"+algTrain.getAlgorithmTrainingId(),file.getFilename(),input);
             }
@@ -521,9 +528,11 @@ public class algTrainController {
         DockerClientUtils.deleteContainer(algTrain.getContainerId());//首先将该容器删除
         FTPUtils.removeDir("algTrain"+algorithmTrainingId);//其次将存储卷删除
         algTrainService.removeById(Long.parseLong(algorithmTrainingId));//数据库中删除
-        String port=algTrain.getIpAddress().substring(algTrain.getIpAddress().length()-5);
-        ServerPort serverPort=new ServerPort(Long.parseLong(port),0);
-        serverPortService.updateServerPort(serverPort);//将端口释放
+        if (StringUtils.isNotEmpty(algTrain.getIpAddress())) {
+            String port = algTrain.getIpAddress().substring(algTrain.getIpAddress().length() - 5);
+            ServerPort serverPort = new ServerPort(Long.parseLong(port), 0);
+            serverPortService.updateServerPort(serverPort);//将端口释放
+        }
         return R.ok();
     }
 
@@ -535,7 +544,8 @@ public class algTrainController {
     @GetMapping("/getAlgIdVersionId")
     public R getAlgIdVersionId(String algorithmTrainingId){
         AlgTrain algTrain=algTrainService.selectByPrimaryKey(Long.parseLong(algorithmTrainingId));
-        return R.ok().put("algorithmNameToVersion",algTrain.getAlgorithmId()).put("verisionToFile",algTrain.getVersionId());
+        CategoryEntity category = categoryService.getById(algTrain.getCategoryId());
+        return R.ok().put("algTrain", algTrain).put("category", category);
     }
 
     /**
@@ -574,17 +584,27 @@ public class algTrainController {
      */
     @GetMapping("/listFiles")
     public R listFiles(@RequestParam Map<String,Object> params) throws IOException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, InvalidResponseException, ErrorResponseException, XmlParserException, InvalidBucketNameException, InternalException {
-        String algorithmNameToVersion=String.valueOf(params.get("algorithmNameToVersion"));
-        String verisionToFile=String.valueOf(params.get("verisionToFile"));
-
-        List<FileTest> fileList= MinIoUtils.listFiles("algorithm","alg"+algorithmNameToVersion+"/version"+verisionToFile);
-        List<FileTest> pythonFiles=new ArrayList<>();
-        List<FileTest> datasetFiles=new ArrayList<>();
-        for(FileTest file:fileList){
-            String suffix=file.getFilename().substring(file.getFilename().lastIndexOf("."));
-            if(suffix.equals(".py")){
+        String algorithmNameToVersion = String.valueOf(params.get("algorithmNameToVersion"));
+        String verisionToFile = String.valueOf(params.get("verisionToFile"));
+        long algFrameId = Long.parseLong((String) params.get("algFrameId"));
+        List<FileTest> fileList;
+        if (algFrameId == -1) {
+            fileList = MinIoUtils.listFiles("algorithm", "alg" + algorithmNameToVersion);
+        } else {
+            fileList = MinIoUtils.listFiles("algorithm","alg"+algorithmNameToVersion+"/version"+verisionToFile);
+        }
+        List<FileTest> pythonFiles =new ArrayList<>();
+        List<FileTest> datasetFiles =new ArrayList<>();
+        for (FileTest file : fileList) {
+            String suffix = file.getFilename().substring(file.getFilename().lastIndexOf("."));
+            // if (suffix.equals(".py")){
+            //     pythonFiles.add(file);
+            // } else if (suffix.equals(".csv")) {
+            //     datasetFiles.add(file);
+            // }
+            if (suffix.equals(".py")){
                 pythonFiles.add(file);
-            }else if(suffix.equals(".csv")){
+            } else {
                 datasetFiles.add(file);
             }
         }

+ 88 - 32
src/main/java/io/renren/modules/sys/controller/algs/algsController.java

@@ -1,5 +1,8 @@
 package io.renren.modules.sys.controller.algs;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.google.gson.Gson;
 import io.minio.errors.*;
 import io.renren.common.annotation.SysLog;
 import io.renren.common.utils.Constant;
@@ -9,11 +12,15 @@ import io.renren.common.utils.R;
 import io.renren.common.validator.ValidatorUtils;
 import io.renren.common.validator.group.AddGroup;
 import io.renren.common.validator.group.UpdateGroup;
+import io.renren.modules.dataSet.enumeration.DataSetType;
 import io.renren.modules.sys.entity.algs.*;
 import io.renren.modules.sys.entity.dataset.DataSet;
+import io.renren.modules.sys.entity.dataset.DataSetDy;
 import io.renren.modules.sys.service.*;
 import io.renren.modules.sys.service.impl.AlgsModelsServiceImpl;
 import io.renren.modules.sys.service.impl.AlgsServiceImpl;
+import jdk.internal.org.objectweb.asm.TypeReference;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -23,6 +30,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
 import java.io.IOException;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -48,6 +56,8 @@ public class algsController{
     AlgorithmParameterService algorithmParameterService;
     @Autowired
     AlgorithmResultService algorithmResultService;
+    @Autowired
+    CategoryService categoryService;
     /**
      * 所有列表
      */
@@ -107,10 +117,13 @@ public class algsController{
         alg.setNumber(Long.parseLong(request.getParameter("number")));
 
         ValidatorUtils.validateEntity(alg, AddGroup.class);
-        List<Algorithm> list = algsService.list();
-        for(Algorithm algorithm : list){
-            if(algorithm.getAlgorithmName().equals(alg.getAlgorithmName())) return R.error("已经存在重复名称的算法");
+        if (algsService.selectByAlgName(alg.getAlgorithmName()) != null) {
+            return R.error("已经存在重复名称的算法");
         }
+        // List<Algorithm> list = algsService.list();
+        // for(Algorithm algorithm : list){
+        //     if(algorithm.getAlgorithmName().equals(alg.getAlgorithmName())) return R.error("已经存在重复名称的算法");
+        // }
 //        user.setCreateUserId(getUserId());
 
         algsService.save(alg);
@@ -126,12 +139,19 @@ public class algsController{
             String algTemplatesString=request.getParameter("algTemplates");//如果有选择模板,则将对应模板代码拷贝到相应位置
             saveIntelligentAlg(alg,dataSetsString,algModelsString,algTemplatesString,files);
         }else {
-            String dataSetsString= request.getParameter("dataSets");//如果有选择数据集,则将数据集从minio中拷贝到相应位置
+            List<DataSet> dataSets = new ArrayList<>();
+            List<DataSetDy> dataSetsDy = new ArrayList<>();
+            if (StringUtils.isNotEmpty(request.getParameter("dataSets"))) {
+                dataSets = JSON.parseArray(request.getParameter("dataSets"), DataSet.class);//如果有选择数据集,则将数据集从minio中拷贝到相应位置
+            }
+            if (StringUtils.isNotEmpty(request.getParameter("dataSetsDy"))) {
+                dataSetsDy = JSON.parseArray(request.getParameter("dataSetsDy"), DataSetDy.class);
+            }
             String algResultNameString=request.getParameter("algResultNames");
             String algResultLocationString=request.getParameter("algResultLocations");
             String algParameterNameString=request.getParameter("algParameterName");
             String algParameterTypeString=request.getParameter("algParameterTypes");
-            saveTraditionalAlg(alg,files,algParameterNameString,algParameterTypeString,algResultNameString,algResultLocationString,dataSetsString);
+            saveTraditionalAlg(alg,files,algParameterNameString,algParameterTypeString,algResultNameString,algResultLocationString,dataSets, dataSetsDy);
 
         }
         return R.ok();
@@ -192,57 +212,93 @@ public class algsController{
      * @param alg 算法对象实体
      * @param files 算法文件
      */
-    public void saveTraditionalAlg(Algorithm alg,List<MultipartFile> files,String algParameterNameString,String algParameterTypeString,String algResultNameString,String algResultLocationString,String dataSetsString) throws IOException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, InvalidResponseException, ErrorResponseException, XmlParserException, InvalidBucketNameException, InternalException {
-        Long algId=alg.getAlgorithmId();
+    public void saveTraditionalAlg(Algorithm alg,List<MultipartFile> files,String algParameterNameString,String algParameterTypeString,String algResultNameString,String algResultLocationString,List<DataSet> dataSets, List<DataSetDy> dataSetsDy) throws IOException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, InvalidResponseException, ErrorResponseException, XmlParserException, InvalidBucketNameException, InternalException {
+        Long algId = alg.getAlgorithmId();
 
-        System.out.println("算法参数名是");
-        String[] algorithmParameterNames=algParameterNameString.split(",");
-        for(String s:algorithmParameterNames){
-            System.out.println(s);
+        String[] algorithmParameterNames = new String[0];
+        if (StringUtils.isNotEmpty(algParameterNameString)) {
+            algorithmParameterNames=algParameterNameString.split(",");
         }
 
-        System.out.println("算法参数类别是");
-        String[] algorithmParameterTypes=algParameterTypeString.split(",");
-        for(String s:algorithmParameterTypes){
-            System.out.println(s);
+        // System.out.println("算法参数名是");
+        // String[] algorithmParameterNames=algParameterNameString.split(",");
+        // for(String s:algorithmParameterNames){
+        //     System.out.println(s);
+        // }
+
+        // System.out.println("算法参数类别是");
+        // String[] algorithmParameterTypes=algParameterTypeString.split(",");
+        // for(String s:algorithmParameterTypes){
+        //     System.out.println(s);
+        // }
+
+        String[] algorithmParameterTypes = new String[0];
+        if (StringUtils.isNotEmpty(algParameterTypeString)) {
+            algorithmParameterTypes = algParameterTypeString.split(",");
         }
-        for(int i=0;i<algorithmParameterNames.length;i++){
-            AlgorithmParameter algorithmParameter=new AlgorithmParameter();
+        for (int i = 0; i < algorithmParameterNames.length; i++) {
+            AlgorithmParameter algorithmParameter = new AlgorithmParameter();
             algorithmParameter.setAlgorithmId(algId);
             algorithmParameter.setAlgorithmParameterName(algorithmParameterNames[i]);
             algorithmParameter.setAlgorithmParameterType(algorithmParameterTypes[i]);
             algorithmParameterService.save(algorithmParameter);
         }
 
-        System.out.println("算法结果名是");
-        String[] algorithmResultNames=algResultNameString.split(",");
-        for(String s:algorithmResultNames){
-            System.out.println(s);
+        String[] algorithmResultNames = new String[0];
+        if (StringUtils.isNotEmpty(algResultNameString)) {
+            algorithmResultNames = algResultNameString.split(",");
         }
-        System.out.println("算法结果文件位置是");
-        String[] algorithmResultLocations=algResultLocationString.split(",");
-        for(String s:algorithmResultLocations){
-            System.out.println(s);
+        // System.out.println("算法结果名是");
+        // String[] algorithmResultNames=algResultNameString.split(",");
+        // for(String s:algorithmResultNames){
+        //     System.out.println(s);
+        // }
+
+        String[] algorithmResultLocations = new String[0];
+        if (StringUtils.isNotEmpty(algResultLocationString)) {
+            algorithmResultLocations = algResultLocationString.split(",");
         }
-        for(int i=0;i<algorithmResultNames.length;i++){
-            AlgorithmResult algorithmResult=new AlgorithmResult();
+        // System.out.println("算法结果文件位置是");
+        // String[] algorithmResultLocations=algResultLocationString.split(",");
+        // for(String s:algorithmResultLocations){
+        //     System.out.println(s);
+        // }
+        for(int i = 0; i < algorithmResultNames.length; i++){
+            AlgorithmResult algorithmResult = new AlgorithmResult();
             algorithmResult.setAlgorithmId(algId);
             algorithmResult.setAlgorithmResultName(algorithmResultNames[i]);
             algorithmResult.setAlgorithmResultLocation(algorithmResultLocations[i]);
             algorithmResultService.save(algorithmResult);
         }
         //将算法文件上传
-        for(MultipartFile file:files){
+        for (MultipartFile file : files) {
             if(file.isEmpty())  break;
             MinIoUtils.uploadMultipartFile(file,"algorithm","alg"+algId+"/"+file.getOriginalFilename());
         }
         //将数据集上传
-        if(dataSetsString.length()!=0){
-            String[] dataSets=dataSetsString.split(",");
-            for(String fileName:dataSets){
-                MinIoUtils.copyFile("algorithm","alg"+algId+"/"+fileName,"dataset",fileName);
+        if (!dataSets.isEmpty()) {
+            for (DataSet dataSet : dataSets) {
+                CategoryEntity category = categoryService.getById(dataSet.getCategoryId());
+                if (DataSetType.DIR_DATASET.getClassificationName().equals(category.getCategoryName())) {
+                    MinIoUtils.copyFolder("algorithm", "alg"+algId+"/", DataSetType.STATIC_DATASET.getBucketName(), dataSet.getDatasetName() + "/");
+                } else {
+                    MinIoUtils.copyFile("algorithm","alg"+algId+"/"+dataSet.getDatasetName(), DataSetType.STATIC_DATASET.getBucketName(), dataSet.getDatasetName());
+                }
             }
         }
+
+        if (!dataSetsDy.isEmpty()) {
+            for (DataSetDy dataSetDy : dataSetsDy) {
+                MinIoUtils.copyFile("algorithm", "alg"+algId+"/"+dataSetDy.getDatasetName(), DataSetType.DYNAMIC_DATASET.getBucketName(), dataSetDy.getDatasetName());
+            }
+        }
+
+        // if (StringUtils.isNotEmpty(dataSetsString)){
+        //     String[] dataSets = dataSetsString.split(",");
+        //     for (String fileName : dataSets) {
+        //         MinIoUtils.copyFile("algorithm","alg"+algId+"/"+fileName, DataSetType.STATIC_DATASET.getBucketName(), fileName);
+        //     }
+        // }
     }
 
 

+ 0 - 8
src/main/java/io/renren/modules/sys/controller/dataaccess/getTemplateController.java

@@ -26,14 +26,6 @@ import java.util.Map;
 @RequestMapping("/getTemplate")
 @DataSource("bigData")
 public class getTemplateController {
-    @Value("${realTimeKafka1}")
-    String realTimeKafka1;
-
-    @Value("${realTimeKafka2}")
-    String realTimeKafka2;
-
-    @Value("${realTimeKafka3}")
-    String realTimeKafka3;
 
     @Value("${resultToDB}")
     String resultToDB;

+ 44 - 18
src/main/java/io/renren/modules/sys/controller/dataset/DataSetController.java

@@ -9,16 +9,20 @@ import io.renren.common.utils.R;
 import io.renren.common.validator.ValidatorUtils;
 import io.renren.common.validator.group.AddGroup;
 import io.renren.common.validator.group.UpdateGroup;
+import io.renren.modules.dataSet.enumeration.DataSetType;
 import io.renren.modules.sys.entity.algs.AlgorithmModel;
 import io.renren.modules.sys.entity.algs.FileTest;
 import io.renren.modules.sys.entity.dataset.DataSet;
+import io.renren.modules.sys.service.CategoryService;
 import io.renren.modules.sys.service.DataSetService;
 import io.renren.modules.sys.service.impl.AlgsModelsServiceImpl;
 import lombok.SneakyThrows;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
@@ -36,6 +40,9 @@ public class DataSetController {
 
     @Autowired
     DataSetService dataSetService;
+
+    @Autowired
+    private CategoryService categoryService;
     /**
      * 所有列表
      */
@@ -125,24 +132,30 @@ public class DataSetController {
 
         List<DataSet> dataSets = dataSetService.listByIds(Arrays.asList(datasetIds));
         dataSetService.deleteBatch(datasetIds);
-        System.out.println(dataSets);
-        for (DataSet dataset:dataSets
-             ) {
-            MinIoUtils.deleteFile("dataset",dataset.getDatasetName()+".csv");
+        Long singleFile = categoryService.getByName(DataSetType.FILE_DATASET.getClassificationName());
+        Long dir = categoryService.getByName(DataSetType.DIR_DATASET.getClassificationName());
+        for (DataSet dataset : dataSets) {
+            if (dataset.getCategoryId().equals(singleFile)) {
+                MinIoUtils.deleteFile(DataSetType.FILE_DATASET.getBucketName(), dataset.getDatasetName());
+            } else if (dataset.getCategoryId().equals(dir)) {
+                MinIoUtils.deleteDir(DataSetType.DIR_DATASET.getBucketName(), dataset.getDatasetName());
+            } else {
+                MinIoUtils.deleteFile(DataSetType.STATIC_DATASET.getBucketName(), dataset.getDatasetName()+".csv");
+            }
         }
         return R.ok();
     }
 
     @GetMapping("/listAll")
     public R listAll() throws Exception {
-        List<FileTest> list=MinIoUtils.listBucketFiles("dataset");
-
+        // List<FileTest> list=MinIoUtils.listBucketFiles(DataSetType.STATIC_DATASET.getBucketName());
+        List<DataSet> list = dataSetService.list();
         return R.ok().put("list",list);
     }
 
     @GetMapping("/listAllDyDataset")
     public R listAllDyDataset() throws Exception {
-        List<FileTest> list=MinIoUtils.listBucketFiles("dydataset");
+        List<FileTest> list=MinIoUtils.listBucketFiles(DataSetType.DYNAMIC_DATASET.getBucketName());
 
         return R.ok().put("list",list);
     }
@@ -153,19 +166,32 @@ public class DataSetController {
      * @return
      */
     @RequestMapping("/downloadDataset")
-    public R downloadStaticDataset(String datasetName){
-        //从minio获得数据集的url,直接返回给前端
-        List<FileTest> dataset = new ArrayList<>();
-        try {
-            dataset = MinIoUtils.listFiles("dataset", datasetName.split("\\.")[0]);
-
-        } catch (Exception e) {
-            e.printStackTrace();
+    public R downloadStaticDataset(@RequestParam String datasetName, @RequestParam(required = false) String categoryName, @RequestParam(required = false) String bucketName){
+        // 从minio获得数据集的url,直接返回给前端
+        // List<FileTest> dataset = new ArrayList<>();
+        // try {
+        //     if (DataSetType.FILE_DATASET.getClassificationName().equals(categoryName)) {
+        //         dataset = MinIoUtils.listFiles(DataSetType.STATIC_DATASET.getBucketName(), datasetName);
+        //     } else if (DataSetType.DIR_DATASET.getClassificationName().equals(categoryName)) {
+        //         dataset = MinIoUtils.listFolders(DataSetType.STATIC_DATASET.getBucketName(), datasetName);
+        //     } else {
+        //         dataset = MinIoUtils.listFiles(DataSetType.STATIC_DATASET.getBucketName(), datasetName.split("\\.")[0]);
+        //     }
+        // } catch (Exception e) {
+        //     return R.error(e.getMessage());
+        // }
+        // if (dataset.isEmpty()){
+        //     return R.error(404,"文件不存在");
+        // }
+        if (StringUtils.isNotEmpty(bucketName)) {
+            return R.ok().put("downloadUrl", MinIoUtils.getFileUrl(bucketName, datasetName));
         }
-        if (dataset.size() ==0){
-            return R.error(404,"文件不存在");
+
+        String downloadUrl;
+        if (DataSetType.DIR_DATASET.getClassificationName().equals(categoryName)) {
+            return R.ok().put("download", MinIoUtils.downloadAndZipFolder(DataSetType.STATIC_DATASET.getBucketName(), datasetName));
         }
-        String downloadUrl= MinIoUtils.getFileUrl("dataset",datasetName);
+        downloadUrl = MinIoUtils.getFileUrl(DataSetType.STATIC_DATASET.getBucketName(), datasetName);
         return R.ok().put("downloadUrl",downloadUrl);
     }
 

+ 9 - 0
src/main/java/io/renren/modules/sys/controller/dataset/DataSetDyController.java

@@ -6,6 +6,8 @@ import io.renren.common.utils.MinIoUtils;
 import io.renren.common.utils.PageUtils;
 import io.renren.common.utils.R;
 import io.renren.modules.sys.entity.algs.FileTest;
+import io.renren.modules.sys.entity.dataset.DataSet;
+import io.renren.modules.sys.entity.dataset.DataSetDy;
 import io.renren.modules.sys.service.DataSetDyService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +48,13 @@ public class DataSetDyController {
 
         return R.ok().put("page", page);
     }
+
+    @GetMapping("/listAll")
+    public R listAll() throws Exception {
+        // List<FileTest> list=MinIoUtils.listBucketFiles(DataSetType.STATIC_DATASET.getBucketName());
+        List<DataSetDy> list = dataSetDyService.list();
+        return R.ok().put("list", list);
+    }
     /**
      * Description 下载数据集
      * @param datasetName

+ 70 - 197
src/main/java/io/renren/modules/sys/controller/minIo/MinioController.java

@@ -1,19 +1,10 @@
 package io.renren.modules.sys.controller.minIo;
 
-import io.minio.MinioClient;
-import io.minio.PutObjectOptions;
 import io.minio.errors.*;
-import io.minio.http.Method;
 import io.renren.common.utils.MinIoUtils;
 import io.renren.common.utils.R;
-import io.renren.modules.sys.entity.algs.FileTest;
-import io.renren.modules.sys.service.FileTestService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
+import io.renren.modules.dataSet.enumeration.DataSetType;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import io.minio.messages.Item;
-import io.minio.Result;
 
 
 import java.io.*;
@@ -22,133 +13,36 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
-import java.util.UUID;
+
 
 @RestController
 @RequestMapping("/minio")
 public class MinioController {
-    @Value("${minio.endpoint}")
-    String endpoint;
-
-    @Value("${minio.access-key}")
-    String access_key;
-
-    @Value("${minio.secret-key}")
-    String secret_key;
-
-    @Value("${minio.bucket}")
-    String buctek;
-
-    @Value("${tempFileLocation}")
-    String tempFileLocation;
-
-    @Autowired
-    FileTestService fileTestService;
-
-
-
-
-    @PostMapping("/upload")
-    public void upload(@RequestParam("file")MultipartFile file) throws Exception {
-
-        // 使用MinIO服务的URL,端口,Access key和Secret key创建一个MinioClient对象
-        MinioClient minioClient = new MinioClient(endpoint, access_key, secret_key);
-
-        // 检查存储桶是否已经存在
-        boolean isExist = minioClient.bucketExists(buctek);
-        if(isExist) {
-            System.out.println("Bucket already exists.");
-        }else {
-            // 创建一个名为asiatrip的存储桶,用于存储照片的zip文件。
-            minioClient.makeBucket(buctek);
-        }
-
-        // 使用putObject上传一个文件到存储桶中。
-        String a = file.getOriginalFilename() ;//.split("\\.")[1];
-        PutObjectOptions putObjectOptions = new PutObjectOptions(file.getSize(), PutObjectOptions.MIN_MULTIPART_SIZE);
-        putObjectOptions.setContentType(file.getContentType());
-        minioClient.putObject(buctek, UUID.randomUUID().toString()+"$"+a,file.getInputStream(),putObjectOptions);
-        System.out.println("-----------------");
-
-    }
-
-    @GetMapping("/download")
-    public String download() throws Exception{ //String buctek,String objectName        ResponseEntity
-        // 使用MinIO服务的URL,端口,Access key和Secret key创建一个MinioClient对象
-        MinioClient minioClient = new MinioClient(endpoint, access_key, secret_key);
-        String buctek="test";
-        String objectName="1C8EL8QQCUAUHKI31DPBTD7TJT.jpg";
-        System.out.println(buctek);
-        System.out.println(objectName);
-//        InputStream object = minioClient.getObject(buctek, objectName);
-
-        String objectUrl = minioClient.getObjectUrl(buctek, objectName);
-        //返回Minio提供的下载链接,第四个参数是second,要给很多秒
-        String presignedObjectUrl = minioClient.getPresignedObjectUrl(Method.GET, buctek, objectName, 1000, null);
-
-        System.out.println(objectUrl);
-
-        System.out.println(presignedObjectUrl);
-        System.out.println("********");
-
-        return presignedObjectUrl;
-    }
-
-    @GetMapping("listtest")
-    public R listtest() throws Exception{
-
-            /* play.min.io for test and development. */
-            MinioClient minioClient =
-                    new MinioClient(
-                            endpoint,
-                            access_key,
-                            secret_key);
-
-            /* Amazon S3: */
-            // MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
-            //                                           "YOUR-SECRETACCESSKEY");
-
-            // Check whether 'my-bucketname' exist or not.
-            boolean found = minioClient.bucketExists(buctek);
-            if (found) {
-                List<Item> res = new ArrayList<>();
-                // List objects from 'my-bucketname'
-                Iterable<Result<Item>> myObjects = minioClient.listObjects(buctek,"");
-                for (Result<Item> result : myObjects) {
-                    Item item = result.get();
-                    if(!item.isDir())
-                    System.out.println(item.lastModified() + ", " + item.size() + ", " + item.objectName());
-                    res.add(item);
-                }
-                return R.ok().put("res", res);
-            } else {
-                System.out.println("bucket does not exist");
-                return R.error("bucket does not exist");
-            }
-
-    }
 
     /**
      * Description 获取minio中指定代码文件的内容
+     *
      * @return
      */
     @GetMapping("/readUrlContent")
-    public String readUrlContent(String algorithmNameToVersion,String verisionToFile,String fileName) throws Exception {
+    public String readUrlContent(String algorithmNameToVersion, String verisionToFile, long algFrameId, String fileName) throws Exception {
 
 
         //String requestUrl = minioClient.getPresignedObjectUrl(Method.GET, bucket, fileName, 1000, null);
         //使用minio工具类获取指定文件url
-        String requestUrl= MinIoUtils.getFileUrl("algorithm","alg"+algorithmNameToVersion+"/version"+verisionToFile+"/"+fileName);
-        HttpURLConnection conn=null;
-        BufferedReader br=null;
-        StringBuffer sbf=new StringBuffer();
-        String content=null;
+        if (algFrameId == -1) {
+            return MinIoUtils.getFileContent("algorithm", fileName);
+        }
+
+        String requestUrl = MinIoUtils.getFileUrl("algorithm", "alg" + algorithmNameToVersion + "/version" + verisionToFile + "/" + fileName);
+        HttpURLConnection conn = null;
+        BufferedReader br = null;
+        StringBuffer sbf = new StringBuffer();
+        String content = null;
         try {
-            URL url=new URL(requestUrl);
-            conn=(HttpURLConnection) url.openConnection();
+            URL url = new URL(requestUrl);
+            conn = (HttpURLConnection) url.openConnection();
 
             //设置不使用缓存
             conn.setUseCaches(false);
@@ -164,20 +58,20 @@ public class MinioController {
             //开启链接
             conn.connect();
 
-            br=new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
-            String strContent=null;
-            while ((strContent=br.readLine())!=null){
+            br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
+            String strContent = null;
+            while ((strContent = br.readLine()) != null) {
                 sbf.append("\n");
                 sbf.append(strContent);
             }
-            sbf.delete(0,1);
-            content=sbf.toString();
+            sbf.delete(0, 1);
+            content = sbf.toString();
 
         } catch (MalformedURLException e) {
             e.printStackTrace();
-        }finally {
-            if(null!=br)    br.close();
-            if(null!=conn)  conn.disconnect();
+        } finally {
+            if (null != br) br.close();
+            if (null != conn) conn.disconnect();
         }
 
         return content;
@@ -185,22 +79,23 @@ public class MinioController {
 
     /**
      * Description 获取minio中指定传统算法代码文件的内容
+     *
      * @return
      */
     @GetMapping("/readTraUrlContent")
-    public String readTraUrlContent(String algorithmNameToVersion,String fileName) throws Exception {
+    public String readTraUrlContent(String algorithmNameToVersion, String fileName) throws Exception {
 
 
         //String requestUrl = minioClient.getPresignedObjectUrl(Method.GET, bucket, fileName, 1000, null);
         //使用minio工具类获取指定文件url
-        String requestUrl= MinIoUtils.getFileUrl("algorithm","alg"+algorithmNameToVersion+"/"+fileName);
-        HttpURLConnection conn=null;
-        BufferedReader br=null;
-        StringBuffer sbf=new StringBuffer();
-        String content=null;
+        String requestUrl = MinIoUtils.getFileUrl("algorithm", "alg" + algorithmNameToVersion + "/" + fileName);
+        HttpURLConnection conn = null;
+        BufferedReader br = null;
+        StringBuffer sbf = new StringBuffer();
+        String content = null;
         try {
-            URL url=new URL(requestUrl);
-            conn=(HttpURLConnection) url.openConnection();
+            URL url = new URL(requestUrl);
+            conn = (HttpURLConnection) url.openConnection();
 
             //设置不使用缓存
             conn.setUseCaches(false);
@@ -216,20 +111,20 @@ public class MinioController {
             //开启链接
             conn.connect();
 
-            br=new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
-            String strContent=null;
-            while ((strContent=br.readLine())!=null){
+            br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
+            String strContent = null;
+            while ((strContent = br.readLine()) != null) {
                 sbf.append("\n");
                 sbf.append(strContent);
             }
-            sbf.delete(0,1);
-            content=sbf.toString();
+            sbf.delete(0, 1);
+            content = sbf.toString();
 
         } catch (MalformedURLException e) {
             e.printStackTrace();
-        }finally {
-            if(null!=br)    br.close();
-            if(null!=conn)  conn.disconnect();
+        } finally {
+            if (null != br) br.close();
+            if (null != conn) conn.disconnect();
         }
 
         return content;
@@ -237,80 +132,58 @@ public class MinioController {
 
     /**
      * Description 将codemirror中的内容写入文件
+     *
      * @return
      * @throws IOException
      */
     @PostMapping("/writeFile")
-    public String writeFile(@RequestBody HashMap<String,String> map){
-        File file=new File(tempFileLocation);
+    public R writeFile(@RequestBody HashMap<String, String> map) {
         try {
-            //判断是否存在指定文件夹 不存在则创建
-            if (!file.getParentFile().exists()) {
-                file.getParentFile().mkdirs();
-            }
-            //判断是否存在指定文件 不存在则创建
-            if(!file.exists()){
-                file.createNewFile();
-            }
-            FileWriter fileWriter=new FileWriter(file.getAbsoluteFile());
-            BufferedWriter bufferWriter = new BufferedWriter(fileWriter);
-            bufferWriter.write(map.get("content"));
-            bufferWriter.close();
-            PutObjectOptions options=new PutObjectOptions(file.length(),PutObjectOptions.MIN_MULTIPART_SIZE);
-            //使用minio工具类上传本地文件到minio
-            String algorithmNameToVersion=map.get("algorithmNameToVersion");
-            String verisionToFile=map.get("verisionToFile");
-            String fileName=map.get("fileName");
-            MinIoUtils.uploadLocalFile("algorithm", "alg"+algorithmNameToVersion+"/version"+verisionToFile+"/"+fileName,tempFileLocation,options);
-        }catch (Exception e){
-            e.printStackTrace();
+            String algorithmNameToVersion = map.get("algorithmNameToVersion");
+            String verisionToFile = map.get("verisionToFile");
+            String fileName = map.get("fileName");
+            byte[] contentBytes = map.get("content").getBytes(); // 将字符串内容转换为字节数组
+            // 构造InputStream对象
+            InputStream inputStream = new ByteArrayInputStream(contentBytes);
+            // 获取字节数组长度作为文件大小
+            long fileSize = contentBytes.length;
+            MinIoUtils.uploadFileByInputStream(inputStream, fileSize, DataSetType.ALG_DATASET.getBucketName(), "alg" + algorithmNameToVersion + "/version" + verisionToFile + "/" + fileName);
+            return R.ok();
+        } catch (Exception e) {
+            return R.error(e.getMessage());
         }
-
-        return "success";
     }
 
     /**
-     * Description 将codemirror中的内容写入传统算法文件
+     * 将codemirror中的内容写入传统算法文件
+     *
+     * @param map
      * @return
-     * @throws IOException
      */
     @PostMapping("/writeTraFile")
-    public String writeTraFile(@RequestBody HashMap<String,String> map){
-        File file=new File(tempFileLocation);
+    public R writeTraFile(@RequestBody HashMap<String, String> map) {
         try {
-            //判断是否存在指定文件夹 不存在则创建
-            if (!file.getParentFile().exists()) {
-                file.getParentFile().mkdirs();
-            }
-            //判断是否存在指定文件 不存在则创建
-            if(!file.exists()){
-                file.createNewFile();
-            }
-            FileWriter fileWriter=new FileWriter(file.getAbsoluteFile());
-            BufferedWriter bufferWriter = new BufferedWriter(fileWriter);
-            bufferWriter.write(map.get("content"));
-            bufferWriter.close();
-            PutObjectOptions options=new PutObjectOptions(file.length(),PutObjectOptions.MIN_MULTIPART_SIZE);
-            //使用minio工具类上传本地文件到minio
-            String algorithmNameToVersion=map.get("algorithmNameToVersion");
-            String fileName=map.get("fileName");
-            MinIoUtils.uploadLocalFile("algorithm", "alg"+algorithmNameToVersion+"/"+fileName,tempFileLocation,options);
-        }catch (Exception e){
-            e.printStackTrace();
+            String algorithmNameToVersion = map.get("algorithmNameToVersion");
+            String fileName = map.get("fileName");
+            byte[] contentBytes = map.get("content").getBytes(); // 将字符串内容转换为字节数组
+            // 构造InputStream对象
+            InputStream inputStream = new ByteArrayInputStream(contentBytes);
+            MinIoUtils.uploadFileByInputStream(inputStream, (long) contentBytes.length, DataSetType.ALG_DATASET.getBucketName(), "alg" + algorithmNameToVersion + "/" + fileName);
+            return R.ok();
+        } catch (Exception e) {
+            return R.error(e.getMessage());
         }
-
-        return "success";
     }
 
     /**
      * 根据传入的algId与versionId以及fileName 删除文件
+     *
      * @param
      * @return
      */
     @GetMapping("/deleteFile")
-    public R deleteFile(String algorithmNameToVersion,String versionToFile,String fileName) throws IOException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, ErrorResponseException, XmlParserException, InvalidBucketNameException, InsufficientDataException, InternalException {
-        System.out.println("alg"+algorithmNameToVersion+"/version"+versionToFile+"/"+fileName);
-        MinIoUtils.deleteFile("algorithm","alg"+algorithmNameToVersion+"/version"+versionToFile+"/"+fileName);
+    public R deleteFile(String algorithmNameToVersion, String versionToFile, String fileName) throws IOException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, ErrorResponseException, XmlParserException, InvalidBucketNameException, InsufficientDataException, InternalException {
+        MinIoUtils.deleteFile("algorithm", "alg" + algorithmNameToVersion + "/version" + versionToFile + "/" + fileName);
         return R.ok();
     }
 }

+ 2 - 0
src/main/java/io/renren/modules/sys/entity/VisiWorkflowEntity.java

@@ -1,5 +1,6 @@
 package io.renren.modules.sys.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
@@ -47,6 +48,7 @@ public class VisiWorkflowEntity implements Serializable {
 	/**
 	 * 执行状态
 	 */
+	@TableField(exist = false)
 	private String status;
 
 

+ 23 - 15
src/main/resources/application-dev.yml

@@ -1,12 +1,14 @@
 spring:
     datasource:
+        database-name: hebing_menu
         type: com.alibaba.druid.pool.DruidDataSource
         druid:
             driver-class-name: com.mysql.cj.jdbc.Driver
-            url: jdbc:mysql://localhost:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
+            #43.143.221.128:6033/renren_fast
+#            url: jdbc:mysql://10.170.57.219:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
+            url: jdbc:mysql://10.170.57.219:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
             username: root
-            password: 123456
-#            password: root
+            password: XDUxdu2023
             initial-size: 10
             max-active: 100
             min-idle: 10
@@ -37,16 +39,23 @@ spring:
 
 ##多数据源的配置
 dynamic:
-  datasource:
-    bigData:
-#      url: jdbc:mysql://112.126.68.148:6033/hebing?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
-        url: jdbc:mysql://lab2:6033/bigdata_sgwtest?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
-#        url: jdbc:mysql://localhost:3306/hebing?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
-        username: root
-        password: XDU520bdm
-#        password: root
-#        password: 123456
-        driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
+    datasource:
+        #        bigData:
+        #            #      url: jdbc:mysql://112.126.68.148:6033/hebing?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
+        #            url: jdbc:mysql://43.143.221.128:6033/bigdata_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
+        #            #        url: jdbc:mysql://localhost:3306/hebing?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
+        #            username: root
+        #            password: XDUxdu2022
+        #            #        password: root
+        #            #        password: 123456
+        #            driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
+        heBing:
+#            url: jdbc:mysql://10.170.57.219:3306/hebing_menu?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
+            url: jdbc:mysql://10.170.57.219:3306/hebing_menu?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
+            username: root
+            password: XDUxdu2023
+            driver-class-name: com.mysql.cj.jdbc.Driver
+
 server:
     port: 8082
 #      password: 123456
@@ -54,8 +63,7 @@ server:
 
 hbase:
     config:
-        hbase.zookeeper.quorum: 150.158.138.99,49.235.67.21,42.192.195.253
-        #hbase.zookeeper.quorum: 182.92.79.148,112.126.68.148,123.56.99.12
+        hbase.zookeeper.quorum: 10.170.7.125
         hbase.zookeeper.property.clientPort: 2181
         zookeeper.znode.parent: /hbase
         hbase.client.keyvalue.maxsize: 1048576000

+ 38 - 43
src/main/resources/application.yml

@@ -5,51 +5,43 @@ server:
     max-threads: 1000
     min-spare-threads: 30
   port: 8082
-  connection-timeout: 5000ms
   servlet:
     context-path: /renren-fast
-#  minIO
+# minio
 minio:
-  endpoint: http://150.158.138.99:9006
+  endpoint: http://10.170.7.125:9000
   bucket: test0706
   access-key: minio
   secret-key: minio123
 
-#docker远程连接
+# docker远程连接
 docker:
-  #url: https://192.168.25.101:2376
-  url: https://150.158.138.99:2376
-remote-docker: 150.158.138.99
-#上传文件到远程服务器地址,用户名及密码,上传文件的基础路径
-host: 150.158.138.99
+  url: https://10.170.7.125:2376
+remote-docker: 10.170.7.125
+# 上传文件到远程服务器地址,用户名及密码,上传文件的基础路径
+host: 10.170.7.125
 host-username: root
-host-password: XDU520bdm
+host-password: kylin123
+# host-basepath: D:/aiplat-mkcloud/aiplat/uploadFile
 host-basepath: /opt/uploadFile
 host-port: 22
-#连接远程服务器是否需要秘钥
-key-needed: true
-#如果需要秘钥,则将秘钥地址填写在此
-key-location: D:/Program Files/secretKey/lab1
+# 连接远程服务器是否需要秘钥
+key-needed: false
+# 如果需要秘钥,则将秘钥地址填写在此,这是ftp服务器的密钥不是ca的密钥
+key-location: D:/aiplat-mkcloud/aiplat/docker_ca
 
-#docker证书存放路径
-docker_ca: D:/aiplat/school_ca
+# docker证书存放路径
+docker_ca: D:/aiplat-mkcloud/aiplat/docker_ca
 
-#minio暂存文件地址
-tempFileLocation: D:/aiplat/test0708/testPython.py
 
-#获取kafka实时数据ip与端口
-realTimeKafka1: 10.168.57.10:9092
-realTimeKafka2: 10.168.57.11:9092
-realTimeKafka3: 10.168.57.12:9092
+# 算法结果入库模板ip
+resultToDB: 10.170.7.125
 
-#算法结果入库模板ip
-resultToDB: 49.235.67.21
+# 数据预处理数据集存放文件夹
+datasetLocation: D:/aiplat-mkcloud/aiplat/demoCSV
 
-#数据预处理数据集存放文件夹
-datasetLocation: D:/aiplat/demoCSV
-
-#数据预处理python文件存放文件夹
-dataPreProcessLocation: D:/aiplat/dataPreProcess
+# 数据预处理python文件存放文件夹
+dataPreProcessLocation: D:/aiplat-mkcloud/aiplat/dataPreProcess
 
 spring:
   # 环境 dev|test|prod
@@ -80,24 +72,26 @@ spring:
   mvc:
     throw-exception-if-no-handler-found: true
   resources:
-   add-mappings: true
+    add-mappings: true
 
+# 层级相关数据库
+cengji: hebing_menu
 
 
-#mybatis
+# mybatis
 mybatis-plus:
   mapper-locations: classpath*:/mapper/**/*.xml
-  #实体扫描,多个package用逗号或者分号分隔
+  # 实体扫描,多个package用逗号或者分号分隔
   typeAliasesPackage: io.renren.modules.*.entity
   global-config:
-    #数据库相关配置
+    # 数据库相关配置
     db-config:
-      #主键类型  AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
+      # 主键类型  AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
       id-type: AUTO
       logic-delete-value: -1
       logic-not-delete-value: 0
     banner: false
-  #原生配置
+  # 原生配置
   configuration:
     map-underscore-to-camel-case: true
     cache-enabled: false
@@ -118,23 +112,24 @@ renren:
     expire: 604800
     header: token
 
-#Argo
+# Argo
 argo:
-  basepath: https://42.192.195.253:30865
-  minioendpoint: http://42.192.195.253:30253
+  basepath: https://10.170.7.125:32742
+  minioendpoint: http://10.170.7.125:32626
   minioAccess-key: admin
-  #  minioAccess-key: vzZBapBXei60zI1t6oPl
   minioSecret-key: password
-  #  minioSecret-key: nkjkRpJLkpb2THUpGKtdMBPPEi3XdmllnOctF8yS
   sparkMasterRest: spark://150.158.138.99:16066
   sparkMaster: spark://150.158.138.99:7077
   sparkHdfsurl: hdfs://150.158.138.99:8020
   sparkYarnAddress: spark://150.158.138.99:8088
   sparkYarnJARS: hdfs://150.158.138.99:8020
-#kubenetes  Argo部分获取pod日志
+# kubenetes  Argo部分获取pod日志
 Akubenetes:
-  basepath: https://42.192.195.253:6443
-  kubeconfig-path: D:/zhang/IdeaProjects/20220322/config
+  basepath: https://43.143.237.223:30880
+  kubeconfig-path: D:/aiplat-mkcloud/aiplat/akubenetes/config
+
+# griffin数据探查服务
+griffin: http://43.143.224.212:8091
 
 
 

+ 3 - 4
src/test/java/io/renren/JwtTest.java

@@ -1,5 +1,6 @@
 package io.renren;
 
+import io.renren.common.utils.MinIoUtils;
 import io.renren.modules.app.utils.JwtUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -15,10 +16,8 @@ public class JwtTest {
     private JwtUtils jwtUtils;
 
     @Test
-    public void test() {
-        String token = jwtUtils.generateToken(1);
-
-        System.out.println(token);
+    public void test() throws Exception {
+        MinIoUtils.copyFolder("ce111", null, "stan", null);
     }
 
 }