From 0cf4c6570f595854c4c2b86bfe68f7ed2945cf8a Mon Sep 17 00:00:00 2001 From: Junhyoung Lim <109949924+toychip@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:13:11 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=84=9C=EC=9A=B8=20=EC=A0=84=EA=B5=AD?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=ED=99=95=EB=8C=80=ED=95=98=EB=A9=B0=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=EA=B0=92=20=EC=A0=9C=EA=B1=B0=20(#229)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 서울 한정 -> 전국으로 확대하며 사용하며 사용하지 않는 값 제거 (#228) * refactor: reformat code (#228) --- .../api/ttoklip/domain/aop/filtering/TownAspect.java | 2 -- .../member/dto/response/MemberStreetResponse.java | 7 +++---- .../ttoklip/domain/member/service/MemberService.java | 4 +--- .../domain/mypage/controller/MyPageController.java | 2 +- .../ttoklip/domain/mypage/service/MyPageService.java | 7 ++++++- .../ttoklip/domain/search/service/SearchService.java | 10 +++++++--- .../town/main/controller/TownMainController.java | 2 +- .../domain/town/main/service/TownMainService.java | 9 ++++----- 8 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/api/ttoklip/domain/aop/filtering/TownAspect.java b/src/main/java/com/api/ttoklip/domain/aop/filtering/TownAspect.java index 319bb48c..587ccf82 100644 --- a/src/main/java/com/api/ttoklip/domain/aop/filtering/TownAspect.java +++ b/src/main/java/com/api/ttoklip/domain/aop/filtering/TownAspect.java @@ -7,8 +7,6 @@ import com.api.ttoklip.global.exception.ErrorType; import lombok.RequiredArgsConstructor; import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; diff --git a/src/main/java/com/api/ttoklip/domain/member/dto/response/MemberStreetResponse.java b/src/main/java/com/api/ttoklip/domain/member/dto/response/MemberStreetResponse.java index 3756ae12..9f7a302d 100644 --- a/src/main/java/com/api/ttoklip/domain/member/dto/response/MemberStreetResponse.java +++ b/src/main/java/com/api/ttoklip/domain/member/dto/response/MemberStreetResponse.java @@ -1,10 +1,9 @@ package com.api.ttoklip.domain.member.dto.response; public record MemberStreetResponse( - String street, - boolean writerLiveInSeoul + String street ) { - public static MemberStreetResponse of(String street, boolean writerLiveInSeoul) { - return new MemberStreetResponse(street, writerLiveInSeoul); + public static MemberStreetResponse of(String street) { + return new MemberStreetResponse(street); } } diff --git a/src/main/java/com/api/ttoklip/domain/member/service/MemberService.java b/src/main/java/com/api/ttoklip/domain/member/service/MemberService.java index cd5ff921..211b9185 100644 --- a/src/main/java/com/api/ttoklip/domain/member/service/MemberService.java +++ b/src/main/java/com/api/ttoklip/domain/member/service/MemberService.java @@ -27,8 +27,6 @@ public class MemberService { private final MemberRepository memberRepository; private final MemberOAuthRepository memberOAuthRepository; - private static final String SEOUL = "서울특별시"; - public Member findById(final Long memberId) { return memberRepository.findById(memberId) .orElseThrow(() -> new ApiException(_USER_NOT_FOUND_DB)); @@ -86,6 +84,6 @@ private void validProfile(final Profile profile) { public MemberStreetResponse getMemberStreet(final Member member) { Member findMember = findById(member.getId()); - return MemberStreetResponse.of(findMember.getStreet(), !findMember.getStreet().startsWith(SEOUL)); + return MemberStreetResponse.of(findMember.getStreet()); } } diff --git a/src/main/java/com/api/ttoklip/domain/mypage/controller/MyPageController.java b/src/main/java/com/api/ttoklip/domain/mypage/controller/MyPageController.java index 8fdc31a7..f2a37733 100644 --- a/src/main/java/com/api/ttoklip/domain/mypage/controller/MyPageController.java +++ b/src/main/java/com/api/ttoklip/domain/mypage/controller/MyPageController.java @@ -6,10 +6,10 @@ import com.api.ttoklip.domain.mypage.service.MyPageService; import com.api.ttoklip.domain.privacy.dto.PrivacyCreateRequest; import com.api.ttoklip.domain.privacy.service.ProfileService; +import com.api.ttoklip.domain.search.response.CartPaging; import com.api.ttoklip.domain.search.response.CommunityPaging; import com.api.ttoklip.domain.search.response.HoneyTipPaging; import com.api.ttoklip.domain.search.response.NewsletterPaging; -import com.api.ttoklip.domain.search.response.CartPaging; import com.api.ttoklip.global.success.Message; import com.api.ttoklip.global.success.SuccessResponse; import io.swagger.v3.oas.annotations.Operation; diff --git a/src/main/java/com/api/ttoklip/domain/mypage/service/MyPageService.java b/src/main/java/com/api/ttoklip/domain/mypage/service/MyPageService.java index bc2e67d6..363445a2 100644 --- a/src/main/java/com/api/ttoklip/domain/mypage/service/MyPageService.java +++ b/src/main/java/com/api/ttoklip/domain/mypage/service/MyPageService.java @@ -17,7 +17,12 @@ import com.api.ttoklip.domain.mypage.dto.response.UserSingleResponse; import com.api.ttoklip.domain.newsletter.post.domain.Newsletter; import com.api.ttoklip.domain.question.post.domain.Question; -import com.api.ttoklip.domain.search.response.*; +import com.api.ttoklip.domain.search.response.CartPaging; +import com.api.ttoklip.domain.search.response.CommunityPaging; +import com.api.ttoklip.domain.search.response.CommunitySingleResponse; +import com.api.ttoklip.domain.search.response.HoneyTipPaging; +import com.api.ttoklip.domain.search.response.NewsletterPaging; +import com.api.ttoklip.domain.search.response.SingleResponse; import com.api.ttoklip.domain.town.cart.post.entity.Cart; import com.api.ttoklip.domain.town.community.post.entity.Community; import java.util.List; diff --git a/src/main/java/com/api/ttoklip/domain/search/service/SearchService.java b/src/main/java/com/api/ttoklip/domain/search/service/SearchService.java index 832cb83d..4af8724b 100644 --- a/src/main/java/com/api/ttoklip/domain/search/service/SearchService.java +++ b/src/main/java/com/api/ttoklip/domain/search/service/SearchService.java @@ -5,19 +5,23 @@ import com.api.ttoklip.domain.mypage.dto.response.UserCartSingleResponse; import com.api.ttoklip.domain.newsletter.post.domain.Newsletter; import com.api.ttoklip.domain.newsletter.post.repository.NewsletterRepository; -import com.api.ttoklip.domain.search.response.*; +import com.api.ttoklip.domain.search.response.CartPaging; +import com.api.ttoklip.domain.search.response.CommunityPaging; +import com.api.ttoklip.domain.search.response.CommunitySingleResponse; +import com.api.ttoklip.domain.search.response.HoneyTipPaging; +import com.api.ttoklip.domain.search.response.NewsletterPaging; +import com.api.ttoklip.domain.search.response.SingleResponse; import com.api.ttoklip.domain.town.cart.post.entity.Cart; import com.api.ttoklip.domain.town.cart.post.repository.CartSearchRepository; import com.api.ttoklip.domain.town.community.post.entity.Community; import com.api.ttoklip.domain.town.community.post.repository.CommunitySearchRepository; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.List; - @Service @RequiredArgsConstructor @Transactional(readOnly = true) diff --git a/src/main/java/com/api/ttoklip/domain/town/main/controller/TownMainController.java b/src/main/java/com/api/ttoklip/domain/town/main/controller/TownMainController.java index 5095a220..5f11c862 100644 --- a/src/main/java/com/api/ttoklip/domain/town/main/controller/TownMainController.java +++ b/src/main/java/com/api/ttoklip/domain/town/main/controller/TownMainController.java @@ -1,7 +1,7 @@ package com.api.ttoklip.domain.town.main.controller; -import com.api.ttoklip.domain.search.response.CommunityPaging; import com.api.ttoklip.domain.search.response.CartPaging; +import com.api.ttoklip.domain.search.response.CommunityPaging; import com.api.ttoklip.domain.town.community.post.dto.response.CartMainResponse; import com.api.ttoklip.domain.town.main.constant.TownResponseConstant; import com.api.ttoklip.domain.town.main.service.TownMainService; diff --git a/src/main/java/com/api/ttoklip/domain/town/main/service/TownMainService.java b/src/main/java/com/api/ttoklip/domain/town/main/service/TownMainService.java index 362d9ee0..1bfaa49f 100644 --- a/src/main/java/com/api/ttoklip/domain/town/main/service/TownMainService.java +++ b/src/main/java/com/api/ttoklip/domain/town/main/service/TownMainService.java @@ -1,25 +1,24 @@ package com.api.ttoklip.domain.town.main.service; +import static com.api.ttoklip.global.util.SecurityUtil.getCurrentMember; + import com.api.ttoklip.domain.mypage.dto.response.UserCartSingleResponse; +import com.api.ttoklip.domain.search.response.CartPaging; import com.api.ttoklip.domain.search.response.CommunityPaging; import com.api.ttoklip.domain.search.response.CommunitySingleResponse; import com.api.ttoklip.domain.town.TownCriteria; -import com.api.ttoklip.domain.search.response.CartPaging; import com.api.ttoklip.domain.town.cart.post.entity.Cart; import com.api.ttoklip.domain.town.cart.post.service.CartPostService; import com.api.ttoklip.domain.town.community.post.dto.response.CartMainResponse; import com.api.ttoklip.domain.town.community.post.dto.response.CommunityRecent3Response; import com.api.ttoklip.domain.town.community.post.entity.Community; import com.api.ttoklip.domain.town.community.post.service.CommunityPostService; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; -import java.util.List; - -import static com.api.ttoklip.global.util.SecurityUtil.getCurrentMember; - @Service @RequiredArgsConstructor public class TownMainService {