Skip to content

Commit

Permalink
[fix] 내 팜클럽 조회 시 활동일수 이상한거 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchoGreenT committed Jul 3, 2024
1 parent b94dc34 commit f763221
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public record GetMyFarmClubResponseDto(
Long wholeMemberCount,
List<Step> steps,
String advice,
int daysSinceStart
Long daysSinceStart
) {

public static GetMyFarmClubResponseDto of(GetMyFarmClubVo farmClubInfo, List<Step> steps, String advice) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public record GetMyFarmClubVo(

String farmClubName,
String farmClubImage,
String veggieInfoId,
Long wholeMemberCount,
Integer daySinceStart
Long daySinceStart
) {
public static GetMyFarmClubVo of(BaseInfo baseInfo, Long wholeMemberCount, LocalDate dayRegister) {
return new GetMyFarmClubVo(
baseInfo.farmClubName(),
baseInfo.farmClubImage(),
baseInfo.veggieInfoId(),
wholeMemberCount,
LocalDate.now().compareTo(dayRegister)
ChronoUnit.DAYS.between(dayRegister, LocalDate.now())
);
}

Expand Down

0 comments on commit f763221

Please sign in to comment.