Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 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
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 @@ -68,4 +68,16 @@ long countActivePartiesByHostId(
@Param("userId") Long userId,
@Param("activeStatuses") List<PartyStatus> activeStatuses
);
}

@Query("SELECT pp FROM PartyParticipant pp " +
"JOIN FETCH pp.party p " +
"JOIN FETCH p.host " +
"WHERE pp.user.userId = :userId " +
"AND p.host.userId != :userId " +
"AND p.status = :partyStatus " +
"AND pp.status = :participantStatus")
List<PartyParticipant> findActivePartiesByUserIdExcludingHost(
@Param("userId") Long userId,
@Param("partyStatus") PartyStatus partyStatus,
@Param("participantStatus") ParticipantStatus participantStatus
);}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.List;
import java.util.Optional;

import ita.tinybite.domain.party.enums.PartyStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
Expand All @@ -20,5 +21,7 @@ public interface PartyRepository extends JpaRepository<Party, Long> {
List<Party> findByPickupLocation_Place(String place);

List<Party> findByPickupLocation_PlaceAndCategory(String place, PartyCategory category);

List<Party> findByHostUserIdAndStatus(Long userId, PartyStatus partyStatus);
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import jakarta.validation.Valid;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.ErrorResponse;
import org.springframework.web.bind.annotation.*;

import java.util.List;
Expand Down Expand Up @@ -111,19 +112,65 @@ public APIResponse<RejoinValidationResponse> validateRejoin(
return success(response);
}

@Operation(summary = "활성 파티 목록 조회", description = "사용자가 참여 중인 활성 파티 목록을 조회합니다.")
@Operation(
summary = "호스팅 중인 파티 목록 조회",
description = "현재 사용자가 호스트로 있는 활성 파티 목록을 조회합니다."
)
@ApiResponses({
@ApiResponse(responseCode = "200", description = "조회 성공",
content = @Content(array = @ArraySchema(schema = @Schema(implementation = PartyCardResponse.class)))),
@ApiResponse(responseCode = "401", description = "인증 실패")
@ApiResponse(
responseCode = "200",
description = "조회 성공",
content = @Content(
array = @ArraySchema(schema = @Schema(implementation = PartyCardResponse.class))
)
),
@ApiResponse(
responseCode = "401",
description = "인증 실패",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
)
})
@GetMapping("/parties/active")
public ResponseEntity<List<PartyCardResponse>> getActiveParties(
@GetMapping("/parties/hosting")
public ResponseEntity<List<PartyCardResponse>> getHostingParties(
@AuthenticationPrincipal Long userId) {
List<PartyCardResponse> response = userService.getActiveParties(userId);
List<PartyCardResponse> response = userService.getHostingParties(userId);
return ResponseEntity.ok(response);
}

@ApiResponses({
@ApiResponse(
responseCode = "200",
description = "조회 성공",
content = @Content(
array = @ArraySchema(schema = @Schema(implementation = PartyCardResponse.class))
)
),
@ApiResponse(
responseCode = "401",
description = "인증 실패",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))
)
})
@GetMapping("/parties/participating")
public ResponseEntity<List<PartyCardResponse>> getParticipatingParties(
@AuthenticationPrincipal Long userId) {
List<PartyCardResponse> response = userService.getParticipatingParties(userId);
return ResponseEntity.ok(response);
}

// @Operation(summary = "활성 파티 목록 조회", description = "사용자가 참여 중인 활성 파티 목록을 조회합니다.")
// @ApiResponses({
// @ApiResponse(responseCode = "200", description = "조회 성공",
// content = @Content(array = @ArraySchema(schema = @Schema(implementation = PartyCardResponse.class)))),
// @ApiResponse(responseCode = "401", description = "인증 실패")
// })
// @GetMapping("/parties/active")
// public ResponseEntity<List<PartyCardResponse>> getActiveParties(
// @AuthenticationPrincipal Long userId) {
// List<PartyCardResponse> response = userService.getActiveParties(userId);
// return ResponseEntity.ok(response);
// }

@Operation(summary = "닉네임 중복 확인", description = "닉네임 사용 가능 여부를 확인합니다.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "사용 가능한 닉네임"),
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/ita/tinybite/domain/user/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;

@Entity
@Table(name = "users")
Expand Down Expand Up @@ -77,8 +79,13 @@ public void addTerms(List<UserTermAgreement> agreements) {
}

public void withdraw() {
this.nickname = "탈퇴한 사용자";
String uniqueId = UUID.randomUUID().toString().substring(0, 8);
this.nickname = "탈퇴한 사용자"+ uniqueId;
this.profileImage = "/images/default-profile.jpg";
this.email = "withdrawn_" + uniqueId + "@deleted.com";
this.phone = String.format("010-%04d-%04d",
new Random().nextInt(10000),
new Random().nextInt(10000));
this.status = UserStatus.WITHDRAW;
this.withdrawAt = LocalDateTime.now();
}
Expand Down
48 changes: 36 additions & 12 deletions src/main/java/ita/tinybite/domain/user/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import ita.tinybite.domain.party.enums.ParticipantStatus;
import ita.tinybite.domain.party.enums.PartyStatus;
import ita.tinybite.domain.party.repository.PartyParticipantRepository;
import ita.tinybite.domain.party.repository.PartyRepository;
import ita.tinybite.domain.user.dto.req.UpdateUserReqDto;
import ita.tinybite.domain.user.dto.res.RejoinValidationResponse;
import ita.tinybite.domain.user.dto.res.UserResDto;
Expand All @@ -19,6 +20,7 @@
import ita.tinybite.global.exception.BusinessException;
import ita.tinybite.global.exception.errorcode.AuthErrorCode;
import ita.tinybite.global.location.LocationService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Expand All @@ -29,6 +31,7 @@
import java.util.stream.Collectors;

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

Expand All @@ -37,18 +40,7 @@ public class UserService {
private final LocationService locationService;
private final WithDrawUserRepository withDrawUserRepository;
private final PartyParticipantRepository participantRepository;

public UserService(SecurityProvider securityProvider,
UserRepository userRepository,
LocationService locationService,
PartyParticipantRepository participantRepository,
WithDrawUserRepository withDrawUserRepository) {
this.securityProvider = securityProvider;
this.userRepository = userRepository;
this.locationService = locationService;
this.participantRepository = participantRepository;
this.withDrawUserRepository = withDrawUserRepository;
}
private final PartyRepository partyRepository;

public UserResDto getUser() {
User user = securityProvider.getCurrentUser();
Expand Down Expand Up @@ -183,4 +175,36 @@ public RejoinValidationResponse validateRejoin(String email) {
.build();
}

public List<PartyCardResponse> getHostingParties(Long userId) {
List<Party> parties = partyRepository.findByHostUserIdAndStatus(
userId,
PartyStatus.RECRUITING
);

return parties.stream()
.map(party -> {
int currentParticipants = participantRepository
.countByPartyIdAndStatus(party.getId(), ParticipantStatus.APPROVED);
return PartyCardResponse.from(party, currentParticipants, true, ParticipantStatus.APPROVED);
})
.collect(Collectors.toList());
}

public List<PartyCardResponse> getParticipatingParties(Long userId) {
List<PartyParticipant> participants = participantRepository
.findActivePartiesByUserIdExcludingHost(
userId,
PartyStatus.RECRUITING,
ParticipantStatus.APPROVED
);

return participants.stream()
.map(pp -> {
Party party = pp.getParty();
int currentParticipants = participantRepository
.countByPartyIdAndStatus(party.getId(), ParticipantStatus.APPROVED);
return PartyCardResponse.from(party, currentParticipants, false, pp.getStatus());
})
.collect(Collectors.toList());
}
}