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

2019-11-22 优化

parent b74c93fd
......@@ -20,6 +20,8 @@ public class LogEntity {
@TableId
private int id;
private String name;
private long processTime;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
......
......@@ -67,14 +67,15 @@ public class SearchContrllor {
panResult.error("查询参数错误");
panResult.setRespCode(1012);
}
insertLog(before);
insertLog(before, "/v1/queryById");
return panResult;
}
private void insertLog(long before) {
private void insertLog(long before, String name) {
long after = new Date().getTime();
long processing = after - before;
LogEntity logEntity = new LogEntity();
logEntity.setName(name);
logEntity.setProcessTime(processing);
logEntity.setCreateTime(new Date());
logService.save(logEntity);
......@@ -100,7 +101,7 @@ public class SearchContrllor {
Map<String, Object> resMap = new HashMap<>();
resMap.put("result", parseResult(result));
panResult.setRespData(resMap);
insertLog(before);
insertLog(before, "/v1/queryArticleInfo");
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