Skip to content

Commit a4437de

Browse files
committed
feat(party): Request, Response 추가
1 parent 232b64f commit a4437de

File tree

8 files changed

+169
-0
lines changed

8 files changed

+169
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.back.matchduo.domain.party.dto.request;
2+
3+
public record PartyCloseRequest(
4+
Long partyId
5+
) {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.back.matchduo.domain.party.dto.request;
2+
3+
import jakarta.validation.constraints.NotEmpty;
4+
5+
import java.util.List;
6+
7+
public record PartyMemberAddRequest(
8+
@NotEmpty(message = "추가할 유저를 최소 1명 이상 선택해주세요.")
9+
List<Long> targetUserIds // 다인파티 확정성 고려하여 List로 받음
10+
) {}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.back.matchduo.domain.party.dto.response;
2+
3+
import com.back.matchduo.domain.party.entity.PartyMemberRole;
4+
import com.back.matchduo.domain.party.entity.PartyStatus;
5+
6+
import java.time.LocalDateTime;
7+
import java.util.List;
8+
9+
public record MyPartyListResponse(
10+
List<MyPartyDto> parties
11+
) {
12+
public record MyPartyDto(
13+
Long partyId,
14+
Long postId,
15+
String postTitle,
16+
String gameMode,
17+
PartyStatus status,
18+
PartyMemberRole myRole,
19+
LocalDateTime joinedAt
20+
) {
21+
public static MyPartyDto of(Long partyId, Long postId, String postTitle, String gameMode, PartyStatus status, PartyMemberRole myRole, LocalDateTime joinedAt) {
22+
return new MyPartyDto(
23+
partyId,
24+
postId,
25+
postTitle,
26+
gameMode,
27+
status,
28+
myRole,
29+
joinedAt
30+
);
31+
}
32+
}
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.back.matchduo.domain.party.dto.response;
2+
3+
import com.back.matchduo.domain.party.entity.PartyMemberRole;
4+
import com.back.matchduo.domain.party.entity.PartyStatus;
5+
6+
import java.time.LocalDateTime;
7+
import java.util.List;
8+
9+
public record PartyByPostResponse(
10+
Long partyId,
11+
Long postId,
12+
PartyStatus status,
13+
int currentCount,
14+
int maxCount,
15+
LocalDateTime createdAt,
16+
boolean isJoined,
17+
List<PartyMemberDto> members
18+
) {
19+
public record PartyMemberDto(
20+
Long partyMemberId,
21+
Long userId,
22+
String nickname,
23+
String profileImage,
24+
PartyMemberRole role
25+
) {
26+
public static PartyMemberDto of(Long partyMemberId, Long userId, String nickname, String profileImage, PartyMemberRole role) {
27+
return new PartyMemberDto(partyMemberId, userId, nickname, profileImage, role);
28+
}
29+
}
30+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.back.matchduo.domain.party.dto.response;
2+
3+
import java.time.LocalDateTime;
4+
5+
public record PartyCloseResponse(
6+
Long partyId,
7+
String status, // "CLOSED"
8+
LocalDateTime closedAt
9+
) {}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.back.matchduo.domain.party.dto.response;
2+
3+
import com.back.matchduo.domain.party.entity.PartyMember;
4+
import com.back.matchduo.domain.party.entity.PartyMemberRole;
5+
import com.back.matchduo.domain.party.entity.PartyMemberState;
6+
7+
import java.time.LocalDateTime;
8+
9+
public record PartyMemberAddResponse(
10+
Long partyMemberId,
11+
Long userId,
12+
String nickname,
13+
String profileImage,
14+
PartyMemberRole role,// LEADER / MEMBER
15+
PartyMemberState state,// JOINED
16+
LocalDateTime joinedAt
17+
) {
18+
public static PartyMemberAddResponse of(PartyMember member, String nickname, String profileImage) {
19+
return new PartyMemberAddResponse(
20+
member.getId(),
21+
member.getUserId(),
22+
nickname,
23+
profileImage,
24+
member.getRole(),
25+
member.getState(),
26+
member.getJoinedAt()
27+
);
28+
}
29+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.back.matchduo.domain.party.dto.response;
2+
3+
import com.back.matchduo.domain.party.entity.PartyMemberRole;
4+
5+
import java.time.LocalDateTime;
6+
import java.util.List;
7+
8+
public record PartyMemberListResponse(
9+
Long partyId,
10+
int currentCount,
11+
int maxCount,
12+
List<PartyMemberDto> members
13+
) {
14+
public record PartyMemberDto(
15+
Long partyMemberId,
16+
Long userId,
17+
String nickname,
18+
String profileImage,
19+
PartyMemberRole role, // LEADER / MEMBER
20+
LocalDateTime joinedAt
21+
) {
22+
public static PartyMemberDto of(Long partyMemberId, Long userId, PartyMemberRole role, LocalDateTime joinedAt, String nickname, String profileImage) {
23+
return new PartyMemberDto(
24+
partyMemberId,
25+
userId,
26+
nickname,
27+
profileImage,
28+
role,
29+
joinedAt
30+
);
31+
}
32+
}
33+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.back.matchduo.domain.party.dto.response;
2+
3+
import com.back.matchduo.domain.party.entity.PartyMember;
4+
import java.time.LocalDateTime;
5+
6+
public record PartyMemberRemoveResponse(
7+
Long partyMemberId,
8+
Long userId,
9+
String state,// "LEFT"
10+
LocalDateTime leftAt
11+
) {
12+
public static PartyMemberRemoveResponse from(PartyMember member) {
13+
return new PartyMemberRemoveResponse(
14+
member.getId(),
15+
member.getUserId(),
16+
member.getState().name(),
17+
member.getLeftAt()
18+
);
19+
}
20+
}

0 commit comments

Comments
 (0)