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