Commit 8b43006a by 段启岩

拉黑时添加异常捕获

parent a9f7020b
......@@ -139,8 +139,13 @@ public class UserApi {
@PostMapping("/my/blacklist/{userId}")
public Response blacklist(@PathVariable(name = "userId") String userId, @CurrentSubject Subject subject){
userBlacklistService.blacklist(userId, (String) subject.getId());
return Response.success();
try {
userBlacklistService.blacklist(userId, (String) subject.getId());
return Response.success();
} catch (UserServiceException e) {
e.printStackTrace();
return Response.error(e);
}
}
......
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