package com.tzld.piaoquan.featurestools.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; 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.stereotype.Service; @Slf4j @Service public class VideoUnderstandServiceImpl implements VideoUnderstandService { private static final HttpPoolClientUtil httpPoolClientUtil = HttpClientUtil.create(5000, 200000, 10, 20, 3, 3000); @Override public VideoUnderstandResult getVideoUnderstandResult(VideoUnderstandParam videoUnderstandParam) { try { String url = "http://47.84.45.73:5005/understander/video"; String post = httpPoolClientUtil.post(url, JSONObject.toJSONString(videoUnderstandParam)); JSONObject jsonObject = JSON.parseObject(post); return jsonObject.toJavaObject(VideoUnderstandResult.class); } catch (Exception e) { log.error("getVideoUnderstandResult error", e); } return null; } }