dengsixing před 1 měsícem
rodič
revize
15e745687c

+ 1 - 1
src/main/java/com/fdkankan/project/tieta/entity/Scene.java

@@ -12,7 +12,7 @@ import lombok.experimental.Accessors;
 
 /**
  * <p>
- *
+ *  场景表
  * </p>
  *
  * @author dsx

+ 3 - 0
src/main/java/com/fdkankan/project/tieta/schedule/Job.java

@@ -22,6 +22,9 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+/**
+ * 定时任务
+ */
 @Component
 public class Job {
 

+ 0 - 100
src/main/java/com/fdkankan/project/tieta/utils/CmdUtils.java

@@ -1,100 +0,0 @@
-package com.fdkankan.project.tieta.utils;
-
-/**
- * Created by Xiewj on 2021/1/4 0004 14:53
- */
-public class CmdUtils {
-
-
-    /**
-     * 调用算法 xx.sh 脚本
-     * @param command
-     */
-//    public static void callshell(String command){
-//        try {
-//            String[] cmd = new String[]{"/bin/sh", "-c", command};
-//            Process process = Runtime.getRuntime().exec(cmd);
-//            StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
-//            errorGobbler.start();
-//            StreamGobbler outGobbler = new StreamGobbler(process.getInputStream(), "STDOUT");
-//            outGobbler.start();
-//            process.waitFor();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//    }
-
-
-
-    public static void callLineSh(String command) throws Exception {
-        callLineSh(command, null);
-
-    }
-
-    /**
-     * 直接java调用命令
-     * @param command
-     */
-    public static void callLine(String command) throws Exception {
-        callLine(command, null);
-
-    }
-
-    /**
-     * 直接java调用命令
-     * @param command
-     */
-    public static void callLine(String command, Integer lineSize) throws Exception {
-        System.out.println("cmd: " + command);
-        Process process = Runtime.getRuntime().exec(command);
-        System.out.println("开始运行");
-        StreamGobblerLine errorGobbler = new StreamGobblerLine(process.getErrorStream(), "ERROR");
-        errorGobbler.start();
-        // 200行打印一次日志
-        StreamGobblerLine outGobbler = new StreamGobblerLine(process.getInputStream(), "STDOUT", lineSize);
-        outGobbler.start();
-        process.waitFor();
-    }
-
-    /**
-     *
-     * @param command 命令
-     * @param lineSize 日志输出行数 ,可以为null
-     */
-    public static void callLineSh(String command, Integer lineSize) throws Exception {
-        try {
-        System.out.println("cmd: " + command);
-        String[] cmd = new String[]{"/bin/sh", "-c", command};
-        Process process = Runtime.getRuntime().exec(cmd);
-        System.out.println("开始运行");
-        StreamGobblerLine errorGobbler = new StreamGobblerLine(process.getErrorStream(), "ERROR");
-        errorGobbler.start();
-        // 200行打印一次日志
-        StreamGobblerLine outGobbler = new StreamGobblerLine(process.getInputStream(), "STDOUT", lineSize);
-        outGobbler.start();
-        process.waitFor();
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * 调用sh脚本上传oss
-     */
-//    public static void ossUploadDir(String sceneCode, String uploadDir, String target){
-//
-//        String cmd = CmdConstant.OSSUTIL_UPLOAD_DIR;
-//        cmd = cmd.replaceAll("@sceneCode", sceneCode);
-//        cmd = cmd.replaceAll("@uploadDir", uploadDir);
-//        cmd = cmd.replaceAll("@target", target);
-//
-//        log.info("ossCmd: " + cmd);
-//        long start = System.currentTimeMillis();
-//        CmdUtils.callLineSh(cmd);
-//        long end = System.currentTimeMillis();
-//        log.info("场景码目录:{} 上传完成, 耗时:{} s" , sceneCode, (end-start)/1000 );
-//    }
-
-
-
-}

+ 0 - 78
src/main/java/com/fdkankan/project/tieta/utils/StreamGobblerLine.java

@@ -1,78 +0,0 @@
-package com.fdkankan.project.tieta.utils;
-
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.*;
-
-public class StreamGobblerLine extends Thread {
-
-	InputStream is;
-    String type;
-    OutputStream os;
-    Integer lineSize;  // 多少行打印日志一次
-
-    public StreamGobblerLine(InputStream is, String type) {
-        this(is, type, null, null);
-    }
-
-    public StreamGobblerLine(InputStream is, String type, Integer lineSize) {
-        this(is, type, null, lineSize);
-    }
-
-    StreamGobblerLine(InputStream is, String type, OutputStream redirect, Integer lineSize) {
-        this.is = is;
-        this.type = type;
-        this.os = redirect;
-        this.lineSize = lineSize;
-    }
-
-    public void run() {
-        System.out.println("run StreamGobblerLine");
-
-        InputStreamReader isr = null;
-        BufferedReader br = null;
-        PrintWriter pw = null;
-        try {
-            if (os != null)
-                pw = new PrintWriter(os);
-
-            isr = new InputStreamReader(is);
-            br = new BufferedReader(isr);
-            String line=null;
-            int i = 1;
-            while ( (line = br.readLine()) != null) {
-                if (lineSize != null) {
-                    if (i % lineSize == 0) {
-                        System.out.println(type + "," + i +" : >" + line);
-                    }
-                } else {
-                    System.out.println(type + ","  + i +" : >" + line);
-                }
-                i++;
-
-            }
-
-            if (pw != null)
-                pw.flush();
-        } catch (IOException ioe) {
-            ioe.printStackTrace();
-        } finally{
-            try {
-            	if(pw!=null)
-            	{
-            		 pw.close();
-            	}
-            	if(br!=null)
-            	{
-            		br.close();
-            	}
-            	if(isr!=null)
-            	{
-            		isr.close();
-            	}
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-}