Commit b9fd3675 by 侯昆

图顺序

1 parent 9bc50313
...@@ -74,10 +74,7 @@ public class CharacterBaikeVO { ...@@ -74,10 +74,7 @@ public class CharacterBaikeVO {
dto.setBody(body); dto.setBody(body);
if (StringUtils.isNotEmpty(word.getBaikePhotos())) { if (StringUtils.isNotEmpty(word.getBaikePhotos())) {
List<ImageModel> images = List<ImageModel> images =
ImageModel.toList(word.getBaikePhotos()) ImageModel.toList(word.getBaikePhotos());
.stream()
.sorted(Comparator.comparing(ImageModel::getFile))
.collect(Collectors.toList());
dto.setImages(images); dto.setImages(images);
} }
if (StringUtils.isNotEmpty(word.getBaikeVideo())) { if (StringUtils.isNotEmpty(word.getBaikeVideo())) {
......
...@@ -69,10 +69,7 @@ public class StatementBaikeVO { ...@@ -69,10 +69,7 @@ public class StatementBaikeVO {
dto.setBody(body); dto.setBody(body);
if (StringUtils.isNotEmpty(word.getBaikePhotos())) { if (StringUtils.isNotEmpty(word.getBaikePhotos())) {
List<ImageModel> images = List<ImageModel> images =
ImageModel.toList(word.getBaikePhotos()) ImageModel.toList(word.getBaikePhotos());
.stream()
.sorted(Comparator.comparing(ImageModel::getFile))
.collect(Collectors.toList());
dto.setImages(images); dto.setImages(images);
} }
if (StringUtils.isNotEmpty(word.getBaikeVideo())) { if (StringUtils.isNotEmpty(word.getBaikeVideo())) {
......
...@@ -70,10 +70,7 @@ public class CharacterBaikeVO { ...@@ -70,10 +70,7 @@ public class CharacterBaikeVO {
.collect(Collectors.toList()); .collect(Collectors.toList());
dto.setBody(body); dto.setBody(body);
if (StringUtils.isNotEmpty(word.getBaikePhotos())) { if (StringUtils.isNotEmpty(word.getBaikePhotos())) {
List<ImageModel> images = ImageModel.toList(word.getBaikePhotos()) List<ImageModel> images = ImageModel.toList(word.getBaikePhotos());
.stream()
.sorted(Comparator.comparing(ImageModel::getFile))
.collect(Collectors.toList());
dto.setImages(images); dto.setImages(images);
dto.setThumb(images.stream().findFirst().orElse(new ImageModel())); dto.setThumb(images.stream().findFirst().orElse(new ImageModel()));
} }
......
...@@ -66,10 +66,7 @@ public class StatementBaikeVO { ...@@ -66,10 +66,7 @@ public class StatementBaikeVO {
dto.setBody(body); dto.setBody(body);
if (StringUtils.isNotEmpty(word.getBaikePhotos())) { if (StringUtils.isNotEmpty(word.getBaikePhotos())) {
List<ImageModel> images = List<ImageModel> images =
ImageModel.toList(word.getBaikePhotos()) ImageModel.toList(word.getBaikePhotos());
.stream()
.sorted(Comparator.comparing(ImageModel::getFile))
.collect(Collectors.toList());
dto.setImages(images); dto.setImages(images);
dto.setThumb(images.stream().findFirst().orElse(new ImageModel())); dto.setThumb(images.stream().findFirst().orElse(new ImageModel()));
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!