-
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.
Browse files
Browse the repository at this point in the history
* rename: modify ClassSideNoteRequest to ClassSideNoteRequestDTO * rename: modify ClassSideNoteResponse to ClassSideNoteResponseDTO * feat: create ClassSideNoteConverter * feat: create ClassSideNoteConverter * feat: apply modified ClassSideNoteService * refactor: modify update function * refactor: modify class name * refactor: modify class name * refactor: apply modified class name * refactor: apply modified class name * refactor: modify function name * refactor: apply modified class name and function name
- Loading branch information
1 parent
b17606c
commit 5684966
Showing
8 changed files
with
155 additions
and
125 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
30 changes: 30 additions & 0 deletions
30
src/main/java/UMC/campusNote/classSideNote/converter/ClassSideNoteConverter.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,30 @@ | ||
package UMC.campusNote.classSideNote.converter; | ||
|
||
import UMC.campusNote.classSideNote.dto.ClassSideNoteResponseDTO.ClassSideNoteResultDTO; | ||
import UMC.campusNote.classSideNote.entity.ClassSideNote; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class ClassSideNoteConverter { | ||
public ClassSideNoteResultDTO toClassSideNoteResultDTO(ClassSideNote classSideNote) { | ||
return ClassSideNoteResultDTO.builder() | ||
.id(classSideNote.getId()) | ||
.content(classSideNote.getContent()) | ||
.isTodo(classSideNote.getIsTodo()) | ||
.colorCode(classSideNote.getColorCode()) | ||
.deadline(classSideNote.getDeadline() != null ? | ||
classSideNote.getDeadline().toString() : null) | ||
.build(); | ||
} | ||
|
||
public List<ClassSideNoteResultDTO> toClassSideNoteResultDTOList(List<ClassSideNote> classSideNoteList) { | ||
return classSideNoteList.stream() | ||
.map(this::toClassSideNoteResultDTO) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
34 changes: 0 additions & 34 deletions
34
src/main/java/UMC/campusNote/classSideNote/dto/ClassSideNoteRequest.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/main/java/UMC/campusNote/classSideNote/dto/ClassSideNoteRequestDTO.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,43 @@ | ||
package UMC.campusNote.classSideNote.dto; | ||
|
||
import jakarta.validation.constraints.Max; | ||
import jakarta.validation.constraints.Min; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
import lombok.Setter; | ||
|
||
import java.time.LocalDate; | ||
|
||
|
||
public class ClassSideNoteRequestDTO { | ||
@Getter | ||
@Setter | ||
@Builder | ||
public static class ClassSideNoteCreateDTO { | ||
@NotBlank | ||
private String content; | ||
|
||
@NonNull | ||
private Boolean isTodo; | ||
|
||
@NonNull | ||
@Min(0x000000) | ||
@Max(0xffffff) | ||
private Integer colorCode; | ||
|
||
private LocalDate deadline; | ||
} | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
public static class ClassSideNoteUpdateDTO { | ||
@NonNull | ||
private String content; | ||
|
||
private LocalDate deadline; | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
src/main/java/UMC/campusNote/classSideNote/dto/ClassSideNoteResponse.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
src/main/java/UMC/campusNote/classSideNote/dto/ClassSideNoteResponseDTO.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,33 @@ | ||
package UMC.campusNote.classSideNote.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
import lombok.Setter; | ||
|
||
|
||
public class ClassSideNoteResponseDTO { | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
@AllArgsConstructor | ||
public static class ClassSideNoteResultDTO { | ||
@NonNull | ||
private Long id; | ||
|
||
@NonNull | ||
private String content; | ||
|
||
@NonNull | ||
private Boolean isTodo; | ||
|
||
@NonNull | ||
private Integer colorCode; | ||
|
||
private String deadline; | ||
} | ||
|
||
|
||
} |
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
Oops, something went wrong.