Commit 0d3b6a39 authored by 万建斌's avatar 万建斌

2019-11-22 优化

parent b74c93fd
...@@ -20,6 +20,8 @@ public class LogEntity { ...@@ -20,6 +20,8 @@ public class LogEntity {
@TableId @TableId
private int id; private int id;
private String name;
private long processTime; private long processTime;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
......
...@@ -67,14 +67,15 @@ public class SearchContrllor { ...@@ -67,14 +67,15 @@ public class SearchContrllor {
panResult.error("查询参数错误"); panResult.error("查询参数错误");
panResult.setRespCode(1012); panResult.setRespCode(1012);
} }
insertLog(before); insertLog(before, "/v1/queryById");
return panResult; return panResult;
} }
private void insertLog(long before) { private void insertLog(long before, String name) {
long after = new Date().getTime(); long after = new Date().getTime();
long processing = after - before; long processing = after - before;
LogEntity logEntity = new LogEntity(); LogEntity logEntity = new LogEntity();
logEntity.setName(name);
logEntity.setProcessTime(processing); logEntity.setProcessTime(processing);
logEntity.setCreateTime(new Date()); logEntity.setCreateTime(new Date());
logService.save(logEntity); logService.save(logEntity);
...@@ -100,7 +101,7 @@ public class SearchContrllor { ...@@ -100,7 +101,7 @@ public class SearchContrllor {
Map<String, Object> resMap = new HashMap<>(); Map<String, Object> resMap = new HashMap<>();
resMap.put("result", parseResult(result)); resMap.put("result", parseResult(result));
panResult.setRespData(resMap); panResult.setRespData(resMap);
insertLog(before); insertLog(before, "/v1/queryArticleInfo");
return panResult; return panResult;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment