-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
556be82
commit 5f5d4e3
Showing
6 changed files
with
37 additions
and
35 deletions.
There are no files selected for viewing
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
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
20 changes: 20 additions & 0 deletions
20
...ensearch-sample/src/main/java/com/example/opensearch/model/request/RestaurantRequest.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.example.opensearch.model.request; | ||
|
||
import com.example.opensearch.entities.Address; | ||
import com.example.opensearch.entities.Grades; | ||
import com.example.opensearch.entities.Restaurant; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import java.util.List; | ||
|
||
public record RestaurantRequest( | ||
@NotEmpty(message = "Name cannot be empty") String name, | ||
@NotBlank(message = "Borough Can't be Blank") String borough, | ||
@NotBlank(message = "Cuisine Can't be Blank") String cuisine, | ||
Address address, | ||
List<Grades> grades) { | ||
|
||
public Restaurant toRestaurant() { | ||
return new Restaurant(null, name, borough, cuisine, address, grades); | ||
} | ||
} |
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
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
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