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