-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
1 changed file
with
14 additions
and
9 deletions.
There are no files selected for viewing
23 changes: 14 additions & 9 deletions
23
BE/exceed/src/main/java/com/gaebaljip/exceed/dto/request/CreateFoodRequest.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,17 +1,22 @@ | ||
package com.gaebaljip.exceed.dto.request; | ||
|
||
import com.gaebaljip.exceed.common.ValidationMessage; | ||
import lombok.Builder; | ||
|
||
import javax.validation.constraints.Min; | ||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
|
||
public record CreateFoodRequest( | ||
String name, | ||
Double sugars, | ||
Double dietaryFiber, | ||
Double sodium, | ||
Double calorie, | ||
Double carbohydrate, | ||
Double protein, | ||
Double fat, | ||
Double servingSize) { | ||
@NotBlank(message = "이름을 " + ValidationMessage.NOT_BLANK) String name, | ||
@NotNull(message = "당을 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "당은" + ValidationMessage.MIN_0) Double sugars, | ||
@NotNull(message = "식이섬유를 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "식이섬유는 " + ValidationMessage.MIN_0)Double dietaryFiber, | ||
@NotNull(message = "나트륨을 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "나트륨은 " + ValidationMessage.MIN_0)Double sodium, | ||
@NotNull(message = "칼로리를 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "칼로리는 " + ValidationMessage.MIN_0)Double calorie, | ||
@NotNull(message = "탄수화물을 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "탄수화물은 " + ValidationMessage.MIN_0)Double carbohydrate, | ||
@NotNull(message = "단백질을 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "단백질은 " + ValidationMessage.MIN_0)Double protein, | ||
@NotNull(message = "지방을 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "지방은 " + ValidationMessage.MIN_0)Double fat, | ||
@NotNull(message = "1회 제공량을 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "1회 제공량은 " + ValidationMessage.MIN_0)Double servingSize) { | ||
@Builder | ||
public CreateFoodRequest {} | ||
} |