mirror of
https://gitlab.com/etc404/software-engineering-project.git
synced 2026-05-10 20:52:58 +00:00
The Unpopular Decision
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package com.example.demo.dto;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.PositiveOrZero;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.example.demo.dto.StepDto;
|
||||
|
||||
public class RecipeCreateRequest {
|
||||
|
||||
@NotBlank(message = "title is required")
|
||||
@Size(max = 100, message = "title must be 100 characters or less")
|
||||
private String title;
|
||||
|
||||
@Size(max = 1000, message = "description must be 1000 characters or less")
|
||||
private String description;
|
||||
|
||||
@PositiveOrZero(message = "prepTimeMinutes must be 0 or greater")
|
||||
private int prepTimeMinutes;
|
||||
|
||||
@PositiveOrZero(message = "cookTimeMinutes must be 0 or greater")
|
||||
private int cookTimeMinutes;
|
||||
|
||||
@PositiveOrZero(message = "servings must be 0 or greater")
|
||||
private int servings;
|
||||
|
||||
@NotNull(message = "ingredients list is required")
|
||||
@Valid
|
||||
private java.util.List<IngredientDto> ingredients;
|
||||
|
||||
@NotNull(message = "steps list is required")
|
||||
@Valid
|
||||
private java.util.List<StepDto> steps;
|
||||
|
||||
public String getTitle() { return title; }
|
||||
public void setTitle(String title) { this.title = title; }
|
||||
|
||||
public String getDescription() { return description; }
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
|
||||
public int getPrepTimeMinutes() { return prepTimeMinutes; }
|
||||
public void setPrepTimeMinutes(int prepTimeMinutes) { this.prepTimeMinutes = prepTimeMinutes; }
|
||||
|
||||
public int getCookTimeMinutes() { return cookTimeMinutes; }
|
||||
public void setCookTimeMinutes(int cookTimeMinutes) { this.cookTimeMinutes = cookTimeMinutes; }
|
||||
|
||||
public int getServings() { return servings; }
|
||||
public void setServings(int servings) { this.servings = servings; }
|
||||
|
||||
public java.util.List<IngredientDto> getIngredients() { return ingredients; }
|
||||
public void setIngredients(java.util.List<IngredientDto> ingredients) { this.ingredients = ingredients; }
|
||||
|
||||
public java.util.List<StepDto> getSteps() { return steps; }
|
||||
public void setSteps(java.util.List<StepDto> steps) { this.steps = steps; }
|
||||
}
|
||||
Reference in New Issue
Block a user