Repository navigation
feat: 매거진, 투데이 2차 api 구현 #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8cb8f77
fix: 탈퇴 정리의 죽은 BookmarkCategory 참조 제거
yxpjseo 1ce073a
feat: add configuration for Tour API integration and update RestClien…
yxpjseo f73b21f
feat: KorService2 API 클라이언트 구현
yxpjseo 172bdcb
feat: 매거진 조회 + 장소 저장 API
yxpjseo 016d3cc
refactor: 저장 목록 조회·오늘의 코스 API 임시 X-User-Id 헤더를 JWT 인증으로 교체
yxpjseo 0344bfe
refactor: 오늘의 코스 요청/응답 DTO 이름 변경 (CourseReqDTO/ResDTO → TodayCourseRe…
yxpjseo 7b2e47f
feat: 투데이 코스 장소 추가·순서 변경 API 구현
yxpjseo 0ae1b3f
test: CourseServiceTest 생성자 인자·TodayCourseControllerTest 인증 stub 보정
yxpjseo 3fa3bd4
docs: 장소·매거진 API Swagger @Tag/@Operation 요약 추가
yxpjseo 9faf8d2
fix: 코스 장소·북마크 동시성 처리 및 관광 API 클라이언트 안정성 보완
yxpjseo 6229a8d
Merge branch 'develop' into 36/feature/place-course
yxpjseo 2c76d9a
Merge branch 'develop' into 36/feature/place-course
yxpjseo 02040ea
fix: 코스 장소 오류 코드 메시지 수정
yxpjseo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ NAVER_CLIENT_ID= | |
| NAVER_CLIENT_SECRET= | ||
| AWS_S3_BUCKET= | ||
| AWS_REGION= | ||
| TOUR_SERVICE_KEY= | ||
48 changes: 37 additions & 11 deletions
48
src/main/java/com/daytodo/domain/course/controller/TodayCourseController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,72 @@ | ||
| package com.daytodo.domain.course.controller; | ||
|
|
||
| import com.daytodo.domain.course.dto.request.CourseReqDTO; | ||
| import com.daytodo.domain.course.dto.response.CourseResDTO; | ||
| import com.daytodo.domain.course.dto.request.TodayCourseRequest; | ||
| import com.daytodo.domain.course.dto.response.TodayCourseResponse; | ||
| import com.daytodo.domain.course.service.TodayCourseService; | ||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PatchMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import org.springframework.web.bind.annotation.RequestHeader; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @Tag(name = "Today Course") | ||
| @RestController | ||
| @RequiredArgsConstructor | ||
| @RequestMapping("/courses") | ||
| public class TodayCourseController { | ||
|
|
||
| private final TodayCourseService todayCourseService; | ||
|
|
||
| // TODO: JWT 인증 적용 후 @AuthenticationPrincipal 로 교체 | ||
| @Operation(summary = "투데이 코스 조회") | ||
| @GetMapping("/today") | ||
| public CourseResDTO.GetTodayCourse getTodayCourse( | ||
| @RequestHeader("X-User-Id") Long userId | ||
| public TodayCourseResponse.GetTodayCourse getTodayCourse( | ||
| @AuthenticationPrincipal Long userId | ||
| ) { | ||
| return todayCourseService.getTodayCourse(userId); | ||
| } | ||
|
|
||
| @Operation(summary = "투데이 코스 종료") | ||
| @PostMapping("/{courseId}/complete") | ||
| public CourseResDTO.CompleteCourse completeCourse( | ||
| @RequestHeader("X-User-Id") Long userId, | ||
| public TodayCourseResponse.CompleteCourse completeCourse( | ||
| @AuthenticationPrincipal Long userId, | ||
| @PathVariable Long courseId | ||
| ) { | ||
| return todayCourseService.completeCourse(userId, courseId); | ||
| } | ||
|
|
||
| @Operation(summary = "투데이 추억 사진 저장") | ||
| @PostMapping("/{courseId}/photos") | ||
| public CourseResDTO.SaveMemoryPhotos saveMemoryPhotos( | ||
| @RequestHeader("X-User-Id") Long userId, | ||
| public TodayCourseResponse.SaveMemoryPhotos saveMemoryPhotos( | ||
| @AuthenticationPrincipal Long userId, | ||
| @PathVariable Long courseId, | ||
| @RequestBody CourseReqDTO.SaveMemoryPhotos request | ||
| @RequestBody TodayCourseRequest.SaveMemoryPhotos request | ||
| ) { | ||
| return todayCourseService.saveMemoryPhotos(userId, courseId, request); | ||
| } | ||
|
|
||
| @Operation(summary = "투데이 장소 추가") | ||
| @PostMapping("/{courseId}/today-places") | ||
| public TodayCourseResponse.GetCoursePlaces addPlaceToCourse( | ||
| @AuthenticationPrincipal Long userId, | ||
| @PathVariable Long courseId, | ||
| @RequestBody TodayCourseRequest.AddPlace request | ||
| ) { | ||
| return todayCourseService.addPlaceToCourse(userId, courseId, request); | ||
| } | ||
|
|
||
| @Operation(summary = "투데이 장소 순서 변경") | ||
| @PatchMapping("/{courseId}/today-places/order") | ||
| public TodayCourseResponse.GetCoursePlaces reorderCoursePlaces( | ||
| @AuthenticationPrincipal Long userId, | ||
| @PathVariable Long courseId, | ||
| @RequestBody TodayCourseRequest.ReorderCoursePlaces request | ||
| ) { | ||
| return todayCourseService.reorderCoursePlaces(userId, courseId, request); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
src/main/java/com/daytodo/domain/course/dto/request/CourseReqDTO.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/main/java/com/daytodo/domain/course/dto/request/TodayCourseRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package com.daytodo.domain.course.dto.request; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class TodayCourseRequest { | ||
|
|
||
| /* | ||
| * 추억 사진 저장 | ||
| * 빈 목록/공백 URL 검증은 서비스에서 수행한다. | ||
| * (명세가 요구하는 INVALID_PARAMETER 코드로 응답하기 위해 Bean Validation 을 쓰지 않음) | ||
| */ | ||
| public record SaveMemoryPhotos( | ||
| List<String> imageUrls | ||
| ){} | ||
|
|
||
| // 코스 장소 추가 : placeId 로 직접 추가. null 검증은 서비스에서 (INVALID_PARAMETER 코드 유지) | ||
| public record AddPlace( | ||
| Long placeId | ||
| ){} | ||
|
|
||
| // 코스 장소 순서 변경 : 배열 순서대로 placeOrder 갱신. 검증은 서비스에서 | ||
| public record ReorderCoursePlaces( | ||
| List<Long> orderedCoursePlaceIds | ||
| ){} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.