From f40b0a8bd970fae219faa7c464f41fec9aae08c7 Mon Sep 17 00:00:00 2001 From: kimtaeyoung <62414583+kimtaeyoung201910794@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:35:00 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20title=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/example/majorLink/domain/Review.java | 6 ++---- .../com/example/majorLink/dto/request/ReviewRequestDTO.java | 2 +- .../majorLink/service/ReviewService/ReviewServiceImpl.java | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/majorLink/src/main/java/com/example/majorLink/domain/Review.java b/majorLink/src/main/java/com/example/majorLink/domain/Review.java index c7698bb..5f1f5c2 100644 --- a/majorLink/src/main/java/com/example/majorLink/domain/Review.java +++ b/majorLink/src/main/java/com/example/majorLink/domain/Review.java @@ -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; @@ -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; } diff --git a/majorLink/src/main/java/com/example/majorLink/dto/request/ReviewRequestDTO.java b/majorLink/src/main/java/com/example/majorLink/dto/request/ReviewRequestDTO.java index 20625e6..ee42b18 100644 --- a/majorLink/src/main/java/com/example/majorLink/dto/request/ReviewRequestDTO.java +++ b/majorLink/src/main/java/com/example/majorLink/dto/request/ReviewRequestDTO.java @@ -5,7 +5,7 @@ @Getter public class ReviewRequestDTO { - String title; + String content; int rate; } diff --git a/majorLink/src/main/java/com/example/majorLink/service/ReviewService/ReviewServiceImpl.java b/majorLink/src/main/java/com/example/majorLink/service/ReviewService/ReviewServiceImpl.java index c8c8bbd..caeb78d 100644 --- a/majorLink/src/main/java/com/example/majorLink/service/ReviewService/ReviewServiceImpl.java +++ b/majorLink/src/main/java/com/example/majorLink/service/ReviewService/ReviewServiceImpl.java @@ -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(); @@ -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");