-
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 #67 from Team-Shaka/feature/64
Feature/64-트리하우스 목록 조회 및 변경 API 조회
- Loading branch information
Showing
12 changed files
with
156 additions
and
13 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
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
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
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
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
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
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
21 changes: 21 additions & 0 deletions
21
src/main/java/org/example/tree/domain/tree/converter/TreeConverter.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 |
---|---|---|
@@ -1,13 +1,34 @@ | ||
package org.example.tree.domain.tree.converter; | ||
|
||
import org.example.tree.domain.profile.entity.Profile; | ||
import org.example.tree.domain.tree.dto.TreeResponseDTO; | ||
import org.example.tree.domain.tree.entity.Tree; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Component | ||
public class TreeConverter { | ||
public Tree toTree (String name) { | ||
return Tree.builder() | ||
.name(name) | ||
.build(); | ||
} | ||
|
||
public TreeResponseDTO.getTree toGetTree(Tree tree, List<String> treeMemberProfileImages, Profile currentProfile) { | ||
Boolean isSelected = currentProfile.getTree().getId().equals(tree.getId()); | ||
return TreeResponseDTO.getTree.builder() | ||
.treeName(tree.getName()) | ||
.treeSize(tree.getTreeSize()) | ||
.treeMemberProfileImages(treeMemberProfileImages) | ||
.isSelected(isSelected) | ||
.build(); | ||
} | ||
|
||
public TreeResponseDTO.shiftTree toShiftTree(Tree tree) { | ||
return TreeResponseDTO.shiftTree.builder() | ||
.treeId(tree.getId()) | ||
.build(); | ||
} | ||
} |
28 changes: 21 additions & 7 deletions
28
src/main/java/org/example/tree/domain/tree/dto/TreeResponseDTO.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 |
---|---|---|
@@ -1,13 +1,27 @@ | ||
package org.example.tree.domain.tree.dto; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.*; | ||
|
||
import java.util.List; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class TreeResponseDTO { | ||
// @Getter | ||
// public static class registerTree { | ||
// private String treeName; | ||
// } | ||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class getTree { | ||
private String treeName; | ||
private Integer treeSize; | ||
private List<String> treeMemberProfileImages; | ||
private Boolean isSelected; | ||
} | ||
|
||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public static class shiftTree { | ||
private Long treeId; | ||
} | ||
} |
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
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
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