изменена дто для отображения изображения коктейля в заказе
This commit is contained in:
@@ -9,12 +9,14 @@ import ru.kayashov.bar.model.entity.CocktailEntity;
|
|||||||
public class CocktailSimpleResponseDto {
|
public class CocktailSimpleResponseDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
|
private String image;
|
||||||
private Boolean hasError;
|
private Boolean hasError;
|
||||||
|
|
||||||
public static CocktailSimpleResponseDto mapToDto(CocktailEntity e) {
|
public static CocktailSimpleResponseDto mapToDto(CocktailEntity e) {
|
||||||
CocktailSimpleResponseDto d = new CocktailSimpleResponseDto();
|
CocktailSimpleResponseDto d = new CocktailSimpleResponseDto();
|
||||||
d.setId(e.getId());
|
d.setId(e.getId());
|
||||||
d.setName(e.getName());
|
d.setName(e.getName());
|
||||||
|
d.setImage(e.getImage());
|
||||||
boolean hasError = e.getReceipt().stream()
|
boolean hasError = e.getReceipt().stream()
|
||||||
.anyMatch(receiptEntity -> receiptEntity.getUnit() == null || receiptEntity.getCount() == null);
|
.anyMatch(receiptEntity -> receiptEntity.getUnit() == null || receiptEntity.getCount() == null);
|
||||||
d.setHasError(hasError);
|
d.setHasError(hasError);
|
||||||
|
|||||||
Reference in New Issue
Block a user