Код: Выделить всё
public record ProductViewModel
(
String id,
String name,
String description,
float price
) {
}
Код: Выделить всё
@Put(uri = "/{id}")
public Maybe Update(ProductViewModel model, String id) {
return iProductManager.Update(id, model).flatMap(item -> {
if(item == null)
return Maybe.just(HttpResponse.notFound());
else
return Maybe.just(HttpResponse.accepted());
});
}
Код: Выделить всё
model.setid(id) // Old style
Подробнее здесь: https://stackoverflow.com/questions/652 ... -15-record
Мобильная версия