Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(readme): 📃 修复README中回调 通知代码的返回不对的问题 #301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,16 @@ try {
} catch (ValidationException e) {
// 签名验证失败,返回 401 UNAUTHORIZED 状态码
logger.error("sign verification failed", e);
return ResponseEntity.status(HttpStatus.UNAUTHORIZED);
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
}

// 如果处理失败,应返回 4xx/5xx 的状态码,例如 500 INTERNAL_SERVER_ERROR
if (/* process error */) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
}

// 处理成功,返回 200 OK 状态码
return ResponseEntity.status(HttpStatus.OK);
return ResponseEntity.status(HttpStatus.OK).build();
```

常用的通知回调调对象类型有:
Expand Down