public Object cycle(){

private Map<String, Long> userTicks = new HashMap<String, Long>();

String memberId = member.getId();

if (userTicks.containsKey(memberId)) {
Long tick = userTicks.get(memberId);
if (System.currentTimeMillis() - tick < 1 * 1000) {
return new APIResult(GlobalConstantsUtil.GENERAL_ERROR, "请勿频繁操作");
}
}

/**

*代码逻辑

*

/

userTicks.put(memberId, System.currentTimeMillis());

return APIResult.createSuccess();

}

posted on 2019-01-10 23:14  qqzhulu  阅读(320)  评论(0编辑  收藏  举报