-
Notifications
You must be signed in to change notification settings - Fork 0
Feature : party 참여, 승인, 거절 #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
bce7dbc
feat : 닉네임 중복 체크 (nickname unique), 인증코드 검사 예외처리 추가
yyytir777 3573613
fix : user_id IDENTITY strategy & dev redis host 이름변경 (localhost -> r…
yyytir777 08cfb63
test코드 생성 & swagger url 삭제 & 환경변수 중복 삭제
yyytir777 ac96fa0
fix : 엔드포인트 추가
yyytir777 43e75ed
Merge pull request #27 from tinybite-2025/feature/13-user
yyytir777 a70941b
Feature/26 notification (#29)
marshmallowing cbbf597
feat : google login 구현 완료
yyytir777 d03fd30
fix : main push 시에만 workflow trigger
yyytir777 4bc8ff6
feat : 파티 엔티티 정의
milowon 3cb18ec
feat : 파티 dto
milowon f94eeb5
feat : party dto 정의
milowon d1bc8c3
feat : party entity 정의
milowon b2fb979
feat : 파티 생성,수정,삭제, 조회
milowon 88d4fb6
feat : 거리 계산 클래스
milowon d4a9bf0
refactor : 불필요한 코드 삭제
milowon f21bc6b
refactor : token provider로 유저 아이디 추출하도록 변경
milowon bea737a
Fix: 파티 기능 버그 수정
milowon 929f3b5
docs : 파티 swagger 문서 추가
milowon 78576ea
feat : party, chat 엔티티
milowon da05f29
feat : party,chat enum
milowon 9daf2f4
feat : party 기능
milowon 0079372
feat : 파티 참여, 승인 기능
milowon 1897296
Squashed commit of the following:
milowon 8d7d3b4
docs : party controller swagger 문서
milowon db2e838
Merge branch 'main' into feature/party
milowon cccc27e
docs : party controller swagger 문서
milowon 3928e56
Merge branch 'feature/party' of https://github.com/tinybite-2025/tiny…
milowon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/ita/tinybite/domain/chat/entity/ChatRoom.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| package ita.tinybite.domain.chat.entity; | ||
|
|
||
| import ita.tinybite.domain.chat.enums.ChatRoomType; | ||
| import ita.tinybite.domain.party.entity.Party; | ||
| import jakarta.persistence.*; | ||
| import lombok.*; | ||
| import org.hibernate.annotations.CreationTimestamp; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| @Entity | ||
| @Table(name = "chat_room") | ||
| @Getter | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @AllArgsConstructor | ||
| @Builder | ||
| public class ChatRoom { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "party_id", nullable = false) | ||
| private Party party; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @Column(nullable = false, length = 20) | ||
| private ChatRoomType type; | ||
|
|
||
| @Column(nullable = false, length = 100) | ||
| private String name; | ||
|
|
||
| @Column(nullable = false) | ||
| @Builder.Default | ||
| private Boolean isActive = true; | ||
|
|
||
| @CreationTimestamp | ||
| @Column(nullable = false, updatable = false) | ||
| private LocalDateTime createdAt; | ||
|
|
||
| @OneToMany(mappedBy = "chatRoom", cascade = CascadeType.ALL, orphanRemoval = true) | ||
| @Builder.Default | ||
| private List<ChatRoomMember> members = new ArrayList<>(); | ||
|
|
||
| // ========== 비즈니스 메서드 ========== | ||
|
|
||
| /** | ||
| * 멤버 추가 | ||
| */ | ||
| public void addMember(ita.tinybite.domain.user.entity.User user) { | ||
| ChatRoomMember member = ChatRoomMember.builder() | ||
| .chatRoom(this) | ||
| .user(user) | ||
| .isActive(true) | ||
| .build(); | ||
| members.add(member); | ||
| } | ||
|
|
||
| /** | ||
| * 채팅방 비활성화 | ||
| */ | ||
| public void deactivate() { | ||
| this.isActive = false; | ||
| } | ||
| } |
52 changes: 52 additions & 0 deletions
52
src/main/java/ita/tinybite/domain/chat/entity/ChatRoomMember.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package ita.tinybite.domain.chat.entity; | ||
|
|
||
| import ita.tinybite.domain.party.entity.Party; | ||
| import ita.tinybite.domain.user.entity.User; | ||
| import jakarta.persistence.*; | ||
| import lombok.*; | ||
| import org.hibernate.annotations.CreationTimestamp; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| @Entity | ||
| @Table(name = "chat_room_member") | ||
| @Getter | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @AllArgsConstructor | ||
| @Builder | ||
| public class ChatRoomMember { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "chat_room_id", nullable = false) | ||
| private ChatRoom chatRoom; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "user_id", nullable = false) | ||
| private User user; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "party_id") | ||
| private Party party; | ||
|
|
||
| @Column(nullable = false) | ||
| @Builder.Default | ||
| private Boolean isActive = true; | ||
|
|
||
| @CreationTimestamp | ||
| @Column(nullable = false, updatable = false) | ||
| private LocalDateTime joinedAt; | ||
|
|
||
| private LocalDateTime leftAt; | ||
|
|
||
| /** | ||
| * 퇴장 | ||
| */ | ||
| public void leave() { | ||
| this.isActive = false; | ||
| this.leftAt = LocalDateTime.now(); | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
src/main/java/ita/tinybite/domain/chat/enums/ChatRoomType.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package ita.tinybite.domain.chat.enums; | ||
|
|
||
| import lombok.AccessLevel; | ||
| import lombok.Getter; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @Getter | ||
| @RequiredArgsConstructor(access = AccessLevel.PROTECTED) | ||
| public enum ChatRoomType { | ||
| ONE_TO_ONE("1:1 채팅"), | ||
| GROUP("단체 채팅"); | ||
|
|
||
| private final String description; | ||
| } |
14 changes: 14 additions & 0 deletions
14
src/main/java/ita/tinybite/domain/chat/enums/ParticipantRole.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package ita.tinybite.domain.chat.enums; | ||
|
|
||
| import lombok.AccessLevel; | ||
| import lombok.Getter; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @Getter | ||
| @RequiredArgsConstructor(access = AccessLevel.PROTECTED) | ||
| public enum ParticipantRole { | ||
| LEADER("리더", "파티를 생성하고 관리하는 리더"), | ||
| MEMBER("멤버", "일반 참가자"); | ||
| private final String displayName; | ||
| private final String description; | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/main/java/ita/tinybite/domain/chat/repository/ChatRoomRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package ita.tinybite.domain.chat.repository; | ||
|
|
||
| import ita.tinybite.domain.chat.entity.ChatRoom; | ||
| import ita.tinybite.domain.chat.enums.ChatRoomType; | ||
| import ita.tinybite.domain.party.entity.Party; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| @Repository | ||
| public interface ChatRoomRepository extends JpaRepository<ChatRoom, Long> { | ||
|
|
||
| Optional<ChatRoom> findByPartyAndType(Party party, ChatRoomType type); | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그아웃 시 사용자를 삭제하지 마세요 - 치명적인 버그
Line 358에서 로그아웃 시 사용자를 데이터베이스에서 삭제합니다. 이는 매우 위험한 버그로, 다음과 같은 문제를 발생시킵니다:
로그아웃은 세션/토큰만 정리해야 하며, 사용자 데이터는 삭제하지 않아야 합니다. 회원 탈퇴는 별도의 엔드포인트로 처리해야 합니다.
🔎 수정 제안
@Transactional public void logout(Long userId) { refreshTokenRepository.deleteByUserId(userId); - userRepository.deleteById(userId); log.info("로그아웃 - User ID: {}", userId); }회원 탈퇴 기능이 필요한 경우, 별도의 메서드를 생성하세요:
🤖 Prompt for AI Agents