add validation

This commit is contained in:
mirrerror
2023-11-15 09:16:27 +02:00
parent 2d981c5af8
commit fb2695e58a
23 changed files with 314 additions and 62 deletions

View File

@@ -1,14 +1,21 @@
package com.faf223.expensetrackerfaf.dto;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class UserDTO {
@NotNull(message = "Name must not be null")
@NotEmpty(message = "Name must not be empty")
private String name;
@NotNull(message = "Surname must not be null")
@NotEmpty(message = "Surname must not be empty")
private String surname;
@NotNull(message = "Username must not be null")
@NotEmpty(message = "Username must not be empty")
private String username;
}