UpdateProfileRequest.java
656 bytes
| 1 | package com.tasteprint.account; |
|---|---|
| 2 | |
| 3 | import jakarta.validation.constraints.NotBlank; |
| 4 | import jakarta.validation.constraints.Pattern; |
| 5 | import jakarta.validation.constraints.Size; |
| 6 | |
| 7 | public record UpdateProfileRequest( |
| 8 | @NotBlank @Size(max = 80) String displayName, |
| 9 | @Size(max = 100) String homeCity, |
| 10 | @Pattern(regexp = "^$|^[A-Za-z]{2}$", message = "must be a two-letter country code") String homeCountryCode, |
| 11 | @Size(max = 280) String bio, |
| 12 | @Size(max = 500) @Pattern(regexp = "^$|^https://.+|^/uploads/[A-Za-z0-9._-]+$", message = "must be an HTTPS URL or an uploaded photo") String avatarUrl, |
| 13 | boolean profilePublic |
| 14 | ) { |
| 15 | } |
| 16 | |