-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bde5fec
commit e1b3fa0
Showing
12 changed files
with
407 additions
and
15 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
backend/src/main/java/com/happy/friendogly/infra/ImageUpdateType.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,28 @@ | ||
package com.happy.friendogly.infra; | ||
|
||
import com.happy.friendogly.exception.FriendoglyException; | ||
import java.util.Arrays; | ||
import java.util.stream.Collectors; | ||
|
||
public enum ImageUpdateType { | ||
|
||
UPDATE, | ||
NOT_UPDATE, | ||
DELETE; | ||
|
||
public static ImageUpdateType from(String rawImageUpdateType) { | ||
try { | ||
return valueOf(rawImageUpdateType); | ||
} catch (IllegalArgumentException e) { | ||
throw new FriendoglyException( | ||
String.format("존재하지 않는 ImageUpdateType 입니다. %s 중 하나로 입력해주세요.", createAllowedValues()) | ||
); | ||
} | ||
} | ||
|
||
private static String createAllowedValues() { | ||
return Arrays.stream(values()) | ||
.map(Enum::name) | ||
.collect(Collectors.joining(", ")); | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
backend/src/main/java/com/happy/friendogly/pet/dto/request/UpdatePetRequest.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,32 @@ | ||
package com.happy.friendogly.pet.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.PastOrPresent; | ||
import jakarta.validation.constraints.Size; | ||
import java.time.LocalDate; | ||
|
||
public record UpdatePetRequest( | ||
@NotBlank(message = "name은 빈 문자열이나 null을 입력할 수 없습니다.") | ||
@Size(max = 8, message = "이름은 1글자 이상 8글자 이하여야 합니다.") | ||
String name, | ||
|
||
@NotBlank(message = "description은 빈 문자열이나 null을 입력할 수 없습니다.") | ||
@Size(max = 20, message = "설명은 1글자 이상 20글자 이하여야 합니다.") | ||
String description, | ||
|
||
@NotNull(message = "birthDate는 빈 문자열이나 null을 입력할 수 없습니다.") | ||
@PastOrPresent(message = "birthDate는 현재 날짜와 같거나 이전이어야 합니다.") | ||
LocalDate birthDate, | ||
|
||
@NotBlank(message = "sizeType은 빈 문자열이나 null을 입력할 수 없습니다.") | ||
String sizeType, | ||
|
||
@NotBlank(message = "gender는 빈 문자열이나 null을 입력할 수 없습니다.") | ||
String gender, | ||
|
||
@NotBlank(message = "imageUpdateType는 빈 문자열이나 null을 입력할 수 없습니다.") | ||
String imageUpdateType | ||
) { | ||
|
||
} |
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.