supeng vor 1 Monat
Ursprung
Commit
ada9747ddd

+ 6 - 1
content-understanding-core/src/main/java/com/tzld/piaoquan/content/understanding/service/impl/ContentServiceImpl.java

@@ -9,6 +9,7 @@ import com.tzld.piaoquan.content.understanding.service.LoghubService;
 import com.tzld.piaoquan.content.understanding.service.PipelineService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.util.Objects;
@@ -26,11 +27,15 @@ public class ContentServiceImpl implements ContentService {
     @Autowired
     private PipelineService pipelineService;
 
+    @Value("${video.analyse.pipelineId:1}")
+    private Long videoAnalysePipelineId;
+
     @Override
     public void analyse(ContentAnalyseParam param) {
-        if (Objects.isNull(param) || Objects.isNull(param.getPipelineId()) || Objects.isNull(param.getType())) {
+        if (Objects.isNull(param) || Objects.isNull(param.getType())) {
             throw new CommonException(ExceptionEnum.PARAMS_INVALID);
         }
+        param.setPipelineId(videoAnalysePipelineId);
         pipelineService.execute(param);
     }
 }

+ 1 - 1
content-understanding-server/src/main/java/com/tzld/piaoquan/content/understanding/controller/ContentController.java

@@ -24,7 +24,7 @@ public class ContentController {
     private ContentService contentService;
 
     @PostMapping(value = "/analyse")
-    public CommonResponse<String> analyse(@RequestBody ContentAnalyseParam param) {
+    public CommonResponse<Void> analyse(@RequestBody ContentAnalyseParam param) {
         contentService.analyse(param);
         return CommonResponse.create();
     }