瀏覽代碼

内容库V1.0.0

kaick 1 年之前
父節點
當前提交
b0ed97a196

+ 0 - 25
src/main/java/com/caimei365/manager/controller/caimei/productArchive/ProductArchiveController.java

@@ -69,11 +69,6 @@ public class ProductArchiveController {
     @PostMapping("/add")
     public ResponseJson productArchiveAdd(@RequestBody CmProductArchive cmProductArchive
     ) {
-        // if (null == cmProviders.getName() ||
-        //         null == cmProviders.getLinkMan() ||
-        // ) {
-        //     return ResponseJson.error("参数异常!");
-        // }
         cmProductArchiveService.addCmProductArchive(cmProductArchive);
         return ResponseJson.success();
     }
@@ -106,11 +101,6 @@ public class ProductArchiveController {
     @PostMapping("/content/add")
     public ResponseJson productArchiveContentAdd(@RequestBody CmProductArchiveContent cmProductArchiveContent
     ) {
-        // if (null == cmProviders.getName() ||
-        //         null == cmProviders.getLinkMan() ||
-        // ) {
-        //     return ResponseJson.error("参数异常!");
-        // }
         cmProductArchiveContentService.addCmProductArchiveContent(cmProductArchiveContent);
         return ResponseJson.success();
     }
@@ -130,19 +120,4 @@ public class ProductArchiveController {
     }
 
 
-    @GetMapping("/ffmepg")
-    public ResponseJson produc(String ffmepgPath) {
-        String s = StringUtils.isNotBlank(ffmepgPath) ? ffmepgPath : "E:\\kaick\\tools\\idmZIP\\ffmpeg-6.1-essentials_build\\bin\\ffmpeg.exe";
-        HashMap<String, String> dto = new HashMap<String, String>();
-        //ffmpeg程序路径
-        dto.put("ffmpeg_path", s);
-        log.info("ffmepg程序路径:" + s);
-        //视频输入路径
-        dto.put("input_path", "https://caimei-oss.oss-cn-shenzhen.aliyuncs.com/beta/archiveFile/9719e56b1d87413886a98e9c0ae04a5a.mp4?Expires=4845853915&OSSAccessKeyId=LTAI4GBL3o4YkWnbKYgf2Xia&Signature=otFR7YsvOJTnzOJMjFeZ5khraqA%3D");
-        // 白名单
-        dto.put("whitelist", "file,http,https,rtp,udp,tcp,tls");
-        return ResponseJson.success(new FFMPEG().getVideoSize(dto));
-    }
-
-
 }

+ 2 - 2
src/main/java/com/caimei365/manager/utils/CmdExecuter.java

@@ -18,7 +18,7 @@ public class CmdExecuter {
             ProcessBuilder builder = new ProcessBuilder();
             String join = StringUtils.join(cmd, " ");
             log.info("join:"+join);
-            builder.command(new String[]{"sh", "-c", join});
+            builder.command(cmd);
             builder.redirectErrorStream(true);
             proc = builder.start();
             stdout = new BufferedReader(new InputStreamReader(proc.getInputStream()));
@@ -26,7 +26,7 @@ public class CmdExecuter {
             int lineNumber = 1;
             List<String> returnStringList = new LinkedList<String>();
             while ((line = stdout.readLine()) != null) {
-                log.info("第" + lineNumber + "行:" + line);
+                System.out.println("第" + lineNumber + "行:" + line);
                 lineNumber = lineNumber + 1;
                 returnStringList.add(FFMPEG.dealString(line));
             }

+ 3 - 3
src/main/java/com/caimei365/manager/utils/FFMPEG.java

@@ -20,7 +20,7 @@ public class FFMPEG {
     @Resource
     private Environment environment;
     private static String config;
-    private static String ffmepgPath = "/mnt/newdatadrive/apps/ffmpeg/ffmpeg-master/ffmpeg-resource/ffmpeg";
+    private static String ffmepgPath = "/usr/bin/ffmpeg";
     private static String logoPath = "/mnt/newdatadrive/data/runtime/jar-instance/manager-api/logo/logo.png";
 
     @PostConstruct
@@ -208,7 +208,7 @@ public class FFMPEG {
             ProcessBuilder builder = new ProcessBuilder();
             String join = StringUtils.join(cmd, " ");
             logger.info("join:"+join);
-            builder.command(new String[]{"sh", "-c", join});
+            builder.command(cmd);
             final Process p = builder.start();
             //从输入流中读取视频信息
             BufferedReader br = new BufferedReader(new InputStreamReader(p.getErrorStream()));
@@ -220,7 +220,7 @@ public class FFMPEG {
             br.close();
             int resultCode = p.waitFor();
             logger.info("resultCode:"+resultCode);
-            logger.info(sb.toString());
+            System.out.println(sb.toString());
             int start = sb.indexOf("Video:");
             String substring = sb.substring(start);
             String[] split = substring.split("\\),");

+ 2 - 2
src/main/resources/mapper/productArchive/CmProductArchiveMapper.xml

@@ -19,9 +19,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          select
          cm_product_archive.id,
          cm_product_archive.productId,
-         cm_product_archive.productName,
          cm_product_archive.shopName,
-         cm_product_archive.productImage,
+         ifnull(cm_product_archive.productImage,(select mainImage from product where productID=cm_product_archive.productId)) as productImage,
+         ifnull(cm_product_archive.productName,(select name from product where productID=cm_product_archive.productId)) as productName,
          cm_product_archive.productType,
          cm_product_archive.productClassify,
          cm_product_archive.addTime