From 83c4172c6216fa7f592a88f5b78739ee70adde90 Mon Sep 17 00:00:00 2001 From: kgc9007 Date: Thu, 18 Jul 2024 15:03:16 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20conflict=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lecture/controller/LectureController.java | 6 +++--- ...ectureCreateRequest.java => LectureRegist.java} | 2 +- .../edufocus/lecture/service/LectureService.java | 4 ++-- .../lecture/service/LectureServiceImpl.java | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) rename backend/src/main/java/com/edufocus/edufocus/lecture/entity/{LectureCreateRequest.java => LectureRegist.java} (92%) diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/controller/LectureController.java b/backend/src/main/java/com/edufocus/edufocus/lecture/controller/LectureController.java index fd8471c..8cc015c 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/controller/LectureController.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/controller/LectureController.java @@ -1,7 +1,7 @@ package com.edufocus.edufocus.lecture.controller; import com.edufocus.edufocus.lecture.entity.Lecture; -import com.edufocus.edufocus.lecture.entity.LectureCreateRequest; +import com.edufocus.edufocus.lecture.entity.LectureRegist; import com.edufocus.edufocus.lecture.service.LectureService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -20,8 +20,8 @@ public class LectureController { private final LectureService lectureService; @PostMapping - public ResponseEntity createLecture (@RequestBody long userId, @RequestBody LectureCreateRequest lectureCreateRequest) { - lectureService.createLecture(userId, lectureCreateRequest); + public ResponseEntity createLecture (@RequestBody long userId, @RequestBody LectureRegist lectureRegist) { + lectureService.createLecture(userId, lectureRegist); return new ResponseEntity<>(HttpStatus.CREATED); } diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureCreateRequest.java b/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureRegist.java similarity index 92% rename from backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureCreateRequest.java rename to backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureRegist.java index 7ce8bfb..24790e3 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureCreateRequest.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureRegist.java @@ -10,7 +10,7 @@ import java.util.Date; @Getter @NoArgsConstructor @AllArgsConstructor -public class LectureCreateRequest { +public class LectureRegist { private String title; diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureService.java b/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureService.java index cfd87e6..2731e5a 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureService.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureService.java @@ -1,7 +1,7 @@ package com.edufocus.edufocus.lecture.service; import com.edufocus.edufocus.lecture.entity.Lecture; -import com.edufocus.edufocus.lecture.entity.LectureCreateRequest; +import com.edufocus.edufocus.lecture.entity.LectureRegist; import org.springframework.stereotype.Service; import java.util.List; @@ -10,7 +10,7 @@ import java.util.List; @Service public interface LectureService { - void createLecture(long userId, LectureCreateRequest lectureCreateRequest); + void createLecture(long userId, LectureRegist lectureRegist); boolean deleteLecture(long userId, long LectureId); diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java b/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java index 79b7093..4f120d8 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java @@ -1,7 +1,7 @@ package com.edufocus.edufocus.lecture.service; import com.edufocus.edufocus.lecture.entity.Lecture; -import com.edufocus.edufocus.lecture.entity.LectureCreateRequest; +import com.edufocus.edufocus.lecture.entity.LectureRegist; import com.edufocus.edufocus.lecture.repository.LectureRepository; import com.edufocus.edufocus.user.model.entity.User; import com.edufocus.edufocus.user.model.repository.UserRepository; @@ -21,18 +21,18 @@ public class LectureServiceImpl implements LectureService { private final UserRepository userRepository; @Override - public void createLecture(long userId, LectureCreateRequest lectureCreateRequest) { + public void createLecture(long userId, LectureRegist lectureRegist) { User user = userRepository.findById(userId).get(); Lecture lecture = new Lecture(); lecture.setUser(user); - lecture.setTitle(lectureCreateRequest.getTitle()); - lecture.setDescription(lectureCreateRequest.getDescription()); - lecture.setStartDate(lectureCreateRequest.getStartDate()); - lecture.setEndDate(lectureCreateRequest.getEndDate()); - lecture.setPlan(lectureCreateRequest.getPlan()); + lecture.setTitle(lectureRegist.getTitle()); + lecture.setDescription(lectureRegist.getDescription()); + lecture.setStartDate(lectureRegist.getStartDate()); + lecture.setEndDate(lectureRegist.getEndDate()); + lecture.setPlan(lectureRegist.getPlan()); lectureRepository.save(lecture); }