Skip to content

Commit

Permalink
Merge pull request #38 from HanaFun/feat/category
Browse files Browse the repository at this point in the history
Feat/category
  • Loading branch information
yubin-im authored Jul 2, 2024
2 parents 376572b + 78260af commit c573b69
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ tasks.named('test') {

bootJar {
duplicatesStrategy = 'exclude'
}
}

jar { enabled = false }
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.hanaro.hanafun.lessondate.service.LessonDateService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

Expand All @@ -27,8 +28,8 @@ public class LessonController {

// 개설 클래스 관리- 개설 클래스 목록 출력
@GetMapping("/reservation/my/opened")
public ResponseEntity<ApiResponse> openedLessons(@RequestBody OpenedLessonsReqDto openedLessonsReqDto) {
List<OpenedLessonsResDto> openedLessons = lessonService.openedLessons(openedLessonsReqDto);
public ResponseEntity<ApiResponse> openedLessons(@AuthenticationPrincipal Long userId) {
List<OpenedLessonsResDto> openedLessons = lessonService.openedLessons(userId);
return ResponseEntity.ok(new ApiResponse<>(true, "ok", openedLessons));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public interface LessonService {
// 개설 클래스 관리- 개설 클래스 목록 출력
List<OpenedLessonsResDto> openedLessons(OpenedLessonsReqDto openedLessonsReqDto);
List<OpenedLessonsResDto> openedLessons(Long userId);

// 클래스 상세보기
LessonInfoResDto lessonInfo(Long lessonId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public class LessonServiceImpl implements LessonService {
// 개설 클래스 관리- 개설 클래스 목록 출력
@Transactional
@Override
public List<OpenedLessonsResDto> openedLessons(OpenedLessonsReqDto openedLessonsReqDto) {
HostEntity host = hostRepository.findHostEntityByUserEntity_UserId(openedLessonsReqDto.getUserId());
public List<OpenedLessonsResDto> openedLessons(Long userId) {
HostEntity host = hostRepository.findHostEntityByUserEntity_UserId(userId);
List<LessonEntity> lessons = lessonRepository.findLessonEntitiesByHostEntity(host);

List<OpenedLessonsResDto> openedLessons = lessons.stream()
Expand Down

0 comments on commit c573b69

Please sign in to comment.