Skip to content

Commit

Permalink
Merge pull request #57 from AlongTheBlue/develop
Browse files Browse the repository at this point in the history
[Feat] 내 여행따라 전체 게시물 조회 api 구현
  • Loading branch information
MoonInbae authored Oct 14, 2024
2 parents b79f0d9 + d7e62d4 commit 2bd1393
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,10 @@ public List<UserTourCourseDTO> getAllUserTourCourses(){
public ApiResponse<UserTourCourseDetailDto> getUserCourseById(@PathVariable Long id){
return tourCommunityService.getUserCourseByID(id);
}
@Operation(summary = "내 여행따라 전체 게시물 조회 API")
@GetMapping("/my")
public ApiResponse<List<UserTourCourse>> retrieveMyUserTourCourses(@RequestHeader("Authorization") String uid) {
return tourCommunityService.retrieveMyUserTourCourses(uid);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,9 @@ public ApiResponse<UserTourCourseDetailDto> getUserCourseByID(Long id) {
// userCourseDto.setPostItems(postItems);
// return userCourseDto;
}

public ApiResponse<List<UserTourCourse>> retrieveMyUserTourCourses(String uid) {
List<UserTourCourse> userTourCourses = userTourCourseRepository.findByUserInfo_Uid(uid);
return ApiResponse.ok("나의 여행따라 데이터를 성공적으로 조회했습니다.", userTourCourses);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface UserTourCourseRepository extends JpaRepository<UserTourCourse, Long> {


List<UserTourCourse> findByUserInfo_Uid(String uid);
}

0 comments on commit 2bd1393

Please sign in to comment.