-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: 방 참여, 나가기 기능 구현 #28
Changes from 27 commits
034ee6e
bb3add1
ece1678
b067abb
00558f6
20cc332
25d0044
2dd7c1a
7b8ff99
86b2b53
051d56e
a35ce88
c299ac3
334cd6f
c0be2c9
ebb5132
8b08467
77f51ad
3b71611
4df9541
f3cc036
0753648
0db0a20
d256953
7ce8ccc
b40b601
d8a66df
3c280c9
a24e88f
28288e9
a27c9eb
92c512d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ public class Participant { | |
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "room_id", updatable = false, nullable = false) | ||
@JoinColumn(name = "room_id", updatable = false) | ||
private Room room; | ||
|
||
@Column(name = "member_id", updatable = false, nullable = false) | ||
|
@@ -48,6 +48,9 @@ public class Participant { | |
@Column(name = "deleted_at") | ||
private LocalDateTime deletedAt; | ||
|
||
@Column(name = "deleted_room_title", length = 30) | ||
private String deletedRoomTitle; | ||
|
||
@Builder | ||
private Participant(Long id, Room room, Long memberId) { | ||
this.id = id; | ||
|
@@ -68,4 +71,9 @@ public void enableManager() { | |
public void updateCertifyCount() { | ||
this.certifyCount += 1; | ||
} | ||
|
||
public void removeRoom() { | ||
this.deletedRoomTitle = this.room.getTitle(); | ||
this.room = null; | ||
} | ||
Comment on lines
+75
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 고냥 저는 Room도 soft delete 하는게 낫지 않을까 개인적인 생각 ㅋ.ㅋ |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.moabam.api.dto; | ||
|
||
import jakarta.validation.constraints.Pattern; | ||
|
||
public record EnterRoomRequest( | ||
@Pattern(regexp = "^(|[0-9]{4,8})$") String password | ||
) { | ||
|
||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,12 +12,16 @@ public enum ErrorMessage { | |||||
ROOM_NOT_FOUND("존재하지 않는 방 입니다."), | ||||||
ROOM_MAX_USER_COUNT_MODIFY_FAIL("잘못된 최대 인원수 설정입니다."), | ||||||
ROOM_MODIFY_UNAUTHORIZED_REQUEST("방장이 아닌 사용자는 방을 수정할 수 없습니다."), | ||||||
ROOM_EXIT_MANAGER_FAIL("인원수가 2명 이상일때는 방장을 위임해야합니다."), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
ㅋㅋ해줭 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 히히 |
||||||
PARTICIPANT_NOT_FOUND("방에 대한 참여자의 정보가 없습니다."), | ||||||
WRONG_ROOM_PASSWORD("방의 비밀번호가 일치하지 않습니다."), | ||||||
ROOM_MAX_USER_REACHED("방의 인원수가 찼습니다."), | ||||||
|
||||||
LOGIN_FAILED("로그인에 실패했습니다."), | ||||||
REQUEST_FAILED("네트워크 접근 실패입니다."), | ||||||
GRANT_FAILED("인가 코드 실패"), | ||||||
MEMBER_NOT_FOUND("존재하지 않는 회원입니다."), | ||||||
MEMBER_ROOM_EXCEED("참여할 수 있는 방의 갯수가 모두 찼습니다."), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
헤헤 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋ.ㅋ |
||||||
|
||||||
INVALID_BUG_COUNT("벌레 개수는 0 이상이어야 합니다."), | ||||||
INVALID_PRICE("가격은 0 이상이어야 합니다."), | ||||||
|
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.
이 로직은 MemberService 보다는 Room 도메인의 책임같아 보여요!
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.
increaseRoomCount, decreaseRoomCount도 MemberService가 가져야 할 책임인지 고민해보면 좋을 것 같아요