Spring 5.0 By Example
上QQ阅读APP看书,第一时间看更新

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.