|
@@ -124,13 +124,16 @@ public class StoreOfficialAlbumServiceImpl extends ServiceImpl<StoreOfficialAlbu
|
|
|
* 查询条件:imgType = 2(官方相册),通过 business_id 关联到 store_official_album 表,按 albumName 筛选
|
|
* 查询条件:imgType = 2(官方相册),通过 business_id 关联到 store_official_album 表,按 albumName 筛选
|
|
|
* </p>
|
|
* </p>
|
|
|
*
|
|
*
|
|
|
- * @param storeId 门店ID,必填
|
|
|
|
|
|
|
+ * @param storeId 门店ID,必填,必须大于0
|
|
|
* @param albumName 相册名称,可选。例如:酒水、餐食、环境、全部等。当为null或空字符串时,查询全部
|
|
* @param albumName 相册名称,可选。例如:酒水、餐食、环境、全部等。当为null或空字符串时,查询全部
|
|
|
|
|
+ * @param type 类型,必填。1:视频,2:相册,3:环境
|
|
|
|
|
+ * @param pageNum 页码,可选,默认1
|
|
|
|
|
+ * @param pageSize 每页数量,可选,默认10
|
|
|
* @return 图片列表和总数
|
|
* @return 图片列表和总数
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public StoreOfficialAlbumImgVo getOfficialAlbumImgList(Integer storeId, String albumName,Integer type, Integer pageNum, Integer pageSize) {
|
|
|
|
|
- log.info("开始获取官方相册图片列表,门店ID:{},相册名称:{}", storeId, albumName);
|
|
|
|
|
|
|
+ public StoreOfficialAlbumImgVo getOfficialAlbumImgList(Integer storeId, String albumName, Integer type, Integer pageNum, Integer pageSize) {
|
|
|
|
|
+ log.info("开始获取官方相册图片列表,门店ID:{},相册名称:{},类型:{}", storeId, albumName, type);
|
|
|
|
|
|
|
|
// 参数校验
|
|
// 参数校验
|
|
|
if (storeId == null || storeId <= 0) {
|
|
if (storeId == null || storeId <= 0) {
|
|
@@ -143,16 +146,17 @@ public class StoreOfficialAlbumServiceImpl extends ServiceImpl<StoreOfficialAlbu
|
|
|
throw new IllegalArgumentException("类型不能为空且必须大于0");
|
|
throw new IllegalArgumentException("类型不能为空且必须大于0");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (type == 1){
|
|
|
|
|
- //查询视频
|
|
|
|
|
|
|
+ if (type == 1) {
|
|
|
|
|
+ // 查询视频
|
|
|
LambdaQueryWrapper<StoreVideo> albumQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<StoreVideo> albumQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
albumQueryWrapper.eq(StoreVideo::getStoreId, storeId)
|
|
albumQueryWrapper.eq(StoreVideo::getStoreId, storeId)
|
|
|
.eq(StoreVideo::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE);
|
|
.eq(StoreVideo::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE);
|
|
|
- List<StoreVideo> videoList=storeVideoMapper.selectList(albumQueryWrapper);
|
|
|
|
|
|
|
+ List<StoreVideo> videoList = storeVideoMapper.selectList(albumQueryWrapper);
|
|
|
StoreOfficialAlbumImgVo result = new StoreOfficialAlbumImgVo();
|
|
StoreOfficialAlbumImgVo result = new StoreOfficialAlbumImgVo();
|
|
|
result.setVideoList(videoList);
|
|
result.setVideoList(videoList);
|
|
|
|
|
+ return result;
|
|
|
}
|
|
}
|
|
|
- if (type == 2){
|
|
|
|
|
|
|
+ if (type == 2) {
|
|
|
// 先查询符合条件的官方相册ID列表
|
|
// 先查询符合条件的官方相册ID列表
|
|
|
LambdaQueryWrapper<StoreOfficialAlbum> albumQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<StoreOfficialAlbum> albumQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
albumQueryWrapper.eq(StoreOfficialAlbum::getStoreId, storeId)
|
|
albumQueryWrapper.eq(StoreOfficialAlbum::getStoreId, storeId)
|
|
@@ -200,30 +204,36 @@ public class StoreOfficialAlbumServiceImpl extends ServiceImpl<StoreOfficialAlbu
|
|
|
|
|
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
- if (type == 3){
|
|
|
|
|
-
|
|
|
|
|
- StoreInfo storeInfo=storeInfoMapper.getStoreInfo(storeId);
|
|
|
|
|
|
|
+ if (type == 3) {
|
|
|
|
|
+ StoreInfo storeInfo = storeInfoMapper.getStoreInfo(storeId);
|
|
|
|
|
|
|
|
- assert storeInfo != null;
|
|
|
|
|
- //单图模式
|
|
|
|
|
- if (storeInfo.getImgMode()==0){
|
|
|
|
|
- List<StoreImg> imgList= storeImgService.getByCover(storeId, 20);
|
|
|
|
|
|
|
+ if (storeInfo == null) {
|
|
|
|
|
+ log.warn("获取门店信息失败,门店ID:{}", storeId);
|
|
|
|
|
+ StoreOfficialAlbumImgVo result = new StoreOfficialAlbumImgVo();
|
|
|
|
|
+ result.setImgList(Collections.emptyList());
|
|
|
|
|
+ result.setTotalCount(0);
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 单图模式
|
|
|
|
|
+ if (storeInfo.getImgMode() == 0) {
|
|
|
|
|
+ List<StoreImg> imgList = storeImgService.getByCover(storeId, 20);
|
|
|
StoreOfficialAlbumImgVo result = new StoreOfficialAlbumImgVo();
|
|
StoreOfficialAlbumImgVo result = new StoreOfficialAlbumImgVo();
|
|
|
result.setImgList(imgList);
|
|
result.setImgList(imgList);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
- //多图模式
|
|
|
|
|
- if (storeInfo.getImgMode()==1){
|
|
|
|
|
- List<StoreImg> imgList= storeImgService.getByCover(storeId, 21);
|
|
|
|
|
|
|
+ // 多图模式
|
|
|
|
|
+ if (storeInfo.getImgMode() == 1) {
|
|
|
|
|
+ List<StoreImg> imgList = storeImgService.getByCover(storeId, 21);
|
|
|
StoreOfficialAlbumImgVo result = new StoreOfficialAlbumImgVo();
|
|
StoreOfficialAlbumImgVo result = new StoreOfficialAlbumImgVo();
|
|
|
result.setImgList(imgList);
|
|
result.setImgList(imgList);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
- return null;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 默认返回空结果
|
|
|
|
|
+ StoreOfficialAlbumImgVo result = new StoreOfficialAlbumImgVo();
|
|
|
|
|
+ result.setImgList(Collections.emptyList());
|
|
|
|
|
+ result.setTotalCount(0);
|
|
|
|
|
+ return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|