-
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 #126 from ootd-zip/feature/search-clothes
Feature/search clothes
- Loading branch information
Showing
21 changed files
with
220 additions
and
174 deletions.
There are no files selected for viewing
28 changes: 23 additions & 5 deletions
28
src/main/java/zip/ootd/ootdzip/category/data/DetailCategory.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,19 +1,37 @@ | ||
package zip.ootd.ootdzip.category.data; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import zip.ootd.ootdzip.category.domain.Category; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@Getter | ||
@NoArgsConstructor | ||
@Builder | ||
public class DetailCategory { | ||
|
||
private Long id; | ||
|
||
private String categoryName; | ||
|
||
private Long parentCategoryId; | ||
|
||
private String parentCategoryName; | ||
|
||
@Builder | ||
private DetailCategory(Long id, String categoryName, Long parentCategoryId, String parentCategoryName) { | ||
this.id = id; | ||
this.categoryName = categoryName; | ||
this.parentCategoryId = parentCategoryId; | ||
this.parentCategoryName = parentCategoryName; | ||
} | ||
|
||
public static DetailCategory of(Category category) { | ||
return DetailCategory.builder() | ||
.id(category.getId()) | ||
.categoryName(category.getName()) | ||
.parentCategoryId(category.getParentCategoryId()) | ||
.parentCategoryName(category.getParentCategoryName()) | ||
.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
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
27 changes: 0 additions & 27 deletions
27
src/main/java/zip/ootd/ootdzip/clothes/controller/request/UpdateClothesIsOpenReq.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
src/main/java/zip/ootd/ootdzip/clothes/controller/request/UpdateClothesIsPrivateReq.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,27 @@ | ||
package zip.ootd.ootdzip.clothes.controller.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import zip.ootd.ootdzip.clothes.service.request.UpdateClothesIsPrivateSvcReq; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class UpdateClothesIsPrivateReq { | ||
|
||
@NotNull(message = "공개여부는 필수입니다.") | ||
private Boolean isPrivate; | ||
|
||
@Builder | ||
private UpdateClothesIsPrivateReq(Boolean isPrivate) { | ||
this.isPrivate = isPrivate; | ||
} | ||
|
||
public UpdateClothesIsPrivateSvcReq toServiceRequest(Long clothesId) { | ||
return UpdateClothesIsPrivateSvcReq.builder() | ||
.clothesId(clothesId) | ||
.isPrivate(this.isPrivate) | ||
.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
18 changes: 14 additions & 4 deletions
18
src/main/java/zip/ootd/ootdzip/clothes/data/ClothesColorDto.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,30 +1,40 @@ | ||
package zip.ootd.ootdzip.clothes.data; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import zip.ootd.ootdzip.clothes.domain.ClothesColor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
public class ClothesColorDto { | ||
|
||
private Long id; | ||
|
||
private String colorCode; | ||
|
||
private String name; | ||
|
||
@Builder | ||
private ClothesColorDto(Long id, String colorCode, String name) { | ||
this.id = id; | ||
this.colorCode = colorCode; | ||
this.name = name; | ||
} | ||
|
||
public static ClothesColorDto createClothesColorDtoBy(ClothesColor clothesColor) { | ||
return ClothesColorDto.builder() | ||
.id(clothesColor.getId()) | ||
.id(clothesColor.getColor().getId()) | ||
.colorCode(clothesColor.getColor().getColorCode()) | ||
.name(clothesColor.getColor().getName()) | ||
.build(); | ||
} | ||
|
||
public static List<ClothesColorDto> createClothesColorDtosBy(List<ClothesColor> clothesColors) { | ||
return clothesColors.stream() | ||
.map(ClothesColorDto::createClothesColorDtoBy) | ||
.collect(Collectors.toList()); | ||
.toList(); | ||
} | ||
} |
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
Oops, something went wrong.