- Spring 5.0 By Example
- Claudio Eduardo de Oliveira
- 68字
- 2021-06-24 19:17:35
Adding a new review
For this feature, we need to create a method in our News class, the method will return a Review and should look like this:
public Review review(String userId,String status){
final Review review = new Review(userId, status);
this.reviewers.add(review);
return review;
}
We do not need to check if the user, who performs the review action, is a mandatory reviewer at all.
推薦閱讀