Commit 3a855389 by 吴迪

【修改】点击区间时间范围

parent 19d9f89e
......@@ -74,17 +74,9 @@ public class GLNOutController {
vo.setGtin("0" + vo.getGtin());
}
//使用redis缓存,做一次接口校验,
String verified = redisUtils.get("verified");
if (StringUtils.isNotBlank(verified)) {
return R.error("当前访问人数过多!请换个时间尝试");
} else{
redisUtils.set("verified", "1",1/2);
if(!checkLimit()) {
return R.error("当前查询人数太多,请稍后再试");
}
SearchgtinlogEntity searchgtinlogEntity = new SearchgtinlogEntity();
searchgtinlogEntity.setCreatedate(new Date());
searchgtinlogEntity.setIp(IPUtils.getIpAddr(request));
......@@ -146,6 +138,20 @@ public class GLNOutController {
return R.ok().put("data", objects);
}
public synchronized boolean checkLimit() {
String verified = redisUtils.get("verified");
if (StringUtils.isNotBlank(verified)) {
return false;
} else{
redisUtils.set("verified", "1",1/2);
}
return true;
}
//使用redis缓存,做一次接口校验,
/**
* 境外条码查询--验证其他GS1标识
* 通过其他key查询企业信息
......
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