|
|
@@ -126,7 +126,10 @@ public class ImagePostService {
|
|
|
scopes.add(PostScope.PRIVATE.getCode());
|
|
|
}
|
|
|
|
|
|
- ImageAlbumQuery imageAlbumQuery = new ImageAlbumQuery.Builder().userId(userId).build();
|
|
|
+ ImageAlbumQuery imageAlbumQuery = new ImageAlbumQuery.Builder()
|
|
|
+ .userId(userId)
|
|
|
+ .scope(scopes)
|
|
|
+ .build();
|
|
|
int total = imageRepository.countByCriteria(imageAlbumQuery);
|
|
|
Page page1 = new Page(page, pageSize);
|
|
|
List<ImagePost> list = imageRepository.findImageAlbumByPage(page1, imageAlbumQuery);
|
|
|
@@ -134,12 +137,14 @@ public class ImagePostService {
|
|
|
try {
|
|
|
int scope = imagePost.getScope();
|
|
|
if (scope != PostScope.PUBLIC.getCode()) {
|
|
|
- int channelId = imagePost.getChannelId();
|
|
|
- String coverUrl = imagePost.getCoverUrl();
|
|
|
- if (!coverUrl.isBlank()) {
|
|
|
- ImageFile imageFile = imageRepository.getByUrl(coverUrl);
|
|
|
- String objectId = imageFile.getObjectId();
|
|
|
- imagePost.setCoverUrl(ossService.getSignedUrl(channelId, objectId));
|
|
|
+ int channelCode = imagePost.getChannelId();
|
|
|
+ if (channelCode != 501) {
|
|
|
+ String coverUrl = imagePost.getCoverUrl();
|
|
|
+ if (!coverUrl.isBlank()) {
|
|
|
+ ImageFile imageFile = imageRepository.getByUrl(coverUrl);
|
|
|
+ String objectId = imageFile.getObjectId();
|
|
|
+ imagePost.setCoverUrl(ossService.getSignedUrl(channelCode, objectId));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
String userIdStr = accountQuery.getUserIdStr(imagePost.getUserId());
|
|
|
@@ -206,13 +211,15 @@ public class ImagePostService {
|
|
|
if (scope != PostScope.PUBLIC.getCode()) {
|
|
|
imageAlbumCard.getImages().getList().forEach(imageData -> {
|
|
|
String imageFileId = imageData.getImageFileId();
|
|
|
- try {
|
|
|
- int channelId = imagePost.getChannelId();
|
|
|
- String signedUrl = ossService.getSignedUrl(channelId, imageFileId);
|
|
|
- imageData.setThumbnailUrl(signedUrl);
|
|
|
- imageData.setOriginalUrl(signedUrl);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ int channelCode = imagePost.getChannelId();
|
|
|
+ if (channelCode != 501) {
|
|
|
+ try {
|
|
|
+ String signedUrl = ossService.getSignedUrl(channelCode, imageFileId);
|
|
|
+ imageData.setThumbnailUrl(signedUrl);
|
|
|
+ imageData.setOriginalUrl(signedUrl);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|