From ac53e543da701d3f8b72a77ea13cb6711d2173b4 Mon Sep 17 00:00:00 2001 From: username0w Date: Sat, 7 Dec 2024 11:16:22 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[feat]=20=EC=A0=84=EC=B2=B4=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0=20=EC=9C=84?= =?UTF-8?q?=ED=95=9C=20=EA=B0=92=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/article/controller/ArticleController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/mallangs/domain/article/controller/ArticleController.java b/src/main/java/com/mallangs/domain/article/controller/ArticleController.java index e41a830..5c65255 100644 --- a/src/main/java/com/mallangs/domain/article/controller/ArticleController.java +++ b/src/main/java/com/mallangs/domain/article/controller/ArticleController.java @@ -15,6 +15,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; +import java.util.Objects; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Pageable; @@ -146,16 +147,21 @@ public ResponseEntity> getMarkersInBounds( List articlesInBounds; + log.info("지도에서 글타래 조회"); + // 대분류 소분류 // 대분류 null 인경우 전체 조회 // 대분류 존재하는 경우 해당 값 조회 // 시설/위치 ---구조 ---목격 ---사용자 등록 정보 // 시설/위치는 소분류도 존재 // 사용자 등록 정보는? - if (articleType == null || articleType.isEmpty()) { // 대분류 null 전체 조회 + if (Objects.equals(articleType, "all") || articleType == null + || articleType.isEmpty()) { // 대분류 null 전체 조회 + log.info("전체 조회"); articlesInBounds = locationService.findArticlesInBounds( southWestLat, southWestLon, northEastLat, northEastLon); } else { // 대준류 null 아님 + log.info("대분류 조회"); if (placeCategory == null || placeCategory.isEmpty()) { // 소분류 없는 경우 // 글타래 타입 기준 조회 articlesInBounds = locationService.findArticlesInBoundsByType( southWestLat, southWestLon, @@ -165,8 +171,8 @@ public ResponseEntity> getMarkersInBounds( southWestLat, southWestLon, northEastLat, northEastLon, articleType, placeCategory); } - } + return ResponseEntity.ok(articlesInBounds); } From 093bafbe7b989eb535008512f762377545a343b2 Mon Sep 17 00:00:00 2001 From: username0w Date: Sat, 7 Dec 2024 12:43:00 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[feat]=20=EA=B3=B5=EA=B0=9C=20=EA=B8=80?= =?UTF-8?q?=ED=83=80=EB=9E=98=20=EC=A1=B0=EA=B1=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../article/repository/JdbcLocationRepository.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/mallangs/domain/article/repository/JdbcLocationRepository.java b/src/main/java/com/mallangs/domain/article/repository/JdbcLocationRepository.java index a8f7dcc..876e9d1 100644 --- a/src/main/java/com/mallangs/domain/article/repository/JdbcLocationRepository.java +++ b/src/main/java/com/mallangs/domain/article/repository/JdbcLocationRepository.java @@ -22,7 +22,8 @@ public List findArticlesInBounds(double southWestLat, double "SELECT a.article_id, a.type, a.title, ST_X(a.geography) AS latitude, " + "ST_Y(a.geography) AS longitude, a.description " + "FROM article a " + - "WHERE MBRContains(ST_GeomFromText('POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))', 4326), a.geography)", + "WHERE MBRContains(ST_GeomFromText('POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))', 4326), a.geography) " + + "AND a.map_visibility = 'VISIBLE'", southWestLat, southWestLon, southWestLat, northEastLon, northEastLat, northEastLon, @@ -52,7 +53,8 @@ public List findArticlesInBoundsByType(double southWestLat, "SELECT a.article_id, a.type, a.title, ST_X(a.geography) AS latitude, " + "ST_Y(a.geography) AS longitude, a.description " + "FROM article a " + - "WHERE MBRContains(ST_GeomFromText('POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))', 4326), a.geography) AND a.type = '%s'", + "WHERE MBRContains(ST_GeomFromText('POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))', 4326), a.geography) " + + "AND a.type = '%s' AND a.map_visibility = 'VISIBLE'", southWestLat, southWestLon, southWestLat, northEastLon, northEastLat, northEastLon, @@ -85,7 +87,7 @@ public List findPlaceArticlesInBoundsByType(double southWestL "FROM place_article p " + "JOIN article a ON p.article_id = a.article_id " + "WHERE MBRContains(ST_GeomFromText('POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))', 4326), a.geography) " - + "AND p.is_public_data = %b", + + "AND p.is_public_data = %b AND a.map_visibility = 'VISIBLE'", southWestLat, southWestLon, southWestLat, northEastLon, northEastLat, northEastLon, @@ -119,7 +121,7 @@ public List findPlaceArticlesInBoundsByCategory(double southW "FROM place_article p " + "JOIN article a ON p.article_id = a.article_id " + "WHERE MBRContains(ST_GeomFromText('POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))', 4326), a.geography) " - + "AND p.category = '%s' AND p.is_public_data = %b", + + "AND p.category = '%s' AND p.is_public_data = %b AND a.map_visibility = 'VISIBLE'", southWestLat, southWestLon, southWestLat, northEastLon, northEastLat, northEastLon, From a2699f60172eef0744d5a4beffd4b0dd0fffedcb Mon Sep 17 00:00:00 2001 From: iam52 Date: Mon, 9 Dec 2024 00:35:16 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[mod]=20=EC=A0=84=EC=B2=B4=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EA=B8=80=20=EC=A1=B0=ED=9A=8C=20content=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/board/dto/response/CommunityListResponse.java | 2 ++ .../domain/board/dto/response/SightingListResponse.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/com/mallangs/domain/board/dto/response/CommunityListResponse.java b/src/main/java/com/mallangs/domain/board/dto/response/CommunityListResponse.java index 9ee0772..0518bc9 100644 --- a/src/main/java/com/mallangs/domain/board/dto/response/CommunityListResponse.java +++ b/src/main/java/com/mallangs/domain/board/dto/response/CommunityListResponse.java @@ -10,6 +10,7 @@ public class CommunityListResponse { private final Long boardId; private final String title; + private final String content; private final String writer; private final String categoryName; private final int viewCount; @@ -21,6 +22,7 @@ public class CommunityListResponse { public CommunityListResponse(Board board) { this.boardId = board.getBoardId(); this.title = board.getTitle(); + this.content = board.getContent(); this.writer = board.getMember().getNickname().getValue(); this.categoryName = board.getCategory().getName(); this.viewCount = board.getViewCnt(); diff --git a/src/main/java/com/mallangs/domain/board/dto/response/SightingListResponse.java b/src/main/java/com/mallangs/domain/board/dto/response/SightingListResponse.java index 05306d4..6f55b22 100644 --- a/src/main/java/com/mallangs/domain/board/dto/response/SightingListResponse.java +++ b/src/main/java/com/mallangs/domain/board/dto/response/SightingListResponse.java @@ -10,6 +10,7 @@ public class SightingListResponse { private final Long boardId; private final String title; + private final String content; private final String writer; private final String categoryName; private final String address; @@ -23,6 +24,7 @@ public class SightingListResponse { public SightingListResponse(Board board) { this.boardId = board.getBoardId(); this.title = board.getTitle(); + this.content = board.getContent(); this.writer = board.getMember().getNickname().getValue(); this.categoryName = board.getCategory().getName(); this.address = board.getAddress(); From c1c7c44fbc68a34b579eb722e21bc608b2048465 Mon Sep 17 00:00:00 2001 From: iam52 Date: Mon, 9 Dec 2024 00:57:55 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[mod]=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EC=9D=B4=EB=A6=84=EC=9C=BC=EB=A1=9C=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EA=B8=80=20=EA=B2=80=EC=83=89=20=EC=88=98=EC=A0=95(?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20security=20=EC=84=A4=EC=A0=95=20=EC=88=98?= =?UTF-8?q?=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/board/controller/BoardController.java | 10 +++++++++- .../java/com/mallangs/global/jwt/filter/JWTFilter.java | 3 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/mallangs/domain/board/controller/BoardController.java b/src/main/java/com/mallangs/domain/board/controller/BoardController.java index e3dc3de..1034b74 100644 --- a/src/main/java/com/mallangs/domain/board/controller/BoardController.java +++ b/src/main/java/com/mallangs/domain/board/controller/BoardController.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -84,8 +85,15 @@ public ResponseEntity> getCommunityPostByCat @PathVariable String categoryName, @RequestParam(defaultValue = "1") int page ) { + log.info("=== Request received - category: {}, page: {}", categoryName, page); + PageRequest pageRequest = PageRequest.of(page - 1, 10); - return ResponseEntity.ok(PageResponse.from(boardService.getCommunityBoardsByCategory(categoryName, pageRequest))); + + var result = boardService.getCommunityBoardsByCategory(categoryName, pageRequest); + log.info("=== Request processed successfully"); + + return ResponseEntity.ok(PageResponse.from(result)); +// return ResponseEntity.ok(PageResponse.from(boardService.getCommunityBoardsByCategory(categoryName, pageRequest))); } @Operation(summary = "커뮤니티 특정 게시글 수정", description = "특정 커뮤니티 게시글을 수정합니다.") diff --git a/src/main/java/com/mallangs/global/jwt/filter/JWTFilter.java b/src/main/java/com/mallangs/global/jwt/filter/JWTFilter.java index a76bb3b..7674301 100644 --- a/src/main/java/com/mallangs/global/jwt/filter/JWTFilter.java +++ b/src/main/java/com/mallangs/global/jwt/filter/JWTFilter.java @@ -66,10 +66,8 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse AntPathMatcher pathMatcher = new AntPathMatcher(); Map patternVariableMap = new HashMap<>(); - patternVariableMap.put("/api/v1/board/community/category/{categoryId}", "categoryId"); patternVariableMap.put("/api/v1/comments/board/{boardId}", "boardId"); patternVariableMap.put("/api/v1/comments/article/{articleId}", "articleId"); - patternVariableMap.put("/api/v1/board/sighting/category/{categoryId}", "categoryId"); patternVariableMap.put("/api/v1/place-articles/{placeArticleId}/reviews", "placeArticleId"); patternVariableMap.put("/api/v1/place-articles/{placeArticleId}/reviews/average-score", "placeArticleId"); @@ -104,6 +102,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse //게시판 ("GET".equals(method) && uri.startsWith("/api/v1/board/community")) || ("GET".equals(method) && uri.startsWith("/api/v1/board/community/keyword")) || + ("GET".equals(method) && uri.startsWith("/api/v1/board/community/category")) || ("GET".equals(method) && uri.startsWith("/api/v1/board/sighting")) || ("GET".equals(method) && uri.startsWith("/api/v1/board/sighting/keyword")) ||