Commit fefacc4ee997bc2f65259dbae8086f04aefdebb9
Merge remote-tracking branch 'origin/dev' into dev
Showing
3 changed files
with
15 additions
and
13 deletions
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
| @@ -48,9 +48,11 @@ public class ContentControllerApi { | @@ -48,9 +48,11 @@ public class ContentControllerApi { | ||
| 48 | shyContent.setContent_id(contentId); | 48 | shyContent.setContent_id(contentId); |
| 49 | //图文标签 | 49 | //图文标签 |
| 50 | shyContent.setContent_tag("content"); | 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 | List<ShyContent> contentList = contentService.findshyContent(shyContent); | 56 | List<ShyContent> contentList = contentService.findshyContent(shyContent); |
| 55 | //存在则更新 | 57 | //存在则更新 |
| 56 | if (contentList.size() > 0) { | 58 | if (contentList.size() > 0) { |
| @@ -86,8 +88,7 @@ public class ContentControllerApi { | @@ -86,8 +88,7 @@ public class ContentControllerApi { | ||
| 86 | //spid | 88 | //spid |
| 87 | shyContent1.setSp_id(json.getInteger("spId")); | 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 | shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE); | 93 | shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE); |
| 93 | //最后一次更新时间 | 94 | //最后一次更新时间 |
| @@ -100,7 +101,7 @@ public class ContentControllerApi { | @@ -100,7 +101,7 @@ public class ContentControllerApi { | ||
| 100 | return new ResponseBean(ErrorEnum.ERROR); | 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,7 +112,7 @@ public class ContentControllerApi { | ||
| 111 | * @param shenheType | 112 | * @param shenheType |
| 112 | * @return | 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 | shyContent.setTitle(json.getString("title")); | 118 | shyContent.setTitle(json.getString("title")); |
| @@ -134,8 +135,7 @@ public class ContentControllerApi { | @@ -134,8 +135,7 @@ public class ContentControllerApi { | ||
| 134 | shyContent.setContent_time(timestamp); | 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 | shyContent.setCreate_date(CommonUtils.getCurrentTime()); | 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,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 | public void YiDunUrl() { | 60 | public void YiDunUrl() { |
| 61 | try { | 61 | try { |
| 62 | Map<String, String> params = new HashMap<String, String>(5); | 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,12 +357,15 @@ public class ContentServiceImpl { | ||
| 357 | Integer shenheType = 3; | 357 | Integer shenheType = 3; |
| 358 | //如果当前sp是免审sp | 358 | //如果当前sp是免审sp |
| 359 | if (sites.contains(spId)) { | 359 | if (sites.contains(spId)) { |
| 360 | - shenheType = 1;//免审 | 360 | + //免审 |
| 361 | + shenheType = 1; | ||
| 361 | } else { | 362 | } else { |
| 362 | if ("content".equals(ContentTag) || ContentTag.startsWith("cms_") || ContentTag.startsWith("edu_")) { | 363 | if ("content".equals(ContentTag) || ContentTag.startsWith("cms_") || ContentTag.startsWith("edu_")) { |
| 363 | - shenheType = 2;//机审 | 364 | + //机审 |
| 365 | + shenheType = 2; | ||
| 364 | } else { | 366 | } else { |
| 365 | - shenheType = 3;//人工审 | 367 | + //人工审 |
| 368 | + shenheType = 3; | ||
| 366 | } | 369 | } |
| 367 | } | 370 | } |
| 368 | return shenheType; | 371 | return shenheType; |
| @@ -375,7 +378,6 @@ public class ContentServiceImpl { | @@ -375,7 +378,6 @@ public class ContentServiceImpl { | ||
| 375 | * @return | 378 | * @return |
| 376 | */ | 379 | */ |
| 377 | public void contentFilter(ShyContent shyContent) { | 380 | public void contentFilter(ShyContent shyContent) { |
| 378 | -// String contentUrl = localhost_url + "/api/content/detail/" + shyContent.getId() + ".html"; | ||
| 379 | String contentUrl = shyContent.getContent_url(); | 381 | String contentUrl = shyContent.getContent_url(); |
| 380 | logger.info("向易盾网站检测接口提交的url:" + contentUrl); | 382 | logger.info("向易盾网站检测接口提交的url:" + contentUrl); |
| 381 | //调用易盾网站检测接口 | 383 | //调用易盾网站检测接口 |