Skip to content

Commit

Permalink
fix: 서울 전국으로 확대하며 사용하지 않는 값 제거 (#229)
Browse files Browse the repository at this point in the history
* fix: 서울 한정 -> 전국으로 확대하며 사용하며 사용하지 않는 값 제거 (#228)

* refactor: reformat code (#228)
  • Loading branch information
toychip authored Oct 3, 2024
1 parent 9a5987f commit 0cf4c65
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 0cf4c65

Please sign in to comment.