Skip to content

Commit 2baf591

Browse files
authored
make price a Double (#130)
1 parent cfe3900 commit 2baf591

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rent/src/main/java/com/okteto/rent/controller/RentController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ Map<String, String> healthz() {
3434
@PostMapping(path= "/rent", consumes = "application/json", produces = "application/json")
3535
List<String> rent(@RequestBody Rent rentInput) {
3636
String catalogID = rentInput.getMovieID();
37-
String price = rentInput.getPrice();
37+
Double price = rentInput.getPrice();
3838

3939
logger.info("Rent [{},{}] received", catalogID, price);
4040

41-
kafkaTemplate.send(KAFKA_TOPIC_RENTALS, catalogID, price)
41+
kafkaTemplate.send(KAFKA_TOPIC_RENTALS, catalogID, price.toString())
4242
.thenAccept(result -> logger.info("Message [{}] delivered with offset {}",
4343
catalogID,
4444
result.getRecordMetadata().offset()))
@@ -72,7 +72,7 @@ public Map<String, String> returnMovie(@RequestBody ReturnRequest returnRequest)
7272
public static class Rent {
7373
@JsonProperty("catalog_id")
7474
private String movieID;
75-
private String price;
75+
private Double price;
7676

7777
public void setMovieID(String movieID) {
7878
this.movieID = movieID;
@@ -83,11 +83,11 @@ public String getMovieID() {
8383
}
8484

8585

86-
public void setPrice(String price) {
86+
public void setPrice(Double price) {
8787
this.price = price;
8888
}
8989

90-
public String getPrice() {
90+
public Double getPrice() {
9191
return price;
9292
}
9393
}

0 commit comments

Comments
 (0)