ip 请求次数限制22
This commit is contained in:
parent
e68ff1a9a9
commit
5848373764
|
|
@ -13,5 +13,5 @@ import java.lang.annotation.Target;
|
|||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Limiting {
|
||||
// 默认每秒放入桶中的token
|
||||
double limitNum() default 5;
|
||||
double limitNum() default 10;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public class DiscSpinningController {
|
|||
@ApiImplicitParam(name = "source", value = "1 普通转盘 2 周任务转盘 3 月任务转盘", dataTypeClass = Integer.class),
|
||||
})
|
||||
@ApiOperation("查询大转盘")
|
||||
@Debounce(interval = 3000, value = "#userId")
|
||||
// @Debounce(interval = 3000, value = "#userId")
|
||||
public Result appDiscSpinning(@RequestParam(required = false, defaultValue = "1") Integer source) {
|
||||
PageHelper.startPage(1, 20);
|
||||
List<DiscSpinning> list = discSpinningService.list(
|
||||
|
|
@ -164,8 +164,8 @@ public class DiscSpinningController {
|
|||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "{\"sum\":\"总抽奖次数\",\"count\":\"剩余抽奖次数\"}"),
|
||||
})
|
||||
@Debounce(value = "#userId")
|
||||
@Limiting
|
||||
// @Debounce(value = "#userId")
|
||||
// @Limiting
|
||||
public Result drawCount(@ApiIgnore @RequestAttribute("userId") Long userId, @RequestParam(required = false, defaultValue = "1") Integer source) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
int drawCount = Integer.parseInt(commonRepository.findOne(901).getValue());
|
||||
|
|
@ -203,8 +203,8 @@ public class DiscSpinningController {
|
|||
@ApiImplicitParam(name = "source", value = "1 普通转盘 2 周任务转盘 3 月任务转盘", dataTypeClass = Integer.class),
|
||||
})
|
||||
@ApiOperation("抽取大转盘")
|
||||
@Debounce(value = "#userId")
|
||||
@Limiting
|
||||
// @Debounce(value = "#userId")
|
||||
// @Limiting
|
||||
public Result draw(@ApiIgnore @RequestAttribute("userId") Long userId, @RequestParam(required = false, defaultValue = "1") Integer source) throws CzgException {
|
||||
String lockKey = StrUtil.format("user:disc-spinning:limit:user:lock:{}", userId);
|
||||
if (redisUtils.hasKey(lockKey)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue