Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 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
5d3e13d
fix : 파티 삭제시 호스트는 현재인원에서 제외하도록 수정 (#80)
milowon Jan 4, 2026
1e5b600
hotfix : jpa 네이밍 및 쿼리 수정
yyytir777 Jan 4, 2026
ba4ed25
hotfix : jpa 네이밍 및 쿼리 수정
yyytir777 Jan 4, 2026
c2d9465
Merge branch 'main' into develop
yyytir777 Jan 4, 2026
0b783c7
feat : 파티 카테고리, 최신순, 거리순 정렬 (#83)
milowon Jan 4, 2026
4474664
Merge branch 'main' of https://github.com/tinybite-2025/tinybite-serv…
milowon Jan 4, 2026
3353068
Feature/44 chat (#82)
yyytir777 Jan 6, 2026
6e2450c
hotfix : 파티 삭제 되지 않는 문제 수정 (#86)
milowon Jan 6, 2026
b9630cf
hotfix : 파티 수정사항이 db에 반영 되지 않는 문제 수정
milowon Jan 6, 2026
866bb84
feat : 유저 프로필 이미지 수정, 삭제 (#89)
milowon Jan 6, 2026
e1fc441
Fix : 유저 프로필 수정, 삭제 (#91)
milowon Jan 6, 2026
64449d4
Merge branch 'main' into develop
milowon Jan 6, 2026
85f9a6e
hotfix: 유저 정보 조회시 프로필 이미지 반환하도록 수정
milowon Jan 9, 2026
17485c9
Fix/party search (#94)
yyytir777 Jan 9, 2026
e77c560
feat: 파티 참여, 거절, 종료 알림 연결 (#97)
marshmallowing Jan 10, 2026
2826cae
fix : 마이페이지에서 참여중, 호스트 파티 조회시 최신순으로 조회되도록 수정 (#98)
milowon Jan 10, 2026
cf0f51d
Merge branch 'main' into develop
milowon Jan 10, 2026
f02e7eb
feat : 파티 생성시 이미지 없을 경우 디폴트 이미지 반환하도록 수정 (#100)
milowon Jan 10, 2026
72accaf
feat: 채팅 알림 단체/개인 구분 (#102)
marshmallowing Jan 10, 2026
8fa6f24
fix : 채팅방 유형 별 알림 변경
yyytir777 Jan 10, 2026
0707f62
Feat : 파티 목록 디폴트 이미지 필드 추가 (#104)
milowon Jan 10, 2026
02c3e16
Fix : 파티 썸네일 이미지 주입되도록 value값 수정 (#106)
milowon Jan 10, 2026
5c230a6
Merge branch 'main' into develop
milowon Jan 10, 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
45 changes: 33 additions & 12 deletions src/main/java/ita/tinybite/domain/chat/service/ChatService.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import ita.tinybite.domain.chat.dto.res.ChatMessageResDto;
import ita.tinybite.domain.chat.dto.res.ChatMessageSliceResDto;
import ita.tinybite.domain.chat.entity.ChatMessage;
import ita.tinybite.domain.chat.entity.ChatRoom;
import ita.tinybite.domain.chat.entity.ChatRoomMember;
import ita.tinybite.domain.chat.enums.ChatRoomType;
import ita.tinybite.domain.chat.enums.MessageType;
import ita.tinybite.domain.chat.repository.ChatMessageRepository;
import ita.tinybite.domain.chat.repository.ChatRoomRepository;
Expand Down Expand Up @@ -57,19 +59,38 @@ public void sendNotification(ChatMessage message, Long chatRoomId) {

// 4. 해당 비구독자 유저들에게 메시지가 왔다는 알림 전송
String messageContent;
if(message.getMessageType().equals(MessageType.TEXT)) {
messageContent = message.getText();
} else if (message.getMessageType().equals(MessageType.IMAGE)) {
messageContent = message.getImageUrl();
} else if (message.getMessageType().equals(MessageType.SYSTEM)) {
messageContent = message.getSystemMessage();
} else {
messageContent = "";
}
ChatRoom chatRoom = chatRoomRepository.findById(chatRoomId).orElseThrow();

unsubscribers.forEach(unsubscriber ->
notificationFacade.notifyNewChatMessage(unsubscriber.getUserId(), chatRoomId, unsubscriber.getNickname(), messageContent)
);
// 1대1일 때
if (chatRoom.getType().equals(ChatRoomType.ONE_TO_ONE)) {
switch (message.getMessageType()) {
case TEXT -> {
messageContent = message.getText();
unsubscribers.forEach(unsubscriber ->
notificationFacade.notifyOneToOneChat(unsubscriber.getUserId(), chatRoomId, unsubscriber.getNickname(), messageContent)
);
}
case IMAGE -> {
unsubscribers.forEach(unsubscriber ->
notificationFacade.notifyOneToOneImage(unsubscriber.getUserId(), chatRoomId, unsubscriber.getNickname())
);
}
}
} else { // 그룹일 때
switch (message.getMessageType()) {
case TEXT -> {
messageContent = message.getText();
unsubscribers.forEach(unsubscriber ->
notificationFacade.notifyGroupChat(unsubscriber.getUserId(), chatRoomId, chatRoom.getParty().getTitle(), message.getSenderName(), messageContent)
);
}
case IMAGE -> {
unsubscribers.forEach(unsubscriber ->
notificationFacade.notifyGroupImage(unsubscriber.getUserId(), chatRoomId, chatRoom.getParty().getTitle(), message.getSenderName())
);
}
}
}
}

public ChatMessageSliceResDto getChatMessage(Long roomId, int page, int size) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,85 @@
@RequiredArgsConstructor
@Slf4j
public class ChatNotificationService {
private static final int MAX_CONTENT_LENGTH = 30;

private final FcmNotificationSender fcmNotificationSender;
private final FcmTokenService fcmTokenService;
private final ChatMessageManager chatMessageManager;
private final NotificationLogService notificationLogService;
private final NotificationTransactionHelper notificationTransactionHelper;

// 1:1 채팅 일반 메시지
@Transactional
public void sendOneToOneChatMessage(Long targetUserId, Long chatRoomId, String senderName, String content) {
String title = senderName;
String detail = truncateContent(content);
send(targetUserId, chatRoomId, title, detail, senderName);
}

// 1:1 채팅 사진 전송
@Transactional
public void sendOneToOneChatImage(Long targetUserId, Long chatRoomId, String senderName) {
String title = senderName;
String detail = "📷 사진을 보냈어요";
send(targetUserId, chatRoomId, title, detail, senderName);
}

// 단체 채팅 일반 메시지
@Transactional
public void sendGroupChatMessage(Long targetUserId, Long chatRoomId, String partyTitle, String senderName, String content) {
String title = partyTitle;
String detail = senderName + ": " + truncateContent(content);
send(targetUserId, chatRoomId, title, detail, senderName);
}

// 단체 채팅 사진 전송
@Transactional
public void sendGroupChatImage(Long targetUserId, Long chatRoomId, String partyTitle, String senderName) {
String title = partyTitle;
String detail = senderName + ": 📷 사진을 보냈어요";
send(targetUserId, chatRoomId, title, detail, senderName);
}

@Transactional
public void sendUnreadReminderNotification(Long targetUserId, Long chatRoomId) {
String title = "🔔 놓친 메시지가 있어요!";
String detail = "안 읽은 메시지가 있어요! 지금 확인해 보세요.";
notificationLogService.saveLog(targetUserId, NotificationType.CHAT_UNREAD_REMINDER.name(), title, detail);

List<String> tokens = fcmTokenService.getTokensAndLogIfEmpty(targetUserId);
if (tokens.isEmpty()) {
return;
}

NotificationMulticastRequest request =
chatMessageManager.createUnreadReminderRequest(tokens, chatRoomId, title, detail);

BatchResponse response = fcmNotificationSender.send(request);
notificationTransactionHelper.handleBatchResponse(response, tokens);
}

/**
* 공통 전송 로직
*/
private void send(Long targetUserId, Long chatRoomId, String title, String detail, String senderName) {
// 알림 로그 저장
notificationLogService.saveLog(targetUserId, NotificationType.CHAT_NEW_MESSAGE.name(), title, detail);

// 토큰 조회
List<String> tokens = fcmTokenService.getTokensAndLogIfEmpty(targetUserId);
if (tokens.isEmpty()) return;

// FCM 요청 생성
NotificationMulticastRequest request =
chatMessageManager.createNewChatMessageRequest(tokens, chatRoomId, title, senderName, detail);

// 발송 및 후처리
BatchResponse response = fcmNotificationSender.send(request);
notificationTransactionHelper.handleBatchResponse(response, tokens);
}

/*@Transactional
public void sendNewChatMessage(
Long targetUserId,
Long chatRoomId,
Expand All @@ -52,23 +123,14 @@ public void sendNewChatMessage(

BatchResponse response = fcmNotificationSender.send(request);
notificationTransactionHelper.handleBatchResponse(response, tokens);
}
}*/

@Transactional
public void sendUnreadReminderNotification(Long targetUserId, Long chatRoomId) {
String title = "🔔 놓친 메시지가 있어요!";
String detail = "안 읽은 메시지가 있어요! 지금 확인해 보세요.";
notificationLogService.saveLog(targetUserId, NotificationType.CHAT_UNREAD_REMINDER.name(), title, detail);

List<String> tokens = fcmTokenService.getTokensAndLogIfEmpty(targetUserId);
if (tokens.isEmpty()) {
return;
// 텍스트 30자 제한 헬퍼 메서드
private String truncateContent(String content) {
if (content == null) return "";
if (content.length() > MAX_CONTENT_LENGTH) {
return content.substring(0, MAX_CONTENT_LENGTH) + "...";
}

NotificationMulticastRequest request =
chatMessageManager.createUnreadReminderRequest(tokens, chatRoomId, title, detail);

BatchResponse response = fcmNotificationSender.send(request);
notificationTransactionHelper.handleBatchResponse(response, tokens);
return content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public void notifyApproval(Long targetUserId, Long partyId) {
partyNotificationService.sendApprovalNotification(targetUserId, party.getTitle(), partyId);
}

@Transactional
public void notifyRejection(Long targetUserId, Long partyId) {
Party party = partyRepository.findById(partyId)
.orElseThrow(() -> new BusinessException(PartyErrorCode.PARTY_NOT_FOUND));
Expand Down Expand Up @@ -95,17 +94,37 @@ public void notifyMemberLeave(Long managerId, Long partyId, String leaverName) {
partyNotificationService.sendMemberLeaveNotification(managerId, partyId, leaverName);
}

@Transactional
/*
public void notifyNewChatMessage(
Long targetUserId,
Long chatRoomId,
String senderName,
String messageContent
) {
chatNotificationService.sendNewChatMessage(targetUserId, chatRoomId, senderName, messageContent);
}*/

// 1:1 채팅
public void notifyOneToOneChat(Long targetUserId, Long chatRoomId, String senderName, String content) {
chatNotificationService.sendOneToOneChatMessage(targetUserId, chatRoomId, senderName, content);
}

// 1:1 사진
public void notifyOneToOneImage(Long targetUserId, Long chatRoomId, String senderName) {
chatNotificationService.sendOneToOneChatImage(targetUserId, chatRoomId, senderName);
}

// 단체 채팅
public void notifyGroupChat(Long targetUserId, Long chatRoomId, String partyTitle, String senderName, String content) {
chatNotificationService.sendGroupChatMessage(targetUserId, chatRoomId, partyTitle, senderName, content);
}

// 단체 사진
public void notifyGroupImage(Long targetUserId, Long chatRoomId, String partyTitle, String senderName) {
chatNotificationService.sendGroupChatImage(targetUserId, chatRoomId, partyTitle, senderName);
}

// 스케줄러/채팅 서비스가 호출하며, 알림 도메인은 전송만 처리
// 스케줄러/채팅 서비스가 호출하며, 알림 도메인은 전송만 처리(보류)
@Transactional
public void notifyUnreadReminder(Long targetUserId, Long chatRoomId) {
chatNotificationService.sendUnreadReminderNotification(targetUserId, chatRoomId);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ita/tinybite/domain/party/entity/Party.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public class Party {
@Column(length = 500)
private String thumbnailImage; // 섬네일 이미지 URL

@Column(length = 500)
private String thumbnailImageDetail; // 파티상세 썸네일 이미지 URL

@Column(length = 500)
private List<String> images; // 이미지 URL

Expand Down
25 changes: 22 additions & 3 deletions src/main/java/ita/tinybite/domain/party/service/PartyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class PartyService {
@Value("${default.image.delivery}")
@Value("${default.image.thumbnail.delivery}")
private String defaultDeliveryImage;
@Value("${default.image.grocery}")
@Value("${default.image.thumbnail.grocery}")
private String defaultGroceryImage;
@Value("${default.image.household}")
@Value("${default.image.thumbnail.household}")
private String defaultHouseholdImage;
@Value("${default.image.detail.delivery}")
private String defaultDeliveryDetailImage;
@Value("${default.image.detail.grocery}")
private String defaultGroceryDetailImage;
@Value("${default.image.detail.household}")
private String defaultHouseholdDetailImage;
private final PartyRepository partyRepository;
private final UserRepository userRepository;
private final LocationService locationService;
Expand Down Expand Up @@ -73,6 +79,7 @@ public Long createParty(Long userId, PartyCreateRequest request) {
.build())
.images(getImagesIfPresent(request.getImages()))
.thumbnailImage(getThumbnailIfPresent(request.getImages(), request.getCategory()))
.thumbnailImageDetail(getThumbnailDetailIfPresent(request.getImages(), request.getCategory()))
.link(getLinkIfValid(request.getProductLink(), request.getCategory()))
Comment on lines 80 to 83
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n src/main/java/ita/tinybite/domain/party/service/PartyService.java | head -100

Repository: tinybite-2025/tinybite-server

Length of output: 5243


🏁 Script executed:

rg -n "getThumbnailIfPresent" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 266


🏁 Script executed:

rg -n "getDefaultImageIfEmpty" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 165


🏁 Script executed:

rg -A 20 "private String getThumbnailIfPresent" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 1038


🏁 Script executed:

rg -A 20 "private String getDefaultImageIfEmpty" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 957


🏁 Script executed:

rg -n "getDefaultImageIfEmpty" . --type java

Repository: tinybite-2025/tinybite-server

Length of output: 233


🏁 Script executed:

rg -B 5 -A 10 "switch.*category" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 1857


🏁 Script executed:

rg -n "PartyCategory.ALL" . --type java

Repository: tinybite-2025/tinybite-server

Length of output: 525


🏁 Script executed:

rg -B 10 -A 5 "getThumbnailIfPresent\|getThumbnailDetailIfPresent" src/main/java/ita/tinybite/domain/party/service/PartyService.java | head -80

Repository: tinybite-2025/tinybite-server

Length of output: 55


🏁 Script executed:

rg -n "class PartyCreateRequest" . --type java -A 20

Repository: tinybite-2025/tinybite-server

Length of output: 2398


🏁 Script executed:

rg -n "class PartyUpdateRequest" . --type java -A 20

Repository: tinybite-2025/tinybite-server

Length of output: 2372


🏁 Script executed:

rg -n "@Valid.*category\|@NotNull.*category\|@Column.*nullable" . --type java

Repository: tinybite-2025/tinybite-server

Length of output: 55


🏁 Script executed:

rg -B 5 "createParty\(" src/main/java/ita/tinybite/domain/party/service/PartyService.java | head -20

Repository: tinybite-2025/tinybite-server

Length of output: 192


🏁 Script executed:

rg -n "PartyCategory.ALL" . --type java -B 3 -A 3

Repository: tinybite-2025/tinybite-server

Length of output: 2768


🏁 Script executed:

grep -n "getDefaultImageIfEmpty" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 165


🏁 Script executed:

wc -l src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 142


🏁 Script executed:

sed -n '700,750p' src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 1732


🏁 Script executed:

rg -A 50 "public Long updateParty" src/main/java/ita/tinybite/domain/party/service/PartyService.java | head -60

Repository: tinybite-2025/tinybite-server

Length of output: 55


🏁 Script executed:

sed -n '130,200p' src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 2892


🏁 Script executed:

rg -n "def.*updateParty\|updateParty\(" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 55


🏁 Script executed:

sed -n '105,150p' src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 1818


🏁 Script executed:

rg -n "void updateParty\|Long updateParty" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 55


🏁 Script executed:

rg -B 3 -A 40 "updateParty.*PartyUpdateRequest" src/main/java/ita/tinybite/domain/party/service/PartyService.java

Repository: tinybite-2025/tinybite-server

Length of output: 1770


getThumbnailIfPresent/getThumbnailDetailIfPresent의 category 방어 로직 추가 필요

PartyCreateRequest에서 @NotNull로 검증되어 null은 방지되지만, PartyCategory.ALL 값이 들어올 경우 현재 switch 문의 default 케이스에서 예외를 던집니다. 다음과 같이 명시적으로 처리하는 것이 좋습니다:

제안 diff
 private String getThumbnailIfPresent(List<String> images, PartyCategory category) {
     if (images != null && !images.isEmpty()) {
         return images.get(0);
     }
+    if (category == PartyCategory.ALL) {
+        throw new IllegalArgumentException("파티 생성/수정에는 ALL 카테고리를 사용할 수 없습니다");
+    }
     return switch (category) {
         case DELIVERY -> defaultDeliveryImage;
         case GROCERY -> defaultGroceryImage;
         case HOUSEHOLD -> defaultHouseholdImage;
         default -> throw new IllegalArgumentException("존재하지 않는 카테고리입니다: " + category);
     };
 }

또한 getDefaultImageIfEmpty()는 정의되어 있으나 코드 전체에서 호출되지 않으며, 하드코딩된 경로를 반환하므로 혼동을 야기합니다. 미사용 메서드이므로 삭제하기를 권장합니다.

🤖 Prompt for AI Agents
In @src/main/java/ita/tinybite/domain/party/service/PartyService.java around
lines 80 - 83, getThumbnailIfPresent and getThumbnailDetailIfPresent currently
throw in the switch default when PartyCategory.ALL is passed; update both
methods to explicitly handle PartyCategory.ALL (e.g., treat as no thumbnail or
return a safe value consistent with getImagesIfPresent semantics) instead of
letting the default case throw, and ensure
getThumbnailIfPresent/getThumbnailDetailIfPresent validate request.getCategory()
before switching; also remove the unused getDefaultImageIfEmpty method since
it’s not referenced and returns a hardcoded path that causes confusion.

.description(getDescriptionIfPresent(request.getDescription()))
.currentParticipants(1)
Expand Down Expand Up @@ -672,6 +679,18 @@ private String getThumbnailIfPresent(List<String> images, PartyCategory category
};
}

private String getThumbnailDetailIfPresent(List<String> images, PartyCategory category) {
if (images != null && !images.isEmpty()) {
return images.get(0);
}
return switch (category) {
case DELIVERY -> defaultDeliveryDetailImage;
case GROCERY -> defaultGroceryDetailImage;
case HOUSEHOLD -> defaultHouseholdDetailImage;
default -> throw new IllegalArgumentException("존재하지 않는 카테고리입니다: " + category);
};
}

private String getLinkIfValid(String link, PartyCategory category) {
if (link != null && !link.isBlank()) {
validateProductLink(category, link);
Expand Down
11 changes: 8 additions & 3 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ fcm:

default:
image:
delivery: ${DEFAULT_IMAGE_DELIVERY}
grocery: ${DEFAULT_IMAGE_GROCERY}
household: ${DEFAULT_IMAGE_HOUSEHOLD}
thumbnail:
delivery: ${DEFAULT_IMAGE_DELIVERY}
grocery: ${DEFAULT_IMAGE_GROCERY}
household: ${DEFAULT_IMAGE_HOUSEHOLD}
detail:
delivery: ${DEFAULT_DETAIL_IMAGE_DELIVERY}
grocery: ${DEFAULT_DETAIL_IMAGE_GROCERY}
household: ${DEFAULT_DETAIL_IMAGE_HOUSEHOLD}