-
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
2b42c5e
commit 22b7545
Showing
3 changed files
with
36 additions
and
5 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
26 changes: 26 additions & 0 deletions
26
...-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/model/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,26 @@ | ||
package com.example.mongoes.web.model; | ||
|
||
import com.example.mongoes.document.Address; | ||
import com.example.mongoes.document.Grades; | ||
import com.example.mongoes.document.Restaurant; | ||
import java.util.List; | ||
|
||
public record RestaurantRequest( | ||
Long restaurantId, | ||
String name, | ||
String borough, | ||
String cuisine, | ||
Address address, | ||
List<Grades> grades) { | ||
|
||
public Restaurant toRestaurant() { | ||
Restaurant restaurant = new Restaurant(); | ||
restaurant.setAddress(address); | ||
restaurant.setBorough(borough); | ||
restaurant.setCuisine(cuisine); | ||
restaurant.setGrades(grades); | ||
restaurant.setName(name); | ||
restaurant.setRestaurantId(restaurantId); | ||
return restaurant; | ||
} | ||
} |
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