完善文档

This commit is contained in:
click33 2022-09-23 18:31:59 +08:00
parent 7b65b0fc54
commit b82fdfad56

View File

@ -75,6 +75,21 @@ StpUtil.untieDisable(10001);
``` java ``` java
// 封禁指定用户评论能力,期限为 1天 // 封禁指定用户评论能力,期限为 1天
StpUtil.disable(10001, "comment", 86400); StpUtil.disable(10001, "comment", 86400);
```
参数释义:
- 参数1要封禁的账号id。
- 参数2针对这个账号要封禁的服务标识可以是任意的自定义字符串
- 参数3要封禁的时间单位此为 86400秒 = 1天此值为 -1 时,代表永久封禁)。
分类封禁模块所有可用API
``` java
/*
* 以下示例中:"comment"=评论服务标识、"place-order"=下单服务标识、"open-shop"=开店服务标识
*/
// 封禁指定用户评论能力,期限为 1天
StpUtil.disable(10001, "comment", 86400);
// 在评论接口,校验一下,会抛出异常:`DisableServiceException`,使用 e.getService() 可获取业务标识 `comment` // 在评论接口,校验一下,会抛出异常:`DisableServiceException`,使用 e.getService() 可获取业务标识 `comment`
StpUtil.checkDisable(10001, "comment"); StpUtil.checkDisable(10001, "comment");