修复店铺主图保存后不回显

This commit is contained in:
2026-07-24 15:34:43 +08:00
parent cd05727b98
commit b48213df67
4 changed files with 64 additions and 1 deletions
@@ -289,7 +289,18 @@ public class ShopServiceImpl extends ServiceImpl<ShopMapper, ShopDO> implements
* @param shopDO parameter `shopDO` supplied by the caller
* @return return result consumed by the caller or returned to the frontend
*/
return convertToVO(shopDO);
ShopVO shopVO = convertToVO(shopDO);
List<Long> coverImageFileIds = parseLongIds(shopDO.getCoverImageFileId(), ",");
List<Long> imageFileIds = parseLongIds(shopDO.getImageFileIds(), ",");
Set<Long> fileIds = new LinkedHashSet<>();
fileIds.addAll(coverImageFileIds);
fileIds.addAll(imageFileIds);
Map<Long, ObjectStorageFileVO> fileMap = fileIds.isEmpty()
? Collections.emptyMap()
: objectStorageFileService.getObjectStorageFileMapByIds(fileIds);
shopVO.setCoverImageUrls(resolveImageUrls(coverImageFileIds, fileMap));
shopVO.setImageUrls(resolveImageUrls(imageFileIds, fileMap));
return shopVO;
}
);
}