Commit 2a160fd47eec1d761120515b9336f84501698377
1 parent
57d74a23
添加日志 查找图文入库慢的时间
Showing
1 changed file
with
5 additions
and
0 deletions
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
| @@ -57,6 +57,7 @@ public class ContentControllerApi { | @@ -57,6 +57,7 @@ public class ContentControllerApi { | ||
| 57 | //获取审核类型 | 57 | //获取审核类型 |
| 58 | Integer shenheType = contentService.getShenheType(json.getInteger("spId"), newContentTag); | 58 | Integer shenheType = contentService.getShenheType(json.getInteger("spId"), newContentTag); |
| 59 | List<ShyContent> contentList = contentService.findShyContent(shyContent); | 59 | List<ShyContent> contentList = contentService.findShyContent(shyContent); |
| 60 | + logger.info("条件判断之前"); | ||
| 60 | if (contentList.size() > 0) { | 61 | if (contentList.size() > 0) { |
| 61 | ShyContent shyContent1 = contentList.get(0); | 62 | ShyContent shyContent1 = contentList.get(0); |
| 62 | // 图文存在则更新 | 63 | // 图文存在则更新 |
| @@ -67,6 +68,7 @@ public class ContentControllerApi { | @@ -67,6 +68,7 @@ public class ContentControllerApi { | ||
| 67 | yorN = saveOrUpdateContent(json, shyContent, shenheType); | 68 | yorN = saveOrUpdateContent(json, shyContent, shenheType); |
| 68 | logger.info("图文同步接口保存操作:{}", contentId); | 69 | logger.info("图文同步接口保存操作:{}", contentId); |
| 69 | } | 70 | } |
| 71 | + logger.info("条件判断之后"); | ||
| 70 | if (yorN) { | 72 | if (yorN) { |
| 71 | return new ResponseBean(ErrorEnum.SUCCESS); | 73 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 72 | } else { | 74 | } else { |
| @@ -84,6 +86,7 @@ public class ContentControllerApi { | @@ -84,6 +86,7 @@ public class ContentControllerApi { | ||
| 84 | * @return | 86 | * @return |
| 85 | */ | 87 | */ |
| 86 | private boolean saveOrUpdateContent(JSONObject json, ShyContent shyContent, Integer shenheType) { | 88 | private boolean saveOrUpdateContent(JSONObject json, ShyContent shyContent, Integer shenheType) { |
| 89 | + logger.info("方法执行之前"); | ||
| 87 | //如果不存在直接插入 | 90 | //如果不存在直接插入 |
| 88 | //标题 | 91 | //标题 |
| 89 | shyContent.setTitle(json.getString("title")); | 92 | shyContent.setTitle(json.getString("title")); |
| @@ -115,9 +118,11 @@ public class ContentControllerApi { | @@ -115,9 +118,11 @@ public class ContentControllerApi { | ||
| 115 | //最后一次更新时间 | 118 | //最后一次更新时间 |
| 116 | shyContent.setLast_update(CommonUtils.getCurrentTime()); | 119 | shyContent.setLast_update(CommonUtils.getCurrentTime()); |
| 117 | if (shyContent.getId() == null) { | 120 | if (shyContent.getId() == null) { |
| 121 | + logger.info("图文插入"); | ||
| 118 | //id 存在就插入 | 122 | //id 存在就插入 |
| 119 | return contentService.impotContent(shyContent); | 123 | return contentService.impotContent(shyContent); |
| 120 | } else { | 124 | } else { |
| 125 | + logger.info("图文修改"); | ||
| 121 | // id不存在就修改 | 126 | // id不存在就修改 |
| 122 | return contentService.updateShyContent(shyContent); | 127 | return contentService.updateShyContent(shyContent); |
| 123 | } | 128 | } |