Skip to content

Commit

Permalink
feat/#331 : CreateFoodRequest 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
LJH098 committed Jun 30, 2024
1 parent bc323a9 commit 1181e73
Showing 1 changed file with 14 additions and 9 deletions.
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 {}
}

0 comments on commit 1181e73

Please sign in to comment.