-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from PLADI-ALM/feat/PDS-135-search-projects
[PDS-135] 아카이빙 프로젝트 목록 조회 API
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 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
31 changes: 31 additions & 0 deletions
31
src/main/java/com/example/PLADIALMArchiving/archiving/dto/response/SearchProjectRes.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.example.PLADIALMArchiving.archiving.dto.response; | ||
|
||
import com.example.PLADIALMArchiving.archiving.entity.Project; | ||
import com.example.PLADIALMArchiving.global.Constants; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
import java.time.format.DateTimeFormatter; | ||
|
||
@Data | ||
public class SearchProjectRes { | ||
private Long projectId; | ||
private String projectName; | ||
private String createdAt; | ||
|
||
@Builder | ||
public SearchProjectRes(Long projectId, String projectName, String createdAt) { | ||
this.projectId = projectId; | ||
this.projectName = projectName; | ||
this.createdAt = createdAt; | ||
} | ||
|
||
public static SearchProjectRes toDto(Project project) { | ||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(Constants.DATE_PATTERN); | ||
return SearchProjectRes.builder() | ||
.projectId(project.getProjectId()) | ||
.projectName(project.getName()) | ||
.createdAt(project.getCreatedAt().format(dateTimeFormatter)) | ||
.build(); | ||
} | ||
} |
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