Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
bce7dbc
feat : 닉네임 중복 체크 (nickname unique), 인증코드 검사 예외처리 추가
yyytir777 Dec 8, 2025
3573613
fix : user_id IDENTITY strategy & dev redis host 이름변경 (localhost -> r…
yyytir777 Dec 8, 2025
08cfb63
test코드 생성 & swagger url 삭제 & 환경변수 중복 삭제
yyytir777 Dec 8, 2025
ac96fa0
fix : 엔드포인트 추가
yyytir777 Dec 9, 2025
43e75ed
Merge pull request #27 from tinybite-2025/feature/13-user
yyytir777 Dec 9, 2025
a70941b
Feature/26 notification (#29)
marshmallowing Dec 11, 2025
cbbf597
feat : google login 구현 완료
yyytir777 Dec 11, 2025
d03fd30
fix : main push 시에만 workflow trigger
yyytir777 Dec 11, 2025
00cc289
Merge branch 'main' of https://github.com/tinybite-2025/tinybite-serv…
yyytir777 Dec 11, 2025
729ae0a
Feature/#28 google apple login
yyytir777 Dec 16, 2025
b5c29db
Merge branch 'main' into develop
yyytir777 Dec 16, 2025
2e5da55
Merge branch 'develop' of https://github.com/tinybite-2025/tinybite-s…
yyytir777 Dec 18, 2025
1fbd896
merge main into develop : main의 핫픽스 변경사항 develop에 반영
yyytir777 Dec 18, 2025
dd9771a
workflow 줄바꿈 에러 수정
yyytir777 Dec 18, 2025
38de611
hotifx : 에러 핸들링 수정 및 무중단 배포 삭제 (리소스 너무 많이 먹음)
yyytir777 Dec 19, 2025
91b8cba
main의 핫픽스 develop에 반영
yyytir777 Dec 22, 2025
fbc5e90
수정사항 반영 (API 인증 관련, db schema, 예외 처리 등..)
yyytir777 Dec 23, 2025
7b9fb7b
main브랜치 핫픽스 반영
yyytir777 Dec 24, 2025
bbb080f
Feature/35 term (#38)
yyytir777 Dec 24, 2025
4c352aa
fix : docker compose 명령어 수정
yyytir777 Dec 24, 2025
27dfcbb
Feature : 파티 기능 (#42)
milowon Dec 27, 2025
0de3a43
Merge branch 'main' into develop
milowon Dec 31, 2025
2f27dee
hotfix : url parser 경로 제거
milowon Dec 31, 2025
6eb0d8d
Merge branch 'main' of https://github.com/tinybite-2025/tinybite-serv…
milowon Jan 1, 2026
3f69bc1
Merge branch 'main' of https://github.com/tinybite-2025/tinybite-serv…
milowon Jan 2, 2026
45191a9
hotfix : 파티 거리 계산 로직 임시 주석 처리
milowon Jan 2, 2026
3a9a6e6
Merge branch 'main' of https://github.com/tinybite-2025/tinybite-serv…
milowon Jan 2, 2026
b2ca1f4
hotfix : 파티 수정, 삭제 controller 추가
milowon Jan 2, 2026
38ab16c
hotfix : 선택 값들이 존재할때만 넣도록 수정
milowon Jan 2, 2026
037d2e4
hotfix : 위도, 경도 로직 삭제
milowon Jan 2, 2026
9d305f8
Feat : 마이페이지 참여중인 파티 조회 (#50)
milowon Jan 2, 2026
1cee657
hotfix : user service에 transactional 어노테이션 추가
milowon Jan 2, 2026
5213214
Merge branch 'main' of https://github.com/tinybite-2025/tinybite-serv…
milowon Jan 2, 2026
ed3a399
hotfix : 참여중 파티 조회 반환 형식 통일
milowon Jan 2, 2026
374f720
hotfix : 파티 생성, 조회 시, 거리 계산 로직 반영
milowon Jan 2, 2026
4ddfa39
Hotfix: 유저 좌표 입력 requestParam 형식으로 변경
milowon Jan 2, 2026
42bc4d4
Merge branch 'main' into develop
milowon Jan 2, 2026
9ee078a
Merge branch 'main' into develop
milowon Jan 2, 2026
3be9d38
hotfix : 누락된 swagger 문서 수정사항 반영
milowon Jan 2, 2026
89bbef3
Merge branch 'main' into develop
milowon Jan 2, 2026
b281a29
feat : 회원 탈퇴 및 재가입 방지, 검증 (#65)
milowon Jan 2, 2026
35a62b7
fix : 파티 수정 버그 픽스 (#67)
milowon Jan 2, 2026
a4f3582
hotfix : 탈퇴 유저 마스킹 로직 변경
milowon Jan 3, 2026
9f05a6a
Merge branch 'main' of https://github.com/tinybite-2025/tinybite-serv…
milowon Jan 3, 2026
d802e15
feat : 마이페이지에서 참여중,호스트인 파티 구분해서 조회 (#71)
milowon Jan 4, 2026
8715584
Feature/73 search party (#74)
yyytir777 Jan 4, 2026
78349d6
fix : 스웨거 description 추가
yyytir777 Jan 4, 2026
ba3d9d8
Merge branch 'main' into develop
yyytir777 Jan 4, 2026
c15e45b
Feature/73 search party (#76)
yyytir777 Jan 4, 2026
92bef29
Merge branch 'main' into develop
yyytir777 Jan 4, 2026
bd136de
Fix : 호스트만 있을때는 파티 수정할 수 있도록 변경 (#78)
milowon Jan 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import ita.tinybite.domain.party.dto.response.PartyListResponse;
import ita.tinybite.domain.party.entity.PartyParticipant;
import ita.tinybite.domain.party.enums.PartyCategory;
import ita.tinybite.domain.party.service.PartySearchService;
import ita.tinybite.domain.party.service.PartyService;
import ita.tinybite.global.response.APIResponse;
import jakarta.validation.Valid;
Expand All @@ -34,7 +35,7 @@
public class PartyController {

private final PartyService partyService;
private final JwtTokenProvider jwtTokenProvider;
private final PartySearchService partySearchService;


@Operation(
Expand Down Expand Up @@ -459,6 +460,43 @@ public APIResponse<PartyQueryListResponse> getParty(
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "20") int size
) {
return APIResponse.success(partyService.searchParty(q, category, page, size));
return APIResponse.success(partySearchService.searchParty(q, category, page, size));
}

@Operation(
summary = "최근 검색어 조회",
description = """
검색 돋보기 클릭 시 보이는 최근 검색어를 조회합니다. <br>
한 번에 20개가 조회됩니다.
"""
)
@GetMapping("/search/log")
public APIResponse<List<String>> getRecentLog() {
return APIResponse.success(partySearchService.getLog());
}

@Operation(
summary = "특정 최근 검색어 삭제",
description = """
최근 검색어에서 특정 검색어를 삭제합니다. <br>
이때 검색어에 대한 Id값은 없고, 최근 검색어 자체를 keyword에 넣어주시면 됩니다.
"""
)
@DeleteMapping("/search/log/{keyword}")
public APIResponse<?> deleteRecentLog(@PathVariable String keyword) {
partySearchService.deleteLog(keyword);
return APIResponse.success();
}

@Operation(
summary = "모든 최근 검색어 삭제",
description = """
특정 유저에 대한 모든 최근 검색어를 삭제합니다.
"""
)
@DeleteMapping("/search/log")
public APIResponse<?> deleteRecentLogAll() {
partySearchService.deleteAllLog();
return APIResponse.success();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ List<PartyParticipant> findActivePartiesByUserIdExcludingHost(
@Param("userId") Long userId,
@Param("partyStatus") PartyStatus partyStatus,
@Param("participantStatus") ParticipantStatus participantStatus
);}
);

int countByPartyIdAndStatusAndUserIdNot(Long partyId, ParticipantStatus participantStatus, Long userId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package ita.tinybite.domain.party.service;

import ita.tinybite.domain.auth.service.SecurityProvider;
import ita.tinybite.domain.party.dto.request.PartyQueryListResponse;
import ita.tinybite.domain.party.dto.response.PartyCardResponse;
import ita.tinybite.domain.party.entity.Party;
import ita.tinybite.domain.party.enums.ParticipantStatus;
import ita.tinybite.domain.party.enums.PartyCategory;
import ita.tinybite.domain.party.repository.PartyParticipantRepository;
import ita.tinybite.domain.party.repository.PartyRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true)
@RequiredArgsConstructor
public class PartySearchService {

private final PartyRepository partyRepository;
private final PartyParticipantRepository participantRepository;
private final StringRedisTemplate redisTemplate;
private final SecurityProvider securityProvider;


private static final String KEY_PREFIX = "recent_search:";
private String key(Long userId) {
return KEY_PREFIX + userId;
}

// 파티 검색 조회
public PartyQueryListResponse searchParty(String q, PartyCategory category, int page, int size) {
Long userId = securityProvider.getCurrentUser().getUserId();

// recent_search:{userId}
String key = key(userId);

redisTemplate.opsForZSet().remove(key, q);
redisTemplate.opsForZSet().add(key, q, System.currentTimeMillis());

Pageable pageable = PageRequest.of(page, size);

// category가 없을 시에는 ALL로 처리
Page<Party> result = (category == null || category == PartyCategory.ALL)
? partyRepository.findByTitleContaining(q, pageable)
: partyRepository.findByTitleContainingAndCategory(q, category, pageable);

List<PartyCardResponse> partyCardResponseList = result.stream()
.map(party -> {
int currentParticipants = participantRepository
.countByPartyIdAndStatus(party.getId(), ParticipantStatus.APPROVED);
return PartyCardResponse.from(party, currentParticipants);
})
.toList();

return PartyQueryListResponse.builder()
.parties(partyCardResponseList)
.hasNext(result.hasNext())
.build();
}


// 최근 검색어 20개 조회
public List<String> getLog() {
Long userId = securityProvider.getCurrentUser().getUserId();
return redisTemplate.opsForZSet()
.reverseRange(key(userId), 0, 19)
.stream().toList();
}

public void deleteLog(String keyword) {
Long userId = securityProvider.getCurrentUser().getUserId();
redisTemplate.opsForZSet().remove(key(userId), keyword);
}

public void deleteAllLog() {
Long userId = securityProvider.getCurrentUser().getUserId();
redisTemplate.delete(key(userId));
}
}
42 changes: 11 additions & 31 deletions src/main/java/ita/tinybite/domain/party/service/PartyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ private PartyDetailResponse convertToDetailResponse(Party party, double distance
.build();
}

@Transactional
public void updateParty(Long partyId, Long userId, PartyUpdateRequest request) {
Party party = partyRepository.findById(partyId)
.orElseThrow(() -> new IllegalArgumentException("파티를 찾을 수 없습니다"));
Expand All @@ -344,30 +343,33 @@ public void updateParty(Long partyId, Long userId, PartyUpdateRequest request) {
throw new IllegalStateException("파티장만 수정할 수 있습니다");
}

// 승인된 파티원 확인
boolean hasApprovedParticipants = party.getCurrentParticipants() > 1;
// 호스트 제외한 승인된 파티원 수 확인
int approvedParticipantsExcludingHost = participantRepository
.countByPartyIdAndStatusAndUserIdNot(
partyId,
ParticipantStatus.APPROVED,
userId
);

if (hasApprovedParticipants) {
// 승인된 파티원이 있는 경우: 설명과 이미지만 수정 가능
if (approvedParticipantsExcludingHost > 0) {
// 다른 승인된 파티원이 있는 경우: 설명과 이미지만 수정 가능
party.updateLimitedFields(
request.getDescription(),
request.getImages()
);
} else {
// 승인된 파티원이 없는 경우: 모든 항목 수정 가능
// 승인된 파티원이 없는 경우, 호스트 혼자인 경우: 모든 항목 수정 가능
party.updateAllFields(
request.getTitle(),
request.getTotalPrice(),
request.getMaxParticipants(),
getPickUpLocationIfExists(request,party),
// new PickupLocation(request.getPickupLocation()),
getPickUpLocationIfExists(request, party),
request.getProductLink(),
request.getDescription(),
request.getImages()
);
}
}

private PickupLocation getPickUpLocationIfExists(PartyUpdateRequest request, Party currentParty) {
if (request.getPickupLocation() == null) {
return currentParty.getPickupLocation();
Expand Down Expand Up @@ -668,28 +670,6 @@ private String formatDistanceIfExists(Double distance) {
return distance!= null? DistanceCalculator.formatDistance(distance):null;
}

// 파티 검색 조회
public PartyQueryListResponse searchParty(String q, PartyCategory category, int page, int size) {
Pageable pageable = PageRequest.of(page, size);

// category가 없을 시에는 ALL로 처리
Page<Party> result = (category == null || category == PartyCategory.ALL)
? partyRepository.findByTitleContaining(q, pageable)
: partyRepository.findByTitleContainingAndCategory(q, category, pageable);


List<PartyCardResponse> partyCardResponseList = result.stream()
.map(party -> {
int currentParticipants = participantRepository
.countByPartyIdAndStatus(party.getId(), ParticipantStatus.APPROVED);
return PartyCardResponse.from(party, currentParticipants);
})
.toList();

return PartyQueryListResponse.builder()
.parties(partyCardResponseList)
.hasNext(result.hasNext())
.build();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public SmsAuthService(SmsService smsService, RedisTemplate<String, String> redis
this.authCodeGenerator = AuthCodeGenerator.getInstance();
}

private static final String KEY_PREFIX = "sms:";
private String key(String phone) {
return KEY_PREFIX + phone;
}
/**
* 1. 인증코드 생성 <br>
* 2. 주어진 폰번호로 인증코드 전송 <br>
Expand All @@ -37,7 +41,7 @@ public void send(String phone) {

String smsAuthCode = authCodeGenerator.getAuthCode();
smsService.send(phone.replaceAll("-", ""), smsAuthCode);
redisTemplate.opsForValue().set(phone, smsAuthCode, EXPIRE_TIME, TimeUnit.MILLISECONDS);
redisTemplate.opsForValue().set(key(phone), smsAuthCode, EXPIRE_TIME, TimeUnit.MILLISECONDS);
}

/**
Expand All @@ -48,7 +52,7 @@ public void send(String phone) {
public void check(CheckReqDto req) {
validatePhoneNumber(req.phone());

String authCode = redisTemplate.opsForValue().get(req.phone());
String authCode = redisTemplate.opsForValue().get(key(req.phone()));
if(authCode == null)
throw BusinessException.of(AuthErrorCode.EXPIRED_AUTH_CODE);

Expand Down