Skip to content

Commit

Permalink
fix: 공모 상세 조희 API의 price 필드 자료형 변경 및 memberId 필드 추가 (#28)
Browse files Browse the repository at this point in the history
* fix: 상세조회 API 금액 필드 자료형 변경

Co-authored-by: Dora Choo <[email protected]>

* fix: memberId 추가

* 내가 쓴 글인지 아닌지 확인 위해
Co-authored-by: Dora Choo <[email protected]>

---------

Co-authored-by: Dora Choo <[email protected]>
  • Loading branch information
fromitive and ChooSeoyeon committed Oct 11, 2024
1 parent 3c80134 commit 51d10b7
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import com.zzang.chongdae.offering.domain.OfferingPrice;
import com.zzang.chongdae.offering.domain.OfferingStatus;
import com.zzang.chongdae.offering.repository.entity.OfferingEntity;
import java.math.BigDecimal;
import java.time.LocalDateTime;

public record OfferingDetailResponse(Long id,
String title,
String nickname,
Long memberId,
String productUrl,
String meetingAddress,
String meetingAddressDetail,
Expand All @@ -18,14 +18,15 @@ public record OfferingDetailResponse(Long id,
Integer currentCount,
Integer totalCount,
String thumbnailUrl,
BigDecimal dividedPrice,
BigDecimal totalPrice,
Integer dividedPrice,
Integer totalPrice,
OfferingCondition status) {

public OfferingDetailResponse(OfferingEntity offering, OfferingPrice offeringPrice, OfferingStatus offeringStatus) {
this(offering.getId(),
offering.getTitle(),
offering.getMember().getNickname(),
offering.getMember().getId(),
offering.getProductUrl(),
offering.getMeetingAddress(),
offering.getMeetingAddressDetail(),
Expand All @@ -34,8 +35,8 @@ public OfferingDetailResponse(OfferingEntity offering, OfferingPrice offeringPri
offeringStatus.getCurrentCount(),
offering.getTotalCount(),
offering.getThumbnailUrl(),
offeringPrice.calculateDividedPrice(),
offering.getTotalPrice(),
offeringPrice.calculateDividedPrice().intValue(),
offering.getTotalPrice().intValue(),
offeringStatus.decideOfferingCondition()
);
}
Expand Down

0 comments on commit 51d10b7

Please sign in to comment.