最终的使用实例#
============
1、根据接口收到 PathVariable 参数判断唯一
Copy/**
-
根据请求参数里的 PathVariable 里获取的变量进行接口级别防重复点击
-
@param testId 测试id
-
@param requestVo 请求参数
-
@return
-
@author daleyzou
*/
@PostMapping(“/test/{testId}”)
@NoRepeatSubmit(location = “thisIsTestLocation”, seconds = 6)
public RsVo thisIsTestLocation(@PathVariable Integer testId, @RequestBody RequestVo requestVo) throws Throwable {
// 睡眠 5 秒,模拟业务逻辑
Thread.sleep(5);
return RsVo.success(“test is return success”);
}
2、根据接口收到的 RequestBody 中指定变量名的值判断为一
Copy/**
-
根据请求参数里的 RequestBody 里获取指定名称的变量param5的值进行接口级别防重复点击
-
@param testId 测试id
-
@param requestVo 请求参数
-
@return
-
@author daleyzou
*/
@PostMapping(“/test/{testId}”)
@NoRepeatSubmit(location = “thisIsTestBody”, seconds = 6, argIndex = 1, name = “param5”)
public RsVo thisIsTestBody(@PathVariable Integer testId, @RequestBody RequestVo requestVo) throws Throwable {
// 睡眠 5 秒,模拟业务逻辑
Thread.sleep(5);
return RsVo.succ