Skip to content

Commit

Permalink
Merge pull request TeamMajorLink#67 from kimdavid0521/feat#64
Browse files Browse the repository at this point in the history
리뷰 title 수정
  • Loading branch information
kimdavid0521 authored Aug 21, 2024
2 parents 8c53924 + f40b0a8 commit dace6c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class Review extends BaseEntity{
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false, length = 100)
private String title;

@Column(nullable = false, length = 1000)
private String content;
Expand All @@ -41,8 +39,8 @@ public void setLecture(Lecture lecture){
this.lecture = lecture;
}

public void updateReview(String title, String content, int rate){
this.title = title;
public void updateReview(String content, int rate){

this.content = content;
this.rate = rate;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@Getter
public class ReviewRequestDTO {

String title;

String content;
int rate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class ReviewServiceImpl implements ReviewService{
@Override
public Review createReview(UUID userId, Long lectureId, ReviewRequestDTO request) {
Review review = Review.builder()
.title(request.getTitle())
.rate(request.getRate())
.content(request.getContent())
.build();
Expand All @@ -45,7 +44,7 @@ public Review updateReview(UUID userId, Long reviewId, ReviewRequestDTO request)
User user = userRepository.findById(userId).get();
Review review = reviewRepository.findById(reviewId).get();

review.updateReview(request.getTitle(), request.getContent(), request.getRate());
review.updateReview(request.getContent(), request.getRate());

if (!review.getUser().getId().equals(user.getId())){
throw new IllegalArgumentException("Invalid user ID");
Expand Down

0 comments on commit dace6c1

Please sign in to comment.