Commit fefacc4ee997bc2f65259dbae8086f04aefdebb9

Authored by 王言钊
2 parents 06c9e43f 3a1321f2

Merge remote-tracking branch 'origin/dev' into dev

src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
... ... @@ -48,9 +48,11 @@ public class ContentControllerApi {
48 48 shyContent.setContent_id(contentId);
49 49 //图文标签
50 50 shyContent.setContent_tag("content");
51   -
  51 + //图文标签
  52 + String contentTag = json.getString("content_tag");
  53 + String newContentTag = StringUtils.isEmpty(contentTag) ? "content" : contentTag;
52 54 //获取审核类型
53   - Integer shenheType = contentService.getShenheType(json.getInteger("spId"), "content");
  55 + Integer shenheType = contentService.getShenheType(json.getInteger("spId"), newContentTag);
54 56 List<ShyContent> contentList = contentService.findshyContent(shyContent);
55 57 //存在则更新
56 58 if (contentList.size() > 0) {
... ... @@ -86,8 +88,7 @@ public class ContentControllerApi {
86 88 //spid
87 89 shyContent1.setSp_id(json.getInteger("spId"));
88 90 //图文标签
89   - String contentTag = json.getString("content_tag");
90   - shyContent1.setContent_tag(StringUtils.isEmpty(contentTag) ? "content" : contentTag);
  91 + shyContent1.setContent_tag(newContentTag);
91 92 //领取状态
92 93 shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE);
93 94 //最后一次更新时间
... ... @@ -100,7 +101,7 @@ public class ContentControllerApi {
100 101 return new ResponseBean(ErrorEnum.ERROR);
101 102 }
102 103 }
103   - return saveContent(json, shyContent, shenheType);
  104 + return saveContent(json, shyContent, shenheType, newContentTag);
104 105 }
105 106  
106 107 /**
... ... @@ -111,7 +112,7 @@ public class ContentControllerApi {
111 112 * @param shenheType
112 113 * @return
113 114 */
114   - private ResponseBean saveContent(JSONObject json, ShyContent shyContent, Integer shenheType) {
  115 + private ResponseBean saveContent(JSONObject json, ShyContent shyContent, Integer shenheType, String contentTag) {
115 116 //如果不存在直接插入
116 117 //标题
117 118 shyContent.setTitle(json.getString("title"));
... ... @@ -134,8 +135,7 @@ public class ContentControllerApi {
134 135 shyContent.setContent_time(timestamp);
135 136  
136 137 }
137   - String contentTag = json.getString("content_tag");
138   - shyContent.setContent_tag(StringUtils.isEmpty(contentTag) ? "content" : contentTag);
  138 + shyContent.setContent_tag(contentTag);
139 139  
140 140 shyContent.setCreate_date(CommonUtils.getCurrentTime());
141 141 //回调地址
... ...
src/main/java/com/cnlive/shenhe/job/YiDunUrlResultJob.java
... ... @@ -56,7 +56,7 @@ public class YiDunUrlResultJob {
56 56 /**
57 57 * 定时查询易盾网站检测结果接口
58 58 */
59   - @Scheduled(cron = "0 0/1 * * * ? ")//每分钟一次
  59 + @Scheduled(cron = "0 0/5 * * * ? ")//每5分钟一次
60 60 public void YiDunUrl() {
61 61 try {
62 62 Map<String, String> params = new HashMap<String, String>(5);
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
... ... @@ -357,12 +357,15 @@ public class ContentServiceImpl {
357 357 Integer shenheType = 3;
358 358 //如果当前sp是免审sp
359 359 if (sites.contains(spId)) {
360   - shenheType = 1;//免审
  360 + //免审
  361 + shenheType = 1;
361 362 } else {
362 363 if ("content".equals(ContentTag) || ContentTag.startsWith("cms_") || ContentTag.startsWith("edu_")) {
363   - shenheType = 2;//机审
  364 + //机审
  365 + shenheType = 2;
364 366 } else {
365   - shenheType = 3;//人工审
  367 + //人工审
  368 + shenheType = 3;
366 369 }
367 370 }
368 371 return shenheType;
... ... @@ -375,7 +378,6 @@ public class ContentServiceImpl {
375 378 * @return
376 379 */
377 380 public void contentFilter(ShyContent shyContent) {
378   -// String contentUrl = localhost_url + "/api/content/detail/" + shyContent.getId() + ".html";
379 381 String contentUrl = shyContent.getContent_url();
380 382 logger.info("向易盾网站检测接口提交的url:" + contentUrl);
381 383 //调用易盾网站检测接口
... ...