|
@@ -2,12 +2,17 @@ package com.tzld.piaoquan.featurestools.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.tzld.piaoquan.featurestools.dao.mapper.CreativeMapper;
|
|
|
+import com.tzld.piaoquan.featurestools.dao.mapper.CreativeVideoUnderstanderMapper;
|
|
|
+import com.tzld.piaoquan.featurestools.model.po.Creative;
|
|
|
+import com.tzld.piaoquan.featurestools.model.po.CreativeVideoUnderstander;
|
|
|
import com.tzld.piaoquan.featurestools.model.vo.VideoUnderstandParam;
|
|
|
import com.tzld.piaoquan.featurestools.model.vo.VideoUnderstandResult;
|
|
|
import com.tzld.piaoquan.featurestools.service.VideoUnderstandService;
|
|
|
import com.tzld.piaoquan.featurestools.util.HttpClientUtil;
|
|
|
import com.tzld.piaoquan.featurestools.util.HttpPoolClientUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@Slf4j
|
|
@@ -16,6 +21,26 @@ public class VideoUnderstandServiceImpl implements VideoUnderstandService {
|
|
|
|
|
|
private static final HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 200000, 10, 20, 3, 3000);
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CreativeMapper creativeMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CreativeVideoUnderstanderMapper creativeVideoUnderstanderMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean addCreativeVideoUnderstand(Long creativeId) {
|
|
|
+ try {
|
|
|
+ Creative creative = creativeMapper.selectByPrimaryKey(creativeId);
|
|
|
+ CreativeVideoUnderstander creativeVideoUnderstander = new CreativeVideoUnderstander();
|
|
|
+ creativeVideoUnderstander.setCreativeId(creativeId);
|
|
|
+ creativeVideoUnderstander.setVideoUrl(creative.getMaterialAddress());
|
|
|
+ int i = creativeVideoUnderstanderMapper.insertSelective(creativeVideoUnderstander);
|
|
|
+ return i > 0;
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("addCreativeVideoUnderstand error", e);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public VideoUnderstandResult getVideoUnderstandResult(VideoUnderstandParam videoUnderstandParam) {
|