-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 참여 물품 개수 필드 추가 * feat: 참여 시 개수 함께 요청 * feat: 참여 취소 시 요청 개수 전체 취소 * feat: 참여자 목록 조회 시 참여 개수 및 가격 필드 추가 * feat: 공모 생성 시 총대의 구매 개수 필드 추가 (이전 버전 고려) * feat: 이전 버전을 고려하여 요청 DTO에서 null 값 관리 * test: 네이밍 구체화 및 문서화 작업 * test: 참여 기능 동시성 테스트 추가
- Loading branch information
Showing
18 changed files
with
707 additions
and
498 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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
12 changes: 8 additions & 4 deletions
12
.../src/main/java/com/zzang/chongdae/offeringmember/service/dto/ParticipantResponseItem.java
This file contains 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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package com.zzang.chongdae.offeringmember.service.dto; | ||
|
||
import com.zzang.chongdae.member.repository.entity.MemberEntity; | ||
import com.zzang.chongdae.offeringmember.repository.entity.OfferingMemberEntity; | ||
|
||
public record ParticipantResponseItem(String nickname) { | ||
public record ParticipantResponseItem(String nickname, | ||
Integer count, | ||
Integer price) { | ||
|
||
public ParticipantResponseItem(MemberEntity offeringMember) { | ||
this(offeringMember.getNickname()); | ||
public ParticipantResponseItem(OfferingMemberEntity offeringMember, int pricePerOne) { | ||
this(offeringMember.getMember().getNickname(), | ||
offeringMember.getParticipationCount(), | ||
offeringMember.getParticipationCount() * pricePerOne); | ||
} | ||
} |
10 changes: 9 additions & 1 deletion
10
...end/src/main/java/com/zzang/chongdae/offeringmember/service/dto/ParticipationRequest.java
This file contains 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 |
---|---|---|
@@ -1,7 +1,15 @@ | ||
package com.zzang.chongdae.offeringmember.service.dto; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import java.util.Objects; | ||
|
||
public record ParticipationRequest(@NotNull | ||
Long offeringId) { | ||
Long offeringId, | ||
|
||
Integer participationCount) { | ||
|
||
@Override | ||
public Integer participationCount() { | ||
return Objects.requireNonNullElse(participationCount, 1); | ||
} | ||
} |
12 changes: 8 additions & 4 deletions
12
...end/src/main/java/com/zzang/chongdae/offeringmember/service/dto/ProposerResponseItem.java
This file contains 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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package com.zzang.chongdae.offeringmember.service.dto; | ||
|
||
import com.zzang.chongdae.member.repository.entity.MemberEntity; | ||
import com.zzang.chongdae.offeringmember.repository.entity.OfferingMemberEntity; | ||
|
||
public record ProposerResponseItem(String nickname) { | ||
public record ProposerResponseItem(String nickname, | ||
Integer count, | ||
Integer price) { | ||
|
||
public ProposerResponseItem(MemberEntity member) { | ||
this(member.getNickname()); | ||
public ProposerResponseItem(OfferingMemberEntity offeringMember, int pricePerOne) { | ||
this(offeringMember.getMember().getNickname(), | ||
offeringMember.getParticipationCount(), | ||
offeringMember.getParticipationCount() * pricePerOne); | ||
} | ||
} |
Oops, something went wrong.