diff --git a/backend/support/domain/src/main/java/kr/co/yigil/travel/infrastructure/CourseRepository.java b/backend/support/domain/src/main/java/kr/co/yigil/travel/infrastructure/CourseRepository.java index edc0d255b..3993ab062 100644 --- a/backend/support/domain/src/main/java/kr/co/yigil/travel/infrastructure/CourseRepository.java +++ b/backend/support/domain/src/main/java/kr/co/yigil/travel/infrastructure/CourseRepository.java @@ -30,5 +30,5 @@ public interface CourseRepository extends JpaRepository { Slice findByPlaceNameContaining(@Param("keyword") String keyword, Pageable pageable); @Query("SELECT c FROM Course c inner JOIN Favor f ON c.id = f.travel.id WHERE c.isDeleted = false AND f.member.id = :memberId") - Page findAllMembersFavoriteCourses(Long memberId, Pageable pageRequest); + Slice findAllMembersFavoriteCourses(Long memberId, Pageable pageRequest); } \ No newline at end of file diff --git a/backend/support/domain/src/main/java/kr/co/yigil/travel/infrastructure/SpotRepository.java b/backend/support/domain/src/main/java/kr/co/yigil/travel/infrastructure/SpotRepository.java index 011776aff..230f87ddb 100644 --- a/backend/support/domain/src/main/java/kr/co/yigil/travel/infrastructure/SpotRepository.java +++ b/backend/support/domain/src/main/java/kr/co/yigil/travel/infrastructure/SpotRepository.java @@ -53,5 +53,5 @@ public interface SpotRepository extends JpaRepository { List findPlaceIdByMemberId(Long memberId); @Query("SELECT s FROM Spot s INNER JOIN Favor f ON s.id = f.travel.id WHERE s.isDeleted = false AND f.member.id = :memberId") - Page findAllMembersFavoriteSpot(Long memberId, Pageable pageRequest); + Slice findAllMembersFavoriteSpot(Long memberId, Pageable pageRequest); } \ No newline at end of file diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseInfo.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseInfo.java index 7a3b1e01a..35cfabf22 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseInfo.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseInfo.java @@ -232,7 +232,12 @@ public PointInfo(Point point) { @Data public static class MyFavoriteCoursesInfo { private final List contents; - private final int totalPages; + private final boolean hasNext; + + public MyFavoriteCoursesInfo(List contents, boolean hasNext) { + this.contents = contents; + this.hasNext = hasNext; + } } diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseReader.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseReader.java index 72e2d169f..9e00702fa 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseReader.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseReader.java @@ -16,6 +16,6 @@ public interface CourseReader { Slice searchCourseByPlaceName(String keyword, Pageable pageable); - Page getFavoriteCourses(Long memberId, Pageable pageRequest); + Slice getFavoriteCourses(Long memberId, Pageable pageRequest); } diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseServiceImpl.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseServiceImpl.java index 0dce265b0..14efa24ce 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseServiceImpl.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/course/CourseServiceImpl.java @@ -20,6 +20,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Slice; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -128,7 +129,7 @@ public CourseInfo.Slice searchCourseByPlaceName(String keyword, Accessor accesso @Override public CourseInfo.MyFavoriteCoursesInfo getFavoriteCoursesInfo(Long memberId, PageRequest pageRequest) { - Page favoriteCourses = courseReader.getFavoriteCourses(memberId, pageRequest); + Slice favoriteCourses = courseReader.getFavoriteCourses(memberId, pageRequest); List favoriteCourseInfoList = favoriteCourses.getContent().stream() .map(course -> { boolean isFollowing = followReader.isFollowing(memberId, course.getMember().getId()); @@ -136,6 +137,6 @@ public CourseInfo.MyFavoriteCoursesInfo getFavoriteCoursesInfo(Long memberId, Pa } ) .toList(); - return new CourseInfo.MyFavoriteCoursesInfo(favoriteCourseInfoList, favoriteCourses.getTotalPages()); + return new CourseInfo.MyFavoriteCoursesInfo(favoriteCourseInfoList, favoriteCourses.hasNext()); } } diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotInfo.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotInfo.java index 6499e52ab..a2fc9feca 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotInfo.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotInfo.java @@ -129,11 +129,11 @@ public Slice(List
mains, boolean hasNext) { @Getter public static class MyFavoriteSpotsInfo{ private final List contents; - private final int totalPages; + private final boolean hasNext; - public MyFavoriteSpotsInfo(List favoriteSpots, int totalPages){ + public MyFavoriteSpotsInfo(List favoriteSpots, boolean hasNext){ this.contents = favoriteSpots; - this.totalPages = totalPages; + this.hasNext = hasNext; } } diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotReader.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotReader.java index d13eeebc1..3d2e0a998 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotReader.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotReader.java @@ -35,5 +35,5 @@ public interface SpotReader { List getMySpotPlaceIds(Long memberId); - Page getFavoriteSpotList(Long memberId, Pageable pageRequest); + Slice getFavoriteSpotList(Long memberId, Pageable pageRequest); } diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotServiceImpl.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotServiceImpl.java index acf46597c..e11a50388 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotServiceImpl.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/domain/spot/SpotServiceImpl.java @@ -82,7 +82,16 @@ public void registerSpot(RegisterSpotRequest command, Long memberId) { } var attachFiles = spotSeriesFactory.initAttachFiles(command); - Place place = optionalPlace.orElseGet(() -> registerNewPlace(command.getRegisterPlaceRequest(), attachFiles.getFiles().getFirst())); + + Place place = optionalPlace.orElseGet(() -> { + AttachFile placeAttachFile = new AttachFile( + attachFiles.getRepresentativeFile().getFileType(), + attachFiles.getRepresentativeFile().getFileUrl(), + attachFiles.getRepresentativeFile().getOriginalFileName(), + attachFiles.getRepresentativeFile().getFileSize() + ); + return registerNewPlace(command.getRegisterPlaceRequest(), placeAttachFile); + }); placeCacheStore.incrementSpotCountInPlace(place.getId()); placeCacheStore.incrementSpotTotalRateInPlace(place.getId(), command.getRate()); spotStore.store(command.toEntity(member, place, false, attachFiles)); @@ -146,8 +155,8 @@ public CourseInfo.MySpotsInfo getMySpotsDetailInfo(List spotIds, Long memb @Override @Transactional(readOnly = true) public SpotInfo.MyFavoriteSpotsInfo getFavoriteSpotsInfo(Long memberId, Pageable pageRequest) { - var pageSpot = spotReader.getFavoriteSpotList(memberId, pageRequest); - List spotInfoList = pageSpot.getContent().stream() + var sliceSpot = spotReader.getFavoriteSpotList(memberId, pageRequest); + List spotInfoList = sliceSpot.getContent().stream() .map(spot -> { boolean isFollowing = followReader.isFollowing(memberId, spot.getMember().getId()); return new SpotInfo.FavoriteSpotInfo(spot, isFollowing); @@ -155,6 +164,6 @@ public SpotInfo.MyFavoriteSpotsInfo getFavoriteSpotsInfo(Long memberId, Pageable ) .toList(); - return new SpotInfo.MyFavoriteSpotsInfo(spotInfoList, pageSpot.getTotalPages()); + return new SpotInfo.MyFavoriteSpotsInfo(spotInfoList, sliceSpot.hasNext()); } } \ No newline at end of file diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/course/CourseReaderImpl.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/course/CourseReaderImpl.java index 586026129..471dfbdc7 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/course/CourseReaderImpl.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/course/CourseReaderImpl.java @@ -44,7 +44,7 @@ public Slice searchCourseByPlaceName(final String keyword, final Pageabl } @Override - public Page getFavoriteCourses(Long memberId, Pageable pageRequest) { + public Slice getFavoriteCourses(Long memberId, Pageable pageRequest) { return courseRepository.findAllMembersFavoriteCourses(memberId, pageRequest); } } diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/course/CourseSpotSeriesFactoryImpl.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/course/CourseSpotSeriesFactoryImpl.java index 1a45349d3..a4f0599f3 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/course/CourseSpotSeriesFactoryImpl.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/course/CourseSpotSeriesFactoryImpl.java @@ -52,7 +52,15 @@ public List store(RegisterCourseRequest request, Long memberId) { .map(fileUploader::upload) .collect(Collectors.toList())); - Place place = optionalPlace.orElseGet(() -> registerNewPlace(registerPlaceRequest, attachFiles.getFiles().getFirst())); + Place place = optionalPlace.orElseGet(() -> { + AttachFile placeAttachFile = new AttachFile( + attachFiles.getRepresentativeFile().getFileType(), + attachFiles.getRepresentativeFile().getFileUrl(), + attachFiles.getRepresentativeFile().getOriginalFileName(), + attachFiles.getRepresentativeFile().getFileSize() + ); + return registerNewPlace(registerPlaceRequest, placeAttachFile); + }); placeCacheStore.incrementSpotCountInPlace(place.getId()); placeCacheStore.incrementSpotTotalRateInPlace(place.getId(), registerSpotRequest.getRate()); diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/spot/SpotReaderImpl.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/spot/SpotReaderImpl.java index b16733249..118d9c34e 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/spot/SpotReaderImpl.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/infrastructure/spot/SpotReaderImpl.java @@ -96,7 +96,7 @@ public List getMySpotPlaceIds(Long memberId) { } @Override - public Page getFavoriteSpotList(Long memberId, Pageable pageRequest) { + public Slice getFavoriteSpotList(Long memberId, Pageable pageRequest) { return spotRepository.findAllMembersFavoriteSpot(memberId, pageRequest); } } diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/interfaces/dto/response/MyFavoriteCoursesResponse.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/interfaces/dto/response/MyFavoriteCoursesResponse.java index 59fbae684..7008150ed 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/interfaces/dto/response/MyFavoriteCoursesResponse.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/interfaces/dto/response/MyFavoriteCoursesResponse.java @@ -7,7 +7,7 @@ @Data public class MyFavoriteCoursesResponse { List contents; - int totalPages; + boolean hasNext; @Data public static class FavoriteCourseDto { diff --git a/backend/yigil-api/src/main/java/kr/co/yigil/travel/interfaces/dto/response/MyFavoriteSpotsResponse.java b/backend/yigil-api/src/main/java/kr/co/yigil/travel/interfaces/dto/response/MyFavoriteSpotsResponse.java index 0dbe6724c..28fb5801b 100644 --- a/backend/yigil-api/src/main/java/kr/co/yigil/travel/interfaces/dto/response/MyFavoriteSpotsResponse.java +++ b/backend/yigil-api/src/main/java/kr/co/yigil/travel/interfaces/dto/response/MyFavoriteSpotsResponse.java @@ -9,7 +9,7 @@ @Builder public class MyFavoriteSpotsResponse{ private List contents; - private int totalPages; + private boolean hasNext; @Getter @Builder diff --git a/backend/yigil-api/src/main/resources/static/docs/course-api.html b/backend/yigil-api/src/main/resources/static/docs/course-api.html index 5d359f4d5..9196774a2 100644 --- a/backend/yigil-api/src/main/resources/static/docs/course-api.html +++ b/backend/yigil-api/src/main/resources/static/docs/course-api.html @@ -609,7 +609,7 @@
HTTP Response 예시
HTTP/1.1 200 OK
 Content-Type: application/json
-Content-Length: 371
+Content-Length: 370
 
 {
   "courses" : [ {
@@ -619,7 +619,7 @@ 
HTTP Response 예시
"map_static_image_url" : "test", "rate" : 4.5, "spot_count" : 10, - "create_date" : "2024-03-28T11:51:18.315179", + "create_date" : "2024-03-28T16:34:51.54599", "owner_id" : 1, "owner_profile_image_url" : "test", "owner_nickname" : "test", @@ -1103,7 +1103,7 @@
HTTP Response 예시
"rate" : 4.5, "map_static_image_url" : "images/static.png", "description" : "본문", - "created_date" : "2024-03-28T11:51:18.370614", + "created_date" : "2024-03-28T16:34:51.603072", "line_string_json" : "lineStringJson", "spots" : [ { "id" : 1, @@ -1698,7 +1698,7 @@
HTTP Response 예시
HTTP/1.1 200 OK
 Content-Type: application/json
-Content-Length: 323
+Content-Length: 324
 
 {
   "courses" : [ {
@@ -1710,7 +1710,7 @@ 
HTTP Response 예시
"spot_count" : 3, "rate" : 4.5, "liked" : false, - "create_date" : "2024-03-28T11:51:18.25796" + "create_date" : "2024-03-28T16:34:51.487737" } ], "has_next" : false }
@@ -1858,7 +1858,7 @@
Response Body
"rate" : 4.5, "description" : "스팟 본문", "image_urls" : [ "images/spot.jpg", "images/spotted.png" ], - "create_date" : "2024-03-28T11:51:18.28317", + "create_date" : "2024-03-28T16:34:51.514692", "point" : { "x" : 1.0, "y" : 1.0 @@ -1870,7 +1870,7 @@
Response Body
"rate" : 4.5, "description" : "스팟 본문", "image_urls" : [ "images/spot.jpg", "images/spotted.png" ], - "create_date" : "2024-03-28T11:51:18.283472", + "create_date" : "2024-03-28T16:34:51.514976", "point" : { "x" : 2.0, "y" : 2.0 @@ -1886,7 +1886,7 @@
HTTP Response 예시
HTTP/1.1 200 OK
 Content-Type: application/json
-Content-Length: 664
+Content-Length: 665
 
 {
   "spot_details" : [ {
@@ -1896,7 +1896,7 @@ 
HTTP Response 예시
"rate" : 4.5, "description" : "스팟 본문", "image_urls" : [ "images/spot.jpg", "images/spotted.png" ], - "create_date" : "2024-03-28T11:51:18.28317", + "create_date" : "2024-03-28T16:34:51.514692", "point" : { "x" : 1.0, "y" : 1.0 @@ -1908,7 +1908,7 @@
HTTP Response 예시
"rate" : 4.5, "description" : "스팟 본문", "image_urls" : [ "images/spot.jpg", "images/spotted.png" ], - "create_date" : "2024-03-28T11:51:18.283472", + "create_date" : "2024-03-28T16:34:51.514976", "point" : { "x" : 2.0, "y" : 2.0 @@ -2037,9 +2037,9 @@

Response

팔로잉 여부

-

total_pages

-

Number

-

총 페이지 수

+

has_next

+

Boolean

+

다음 페이지가 있는지 여부

@@ -2049,7 +2049,7 @@
HTTP Response 예시
HTTP/1.1 200 OK
 Content-Type: application/json
-Content-Length: 366
+Content-Length: 367
 
 {
   "contents" : [ {
@@ -2057,14 +2057,14 @@ 
HTTP Response 예시
"title" : "test", "rate" : 4.5, "spot_count" : 10, - "created_date" : "2024-03-28T11:51:18.294820", + "created_date" : "2024-03-28T16:34:51.526412", "map_static_image_url" : "images/map.jpg", "writer_id" : 1, "writer_nickname" : "nickname", "writer_profile_image_url" : "images/profile.jpg", "following" : true } ], - "total_pages" : 1 + "has_next" : false }
diff --git a/backend/yigil-api/src/main/resources/static/docs/follow-api.html b/backend/yigil-api/src/main/resources/static/docs/follow-api.html index c2f5f700a..350b6f435 100644 --- a/backend/yigil-api/src/main/resources/static/docs/follow-api.html +++ b/backend/yigil-api/src/main/resources/static/docs/follow-api.html @@ -755,7 +755,7 @@
Path parameter
HTTP Request 예시
-
GET /api/v1/follows/followers?page=1&size=5&sortBy=follower_name&sortOrder=asc HTTP/1.1
+
GET /api/v1/follows/followers?page=1&size=5&sortBy=nickname&sortOrder=asc HTTP/1.1
 Host: spring.restdocs.test
diff --git a/backend/yigil-api/src/main/resources/static/docs/index.html b/backend/yigil-api/src/main/resources/static/docs/index.html index 7c736d800..a80a17e6d 100644 --- a/backend/yigil-api/src/main/resources/static/docs/index.html +++ b/backend/yigil-api/src/main/resources/static/docs/index.html @@ -763,7 +763,7 @@
HTT "owner_profile_image_url" : "images/profile.jpg", "owner_nickname" : "오너 닉네임", "rate" : 4.5, - "create_date" : "2024-03-28T11:51:18.604734", + "create_date" : "2024-03-28T16:34:51.835949", "liked" : true, "following" : false } ], @@ -1651,9 +1651,9 @@

Response

팔로잉 여부

-

total_pages

-

Number

-

총 페이지 수

+

has_next

+

Boolean

+

다음 페이지 존재 여부

@@ -1672,14 +1672,14 @@
@@ -1857,7 +1857,7 @@
HTTP/1.1 200 OK
 Content-Type: application/json
-Content-Length: 371
+Content-Length: 370
 
 {
   "courses" : [ {
@@ -1867,7 +1867,7 @@ 
HTTP/1.1 200 OK
 Content-Type: application/json
-Content-Length: 323
+Content-Length: 324
 
 {
   "courses" : [ {
@@ -2958,7 +2958,7 @@ 
@@ -3106,7 +3106,7 @@
Response Body "rate" : 4.5, "description" : "스팟 본문", "image_urls" : [ "images/spot.jpg", "images/spotted.png" ], - "create_date" : "2024-03-28T11:51:18.28317", + "create_date" : "2024-03-28T16:34:51.514692", "point" : { "x" : 1.0, "y" : 1.0 @@ -3118,7 +3118,7 @@
Response Body "rate" : 4.5, "description" : "스팟 본문", "image_urls" : [ "images/spot.jpg", "images/spotted.png" ], - "create_date" : "2024-03-28T11:51:18.283472", + "create_date" : "2024-03-28T16:34:51.514976", "point" : { "x" : 2.0, "y" : 2.0 @@ -3134,7 +3134,7 @@
HTTP/1.1 200 OK
 Content-Type: application/json
-Content-Length: 664
+Content-Length: 665
 
 {
   "spot_details" : [ {
@@ -3144,7 +3144,7 @@ 
Response

팔로잉 여부

-

total_pages

-

Number

-

총 페이지 수

+

has_next

+

Boolean

+

다음 페이지가 있는지 여부

@@ -3297,7 +3297,7 @@
HTTP/1.1 200 OK
 Content-Type: application/json
-Content-Length: 366
+Content-Length: 367
 
 {
   "contents" : [ {
@@ -3305,14 +3305,14 @@ 
@@ -6285,7 +6285,7 @@
Path para
HTTP Request 예시
-
GET /api/v1/follows/followers?page=1&size=5&sortBy=follower_name&sortOrder=asc HTTP/1.1
+
GET /api/v1/follows/followers?page=1&size=5&sortBy=nickname&sortOrder=asc HTTP/1.1
 Host: spring.restdocs.test
@@ -7765,14 +7765,14 @@

Response Body "id" : 1, "name" : "광고성 글" }, - "created_at" : "2024-03-28T11:51:17.089328" + "created_at" : "2024-03-28T16:34:50.376152" }, { "id" : 2, "report_type" : { "id" : 2, "name" : "욕설" }, - "created_at" : "2024-03-28T11:51:17.089381" + "created_at" : "2024-03-28T16:34:50.376206" } ], "total_page" : 1 }

@@ -7848,14 +7848,14 @@

@@ -7925,7 +7925,7 @@

Response Body "id" : 1, "name" : "광고성 글" }, - "created_at" : "2024-03-28T11:51:17.099040" + "created_at" : "2024-03-28T16:34:50.388787" } @@ -7988,7 +7988,7 @@

diff --git a/backend/yigil-api/src/main/resources/static/docs/report-api.html b/backend/yigil-api/src/main/resources/static/docs/report-api.html index 1496f5fc2..c3eb46f22 100644 --- a/backend/yigil-api/src/main/resources/static/docs/report-api.html +++ b/backend/yigil-api/src/main/resources/static/docs/report-api.html @@ -651,14 +651,14 @@

Response Body

"id" : 1, "name" : "광고성 글" }, - "created_at" : "2024-03-28T11:51:17.089328" + "created_at" : "2024-03-28T16:34:50.376152" }, { "id" : 2, "report_type" : { "id" : 2, "name" : "욕설" }, - "created_at" : "2024-03-28T11:51:17.089381" + "created_at" : "2024-03-28T16:34:50.376206" } ], "total_page" : 1 }
@@ -734,14 +734,14 @@

HTTP Response 예시

"id" : 1, "name" : "광고성 글" }, - "created_at" : "2024-03-28T11:51:17.089328" + "created_at" : "2024-03-28T16:34:50.376152" }, { "id" : 2, "report_type" : { "id" : 2, "name" : "욕설" }, - "created_at" : "2024-03-28T11:51:17.089381" + "created_at" : "2024-03-28T16:34:50.376206" } ], "total_page" : 1 }
@@ -811,7 +811,7 @@

Response Body

"id" : 1, "name" : "광고성 글" }, - "created_at" : "2024-03-28T11:51:17.099040" + "created_at" : "2024-03-28T16:34:50.388787" } @@ -874,7 +874,7 @@

HTTP Response 예시

"id" : 1, "name" : "광고성 글" }, - "created_at" : "2024-03-28T11:51:17.099040" + "created_at" : "2024-03-28T16:34:50.388787" } diff --git a/backend/yigil-api/src/main/resources/static/docs/spot-api.html b/backend/yigil-api/src/main/resources/static/docs/spot-api.html index 92d1da90f..a7c418d3a 100644 --- a/backend/yigil-api/src/main/resources/static/docs/spot-api.html +++ b/backend/yigil-api/src/main/resources/static/docs/spot-api.html @@ -615,7 +615,7 @@
HTTP Response 예시
"owner_profile_image_url" : "images/profile.jpg", "owner_nickname" : "오너 닉네임", "rate" : 4.5, - "create_date" : "2024-03-28T11:51:18.604734", + "create_date" : "2024-03-28T16:34:51.835949", "liked" : true, "following" : false } ], @@ -1503,9 +1503,9 @@

Response

팔로잉 여부

-

total_pages

-

Number

-

총 페이지 수

+

has_next

+

Boolean

+

다음 페이지 존재 여부

@@ -1524,14 +1524,14 @@
HTTP Response 예시
"place_name" : "test course", "rate" : 4.5, "image_url" : "images/map.jpg", - "created_date" : "2024-03-28T11:51:18.591189", + "created_date" : "2024-03-28T16:34:51.820379", "writer_id" : 1, "writer_nickname" : "writer", "writer_profile_image_url" : "images/profile.jpg", "writer_email" : "user1@yigil.co.kr", "following" : false } ], - "total_pages" : 1 + "has_next" : true } diff --git a/backend/yigil-api/src/test/java/kr/co/yigil/follow/interfaces/controller/FollowApiControllerTest.java b/backend/yigil-api/src/test/java/kr/co/yigil/follow/interfaces/controller/FollowApiControllerTest.java index 1c1f81676..7899a2998 100644 --- a/backend/yigil-api/src/test/java/kr/co/yigil/follow/interfaces/controller/FollowApiControllerTest.java +++ b/backend/yigil-api/src/test/java/kr/co/yigil/follow/interfaces/controller/FollowApiControllerTest.java @@ -128,7 +128,7 @@ void WhenGetMyFollowerList_ThenShouldReturnOk() throws Exception { mockMvc.perform(get("/api/v1/follows/followers") .param("page", "1") .param("size", "5") - .param("sortBy", "follower_name") + .param("sortBy", "nickname") .param("sortOrder", "asc") ) .andExpect(status().isOk()) diff --git a/backend/yigil-api/src/test/java/kr/co/yigil/travel/interfaces/controller/CourseApiControllerTest.java b/backend/yigil-api/src/test/java/kr/co/yigil/travel/interfaces/controller/CourseApiControllerTest.java index 6ffd293e5..38049c29f 100644 --- a/backend/yigil-api/src/test/java/kr/co/yigil/travel/interfaces/controller/CourseApiControllerTest.java +++ b/backend/yigil-api/src/test/java/kr/co/yigil/travel/interfaces/controller/CourseApiControllerTest.java @@ -162,8 +162,6 @@ void registerCourse_ShouldReturnOk() throws Exception { MockMultipartFile spotMapStaticImage = new MockMultipartFile("mapStatic", "mapStatic.png", "image/png", "<>".getBytes()); -// MockMultipartFile placeImage = new MockMultipartFile("placeImg", "placeImg.png", -// "image/png", "<>".getBytes()); String requestBody = "{\"title\" : \"test\", \"description\" : \"test\", \"rate\" : 4.5, \"isPrivate\" : false, \"representativeSpotOrder\" : 1, \"lineStringJson\" : \"test\", \"spotRegisterRequests\" : [{\"pointJson\" : \"test\", \"description\" : \"test\", \"rate\" : 4.5, \"placeName\" : \"test\", \"placeAddress\" : \"test\"}]}"; @@ -618,7 +616,7 @@ void getMyFavoriteCourses() throws Exception { MyFavoriteCoursesResponse response = new MyFavoriteCoursesResponse(); response.setContents(List.of(favoriteCourseDto)); - response.setTotalPages(1); + response.setHasNext(false); when(courseFacade.getFavoriteCoursesInfo(anyLong(), any(PageRequest.class))).thenReturn(mock(CourseInfo.MyFavoriteCoursesInfo.class)); when(courseMapper.toMyFavoriteCoursesResponse(any(CourseInfo.MyFavoriteCoursesInfo.class))).thenReturn(response); @@ -658,7 +656,7 @@ void getMyFavoriteCourses() throws Exception { fieldWithPath("contents[].writer_profile_image_url").type(JsonFieldType.STRING).description( "코스 작성자 프로필 이미지 URL"), fieldWithPath("contents[].following").type(JsonFieldType.BOOLEAN).description("팔로잉 여부"), - fieldWithPath("total_pages").type(JsonFieldType.NUMBER).description("총 페이지 수") + fieldWithPath("has_next").type(JsonFieldType.BOOLEAN).description("다음 페이지가 있는지 여부") ) )); } diff --git a/backend/yigil-api/src/test/java/kr/co/yigil/travel/interfaces/controller/SpotApiControllerTest.java b/backend/yigil-api/src/test/java/kr/co/yigil/travel/interfaces/controller/SpotApiControllerTest.java index e3a771834..0246f9f23 100644 --- a/backend/yigil-api/src/test/java/kr/co/yigil/travel/interfaces/controller/SpotApiControllerTest.java +++ b/backend/yigil-api/src/test/java/kr/co/yigil/travel/interfaces/controller/SpotApiControllerTest.java @@ -386,7 +386,7 @@ void getMyFavoriteSpots() throws Exception { .build(); MyFavoriteSpotsResponse response = MyFavoriteSpotsResponse.builder() .contents(List.of(favoriteSpotDto)) - .totalPages(1) + .hasNext(true) .build(); when(spotFacade.getFavoriteSpotsInfo(anyLong(), any(PageRequest.class))).thenReturn(mock(SpotInfo.MyFavoriteSpotsInfo.class)); @@ -412,19 +412,19 @@ void getMyFavoriteSpots() throws Exception { .optional() ), responseFields( - fieldWithPath("contents[].spot_id").description("게시글(리뷰) ID"), - fieldWithPath("contents[].place_id").description("장소 ID"), - fieldWithPath("contents[].place_name").description("장소 제목"), - fieldWithPath("contents[].rate").description("장소 평점"), - fieldWithPath("contents[].image_url").description("장소 이미지 URL"), - fieldWithPath("contents[].created_date").description("장소 생성일"), - fieldWithPath("contents[].writer_id").description("작성자 ID"), - fieldWithPath("contents[].writer_nickname").description("작성자 닉네임"), - fieldWithPath("contents[].writer_profile_image_url").description("작성자 프로필 이미지 URL"), - fieldWithPath("contents[].writer_email").description("작성자 이메일"), - fieldWithPath("contents[].following").description("팔로잉 여부"), - - fieldWithPath("total_pages").description("총 페이지 수") + fieldWithPath("contents[].spot_id").type(JsonFieldType.NUMBER).description("게시글(리뷰) ID"), + fieldWithPath("contents[].place_id").type(JsonFieldType.NUMBER).description("장소 ID"), + fieldWithPath("contents[].place_name").type(JsonFieldType.STRING).description("장소 제목"), + fieldWithPath("contents[].rate").type(JsonFieldType.NUMBER).description("장소 평점"), + fieldWithPath("contents[].image_url").type(JsonFieldType.STRING).description("장소 이미지 URL"), + fieldWithPath("contents[].created_date").type(JsonFieldType.STRING).description("장소 생성일"), + fieldWithPath("contents[].writer_id").type(JsonFieldType.NUMBER).description("작성자 ID"), + fieldWithPath("contents[].writer_nickname").type(JsonFieldType.STRING).description("작성자 닉네임"), + fieldWithPath("contents[].writer_profile_image_url").type(JsonFieldType.STRING).description("작성자 프로필 이미지 URL"), + fieldWithPath("contents[].writer_email").type(JsonFieldType.STRING).description("작성자 이메일"), + fieldWithPath("contents[].following").type(JsonFieldType.BOOLEAN).description("팔로잉 여부"), + + fieldWithPath("has_next").type(JsonFieldType.BOOLEAN).description("다음 페이지 존재 여부") ) )); }