Commit ede69b2be8776e13b331dd8a67a6bf3511cfbed0

Authored by liwei2917
1 parent 5f111377

数美送审

src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
... ... @@ -65,6 +65,7 @@ public class ContentControllerApi {
65 65 shyContent1.setContent_status(json.getInteger("contentStatus"));//当前图文的审核状态
66 66 shyContent1.setSource(json.getString("source"));//来源
67 67 shyContent1.setAuthor(json.getString("author"));//作者
  68 + shyContent1.setContent_text(json.getString("content_text"));//图文内容
68 69 String contentTime = json.getString("contentTime");//图文创建时间
69 70 if (CommonUtils.isNotEmpty(contentTime)) {
70 71 Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
... ... @@ -96,6 +97,7 @@ public class ContentControllerApi {
96 97 shyContent.setContent_status(json.getInteger("contentStatus"));//当前图文的审核状态
97 98 shyContent.setSource(json.getString("source"));//来源
98 99 shyContent.setAuthor(json.getString("author"));//作者
  100 + shyContent.setContent_text(json.getString("content_text"));//图文内容
99 101 String contentTime = json.getString("contentTime");//创建时间
100 102 if (CommonUtils.isNotEmpty(contentTime)) {
101 103 Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
... ...
src/main/java/com/cnlive/shenhe/job/ContentJob.java
... ... @@ -58,7 +58,7 @@ public class ContentJob {
58 58 /**
59 59 * 定时发送数美检测视频
60 60 */
61   -// @Scheduled(cron="0 0/1 10-23 * * ? ")//每天10点到23点执行,每分钟一次
  61 + @Scheduled(cron="0 0/1 10-23 * * ? ")//每天10点到23点执行,每分钟一次
62 62 public void videofilter() {
63 63 ShyContent shyContent = new ShyContent();
64 64 shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE);//审核类型为机审
... ... @@ -67,7 +67,7 @@ public class ContentJob {
67 67 if (shyContentList.size() > 0) {
68 68 for (ShyContent content : shyContentList) {
69 69 logger.info("定时发送数美检测的content_id:"+content.getId());
70   - //数美图过滤
  70 + //数美图过滤
71 71 contentService.contentFilter(content,"DEFAULT_LOGO");
72 72 }
73 73 }
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
... ... @@ -23,6 +23,7 @@ import org.apache.ibatis.session.RowBounds;
23 23 import org.slf4j.Logger;
24 24 import org.slf4j.LoggerFactory;
25 25 import org.springframework.beans.factory.annotation.Autowired;
  26 +import org.springframework.beans.factory.annotation.Value;
26 27 import org.springframework.stereotype.Service;
27 28 import tk.mybatis.mapper.entity.Example;
28 29  
... ... @@ -60,6 +61,9 @@ public class ContentServiceImpl {
60 61 VideosServiceImpl videosService;
61 62 @Autowired
62 63 VideofilterServiceImpl videofilterServiceImpl;
  64 +
  65 + @Value("${spring.localhost.url}")
  66 + String localhost_url;
63 67  
64 68 public ShyContent getShyContent(ShyContent shyContent) {
65 69 List<ShyContent> shyContentList = shyContentMapper.select(shyContent);
... ... @@ -367,9 +371,10 @@ public class ContentServiceImpl {
367 371 String type="";//数美返回结果的类型
368 372 String desc="";//数美失败结果的详情
369 373 String Token_id=UUID.randomUUID().toString();
  374 + String contentUrl=localhost_url+"/api/content/detail/"+shyContent.getContent_id()+".html";
370 375 try{
371 376 //调用数美接口
372   - result = AntiFraudUtil.filterArticle(Token_id,shyContent.getContent_url(),channel);
  377 + result = AntiFraudUtil.filterArticle(Token_id,contentUrl,channel);
373 378 type=result.getString("riskLevel");
374 379 desc=result.getString("desc");//数美失败结果的详情
375 380 }catch(Exception e){
... ...
src/main/java/com/cnlive/shenhe/utils/AntiFraudUtil.java
... ... @@ -42,7 +42,7 @@ public class AntiFraudUtil {
42 42 // String btId = uuid.toString();
43 43  
44 44 // System.out.println("文本:"+AntiFraudUtil.filterText("0000001", "王八蛋", "DYNAMIC_USER") + "---");
45   -// System.out.println(AntiFraudUtil.filterArticle("000111","http://shineup.china.com.cn/WJJ/detail2_2019_08/13/1365957.html",null));
  45 +// System.out.println(AntiFraudUtil.filterArticle("000111","http://ffyl.cnlive.com/tgtw/detail2_2019_08/29/1400477.html",null));
46 46 //System.out.println("图片:"+AntiFraudUtil.filterImg("0000001", jsonArray,"DYNAMIC_BUSINESS") + "---");
47 47 //System.out.println("视频:"+AntiFraudUtil.filterVideo("http://wjj.ys1.cnliveimg.com/testVideo/test1.mp4",btId,null) + "---");
48 48 //queryVideoResult("02b649b7-3451-403e-abd0-592302cec2a0");
... ...
src/main/resources/application.properties
... ... @@ -48,6 +48,9 @@ url=http://mam.innerapi.cnlive.com/v1/inner/ShenHeInfo/shenheNotify
48 48 platformKey =AUDIT
49 49 platformValue=10011438
50 50  
  51 +#\u672c\u673a\u5730\u5740
  52 +spring.localhost.url=http://test.shen.cnlive.com
  53 +
51 54 #\u62bd\u5e27\u5e38\u91cf
52 55 avsmple_appKey=1eac30dfbee311e7a2f0fa163e771cf9
53 56 avsmple_appSecret=28ce1e1fbee311e7a2f0fa163e771cf92ea58ebfbee311e7a2f0fa163e771cf9
... ...