Skip to content

Commit 3348050

Browse files
committed
fix project summery add year
1 parent 95d06f9 commit 3348050

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/main/java/NextLevel/demo/summery/dto/ProjectSummeryDto.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package NextLevel.demo.summery.dto;
22

3-
import java.time.LocalDate;
3+
import java.time.LocalDateTime;
44
import lombok.Getter;
55
import lombok.NoArgsConstructor;
66
import lombok.Setter;
@@ -13,9 +13,11 @@ public class ProjectSummeryDto {
1313
private Integer month;
1414
private Long userCount;
1515
private Long fundingPrice;
16+
private int year;
1617

17-
public ProjectSummeryDto(Integer month, Long userCount, Long fundingPrice) {
18-
this.month = month;
18+
public ProjectSummeryDto(LocalDateTime date, Long userCount, Long fundingPrice) {
19+
this.month = date.getMonth().getValue();
20+
this.year = date.getYear();
1921
this.userCount = userCount;
2022
this.fundingPrice = fundingPrice;
2123
}

src/main/java/NextLevel/demo/summery/service/SummeryService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private ProjectSummeryDto getProjectSummeryDto(long projectId, LocalDateTime sta
7575

7676
Long totalFundingPrice = (totalFreePrice != null ? totalFreePrice : 0L) + (totalOptionPrice != null ? totalOptionPrice : 0L);
7777

78-
return new ProjectSummeryDto(start.getMonthValue(), totalUserCount, totalFundingPrice);
78+
return new ProjectSummeryDto(start, totalUserCount, totalFundingPrice);
7979
}
8080

8181
@Transactional

0 commit comments

Comments
 (0)