|
|
@@ -0,0 +1,430 @@
|
|
|
+package shop.alien.second.service.impl;
|
|
|
+
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import shop.alien.entity.second.SecondGoods;
|
|
|
+import shop.alien.entity.second.SecondGoodsRecord;
|
|
|
+import shop.alien.entity.second.SecondTradeRecord;
|
|
|
+import shop.alien.entity.second.enums.SecondGoodsStatusEnum;
|
|
|
+import shop.alien.entity.second.vo.*;
|
|
|
+import shop.alien.entity.store.LifeUser;
|
|
|
+import shop.alien.entity.store.LifeUserViolation;
|
|
|
+import shop.alien.entity.store.StoreDictionary;
|
|
|
+import shop.alien.entity.store.StoreImg;
|
|
|
+import shop.alien.mapper.LifeUserMapper;
|
|
|
+import shop.alien.mapper.LifeUserViolationMapper;
|
|
|
+import shop.alien.mapper.StoreDictionaryMapper;
|
|
|
+import shop.alien.mapper.StoreImgMapper;
|
|
|
+import shop.alien.mapper.second.SecondGoodsMapper;
|
|
|
+import shop.alien.mapper.second.SecondGoodsRecordMapper;
|
|
|
+import shop.alien.mapper.second.SecondTradeRecordMapper;
|
|
|
+import shop.alien.second.service.PlatformSecondTradeService;
|
|
|
+import shop.alien.second.service.SecondGoodsAdminService;
|
|
|
+import shop.alien.second.service.SecondGoodsDataEnricher;
|
|
|
+import shop.alien.util.common.Constants;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 二手商品管理后台服务实现类
|
|
|
+ * 负责管理后台专用的业务逻辑
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class SecondGoodsAdminServiceImpl implements SecondGoodsAdminService {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 二手商品Mapper
|
|
|
+ */
|
|
|
+ private final SecondGoodsMapper secondGoodsMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商品操作历史记录Mapper
|
|
|
+ */
|
|
|
+ private final SecondGoodsRecordMapper secondGoodsRecordMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 二手交易记录Mapper
|
|
|
+ */
|
|
|
+ private final SecondTradeRecordMapper secondTradeRecordMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户信息Mapper
|
|
|
+ */
|
|
|
+ private final LifeUserMapper lifeUserMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户违规举报Mapper
|
|
|
+ */
|
|
|
+ private final LifeUserViolationMapper lifeUserViolationMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 店铺图片Mapper
|
|
|
+ */
|
|
|
+ private final StoreImgMapper storeImgMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 字典Mapper
|
|
|
+ */
|
|
|
+ private final StoreDictionaryMapper storeDictionaryMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 平台二手交易服务
|
|
|
+ */
|
|
|
+ private final PlatformSecondTradeService platformSecondTradeService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据增强服务
|
|
|
+ */
|
|
|
+ private final SecondGoodsDataEnricher dataEnricher;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取商品详情(管理后台使用)
|
|
|
+ * @param goodsId 商品ID
|
|
|
+ * @return 商品详情VO对象
|
|
|
+ * @throws Exception 处理过程中可能抛出的异常
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SecondGoodsDetailVo getAdminGoodsDetail(Integer goodsId) throws Exception {
|
|
|
+ // 基本信息
|
|
|
+ SecondGoodsDetailVo detailVo = dealSecondGoodsInfo(goodsId);
|
|
|
+
|
|
|
+ // 3. 获取商品操作记录集合
|
|
|
+ QueryWrapper<SecondGoodsRecord> recordQueryWrapper = new QueryWrapper<>();
|
|
|
+ recordQueryWrapper.lambda()
|
|
|
+ .eq(SecondGoodsRecord::getGoodsId, goodsId)
|
|
|
+ .orderByDesc(SecondGoodsRecord::getCreatedTime);
|
|
|
+ List<SecondGoodsRecord> operationRecords = secondGoodsRecordMapper.selectdminGoodsList(recordQueryWrapper);
|
|
|
+ detailVo.setOperationRecords(operationRecords);
|
|
|
+
|
|
|
+ // 4. 获取商品交易记录集合
|
|
|
+ QueryWrapper<SecondTradeRecord> tradeQueryWrapper = new QueryWrapper<>();
|
|
|
+ tradeQueryWrapper.eq("goods_id", goodsId)
|
|
|
+ .orderByDesc("created_time");
|
|
|
+ List<SecondTradeRecord> tradeRecords = secondTradeRecordMapper.selectList(tradeQueryWrapper);
|
|
|
+
|
|
|
+ // 处理交易步骤 调取 PlatformSecondTradeServiceImpl.getOperationJsonList
|
|
|
+ List<SecondTradeRecordVo> secondTradeRecordVos = Lists.newArrayList();
|
|
|
+ if (CollectionUtil.isNotEmpty(tradeRecords)) {
|
|
|
+ for (SecondTradeRecord tradeRecord : tradeRecords) {
|
|
|
+ SecondTradeRecordVo secondTradeRecordVo = new SecondTradeRecordVo();
|
|
|
+ BeanUtils.copyProperties(tradeRecord, secondTradeRecordVo);
|
|
|
+ // 交易节点
|
|
|
+ secondTradeRecordVo.setOperationJsonList(platformSecondTradeService.getOperationJsonList(tradeRecord.getId()));
|
|
|
+ // 获取联系人
|
|
|
+ QueryWrapper<LifeUser> userQueryWrapper = new QueryWrapper<>();
|
|
|
+ userQueryWrapper.lambda()
|
|
|
+ .eq(LifeUser::getId, secondTradeRecordVo.getBuyerId())
|
|
|
+ .eq(LifeUser::getDeleteFlag, Constants.DeleteFlag.NOT_DELETED);
|
|
|
+ LifeUser user = lifeUserMapper.selectOne(userQueryWrapper);
|
|
|
+ secondTradeRecordVo.setUserName(user.getUserName());
|
|
|
+ secondTradeRecordVo.setUserPhone(user.getUserPhone());
|
|
|
+ secondTradeRecordVos.add(secondTradeRecordVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ detailVo.setTradeRecords(secondTradeRecordVos);
|
|
|
+
|
|
|
+ // 5. 获取商品举报集合
|
|
|
+ QueryWrapper<LifeUserViolation> reportQueryWrapper = new QueryWrapper<>();
|
|
|
+ reportQueryWrapper.lambda()
|
|
|
+ .eq(LifeUserViolation::getGoodsId, goodsId)
|
|
|
+ .eq(LifeUserViolation::getReportContextType, "4") // 4:二手商品
|
|
|
+ .orderByDesc(LifeUserViolation::getCreatedTime);
|
|
|
+ List<LifeUserViolation> reports = lifeUserViolationMapper.selectList(reportQueryWrapper);
|
|
|
+
|
|
|
+ // 转换举报信息为SecondReportingVo
|
|
|
+ List<SecondReportingVo> reportingVos = convertReportsToVos(reports);
|
|
|
+ detailVo.setReports(reportingVos);
|
|
|
+
|
|
|
+ return detailVo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取商品操作记录详情(管理后台使用)
|
|
|
+ * @param recordId 商品操作记录ID
|
|
|
+ * @return 商品操作记录详情VO对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SecondGoodsRecordDetailVo getAdminGoodsRecordDetail(Integer recordId) {
|
|
|
+ // 1. 获取商品操作记录基本信息
|
|
|
+ QueryWrapper<SecondGoodsRecord> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("sg.id", recordId);
|
|
|
+ SecondGoodsRecord record = secondGoodsRecordMapper.selectGoodsRecordById(queryWrapper);
|
|
|
+ if (record == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 转换为VO对象
|
|
|
+ SecondGoodsRecordDetailVo detailVo = SecondGoodsRecordDetailVo.fromRecord(record);
|
|
|
+
|
|
|
+ if (record.getUserId() != null) {
|
|
|
+ // 获取联系人
|
|
|
+ QueryWrapper<LifeUser> userQueryWrapper = new QueryWrapper<>();
|
|
|
+ userQueryWrapper.lambda()
|
|
|
+ .eq(LifeUser::getId, record.getUserId())
|
|
|
+ .eq(LifeUser::getDeleteFlag, Constants.DeleteFlag.NOT_DELETED);
|
|
|
+ LifeUser user = lifeUserMapper.selectOne(userQueryWrapper);
|
|
|
+
|
|
|
+ detailVo.setUserName(user.getUserName());
|
|
|
+ detailVo.setUserPhone(user.getUserPhone());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 3. 获取商品图片列表
|
|
|
+ QueryWrapper<StoreImg> imageQueryWrapper = new QueryWrapper<>();
|
|
|
+ imageQueryWrapper.lambda()
|
|
|
+ .eq(StoreImg::getStoreId, record.getId())
|
|
|
+ .eq(StoreImg::getImgType, Constants.ImageType.SECOND_HAND_RECORD)
|
|
|
+ .eq(StoreImg::getDeleteFlag, Constants.DeleteFlag.NOT_DELETED)
|
|
|
+ .orderByAsc(StoreImg::getImgSort);
|
|
|
+ List<StoreImg> imageList = storeImgMapper.selectList(imageQueryWrapper);
|
|
|
+
|
|
|
+ // 4. 提取图片URL列表
|
|
|
+ if (CollectionUtil.isNotEmpty(imageList)) {
|
|
|
+ List<String> imageUrls = imageList.stream()
|
|
|
+ .map(StoreImg::getImgUrl)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List<Map<String, Object>> imgList = processReportImages(imageList, 2);
|
|
|
+ detailVo.setImgList(imgList);
|
|
|
+ detailVo.setImageUrls(imageUrls);
|
|
|
+ }
|
|
|
+
|
|
|
+ return detailVo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理商品信息(管理后台使用)
|
|
|
+ * @param goodsId 商品ID
|
|
|
+ * @return 商品详情VO对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SecondGoodsDetailVo dealSecondGoodsInfo(Integer goodsId) {
|
|
|
+ SecondGoodsDetailVo SecondGoodsDetailVo = new SecondGoodsDetailVo();
|
|
|
+ QueryWrapper<SecondGoodsVo> goodsVoQueryWrapper = new QueryWrapper<>();
|
|
|
+ goodsVoQueryWrapper.eq("sg.id", goodsId);
|
|
|
+
|
|
|
+ // 1. 获取商品基本信息
|
|
|
+ SecondGoodsVo goodsInfo = secondGoodsMapper.getGoodsById(goodsVoQueryWrapper);
|
|
|
+
|
|
|
+ // 2. 获取商品图片列表
|
|
|
+ QueryWrapper<StoreImg> imageQueryWrapper = new QueryWrapper<>();
|
|
|
+ imageQueryWrapper.lambda()
|
|
|
+ .eq(StoreImg::getStoreId, goodsId)
|
|
|
+ .eq(StoreImg::getImgType, Constants.ImageType.SECOND_HAND_GOODS)
|
|
|
+ .eq(StoreImg::getDeleteFlag, Constants.DeleteFlag.NOT_DELETED)
|
|
|
+ .orderByAsc(StoreImg::getImgSort);
|
|
|
+ List<StoreImg> imageList = storeImgMapper.selectList(imageQueryWrapper);
|
|
|
+
|
|
|
+ // 提取图片URL列表
|
|
|
+ if (CollectionUtil.isNotEmpty(imageList)) {
|
|
|
+ List<String> imageUrls = imageList.stream()
|
|
|
+ .map(StoreImg::getImgUrl)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List<Map<String, Object>> imgList = processReportImages(imageList, 2);
|
|
|
+ goodsInfo.setImgList(imgList);
|
|
|
+ goodsInfo.setImgUrl(imageUrls);
|
|
|
+ }
|
|
|
+ SecondGoodsDetailVo.setGoodsInfo(goodsInfo);
|
|
|
+ return SecondGoodsDetailVo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理商品记录信息
|
|
|
+ * @param goodsId 商品ID
|
|
|
+ * @return 商品VO对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public SecondGoodsVo dealSecondGoodsRecordInfo(Integer goodsId) {
|
|
|
+ QueryWrapper<SecondGoodsVo> goodsVoQueryWrapper = new QueryWrapper<>();
|
|
|
+ goodsVoQueryWrapper.eq("sg.id", goodsId);
|
|
|
+
|
|
|
+ // 1. 获取商品基本信息
|
|
|
+ SecondGoodsVo goodsInfo = secondGoodsMapper.getGoodsRecordById(goodsVoQueryWrapper);
|
|
|
+
|
|
|
+ // 2. 获取商品图片列表
|
|
|
+ QueryWrapper<StoreImg> imageQueryWrapper = new QueryWrapper<>();
|
|
|
+ imageQueryWrapper.lambda()
|
|
|
+ .eq(StoreImg::getStoreId, goodsId)
|
|
|
+ .eq(StoreImg::getImgType, Constants.ImageType.SECOND_HAND_RECORD)
|
|
|
+ .eq(StoreImg::getDeleteFlag, Constants.DeleteFlag.NOT_DELETED)
|
|
|
+ .orderByAsc(StoreImg::getImgSort);
|
|
|
+ List<StoreImg> imageList = storeImgMapper.selectList(imageQueryWrapper);
|
|
|
+
|
|
|
+ // 提取图片URL列表
|
|
|
+ if (CollectionUtil.isNotEmpty(imageList)) {
|
|
|
+ List<String> imageUrls = imageList.stream()
|
|
|
+ .map(StoreImg::getImgUrl)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List<Map<String, Object>> imgList = processReportImages(imageList, 2);
|
|
|
+ goodsInfo.setImgList(imgList);
|
|
|
+ goodsInfo.setImgUrl(imageUrls);
|
|
|
+ }
|
|
|
+ return goodsInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取管理后台商品列表
|
|
|
+ * @param page 分页参数
|
|
|
+ * @param queryDTO 查询参数DTO
|
|
|
+ * @return 商品列表
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public IPage<SecondGoodsVo> getAdminGoodsList(IPage<SecondGoodsVo> page, SecondGoodsAdminQueryDTO queryDTO) {
|
|
|
+ // 构建查询条件
|
|
|
+ QueryWrapper<SecondGoodsVo> queryWrapper = new QueryWrapper<>();
|
|
|
+
|
|
|
+ // 商品名称模糊查询
|
|
|
+ queryWrapper.like(org.apache.commons.lang3.StringUtils.isNotBlank(queryDTO.getTitle()), "sg.title", queryDTO.getTitle());
|
|
|
+ // 过滤草稿
|
|
|
+ queryWrapper.ne("sg.goods_status", SecondGoodsStatusEnum.DRAFT.getCode());
|
|
|
+
|
|
|
+ // 状态查询分为两种情况处理
|
|
|
+ if (queryDTO.getGoodsStatus() != null) {
|
|
|
+ if (queryDTO.getGoodsStatus() == 6) {
|
|
|
+ // 当状态为6时,查询删除标记为1的数据
|
|
|
+ queryWrapper.eq("sg.delete_flag", Constants.DeleteFlag.DELETED);
|
|
|
+ } else {
|
|
|
+ // 其他状态按照商品状态进行查询,并且删除标记为0
|
|
|
+ queryWrapper.eq("sg.goods_status", queryDTO.getGoodsStatus())
|
|
|
+ .eq("sg.delete_flag", Constants.DeleteFlag.NOT_DELETED);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 发布时间范围查询
|
|
|
+ queryWrapper.ge(queryDTO.getReleaseStartTime() != null, "sg.release_time", queryDTO.getReleaseStartTime())
|
|
|
+ .le(queryDTO.getReleaseEndTime() != null, "sg.release_time", queryDTO.getReleaseEndTime());
|
|
|
+ queryWrapper.orderByDesc("sg.id");
|
|
|
+
|
|
|
+ // 查询数据
|
|
|
+ IPage<SecondGoodsVo> result = secondGoodsMapper.getAdminGoodsList(page, queryWrapper);
|
|
|
+
|
|
|
+ // 批量设置商品图片信息
|
|
|
+ dataEnricher.batchSetGoodsImagesForAdmin(result);
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量转换举报信息为SecondReportingVo对象
|
|
|
+ * @param reports 举报信息列表
|
|
|
+ * @return SecondReportingVo列表
|
|
|
+ */
|
|
|
+ private List<SecondReportingVo> convertReportsToVos(List<LifeUserViolation> reports) {
|
|
|
+ List<SecondReportingVo> reportingVos = new ArrayList<>();
|
|
|
+
|
|
|
+ // 获取所有相关的举报类型字典信息
|
|
|
+ List<String> dictTypes = reports.stream()
|
|
|
+ .map(LifeUserViolation::getDictType)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<Integer> dictIds = reports.stream()
|
|
|
+ .map(LifeUserViolation::getDictId)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ Map<String, StoreDictionary> dictMap = new HashMap<>();
|
|
|
+ if (!dictTypes.isEmpty() && !dictIds.isEmpty()) {
|
|
|
+ QueryWrapper<StoreDictionary> dictQueryWrapper = new QueryWrapper<>();
|
|
|
+ dictQueryWrapper.lambda()
|
|
|
+ .in(StoreDictionary::getTypeName, dictTypes)
|
|
|
+ .in(StoreDictionary::getDictId, dictIds);
|
|
|
+ List<StoreDictionary> dicts = storeDictionaryMapper.selectList(dictQueryWrapper);
|
|
|
+ dictMap = dicts.stream()
|
|
|
+ .collect(Collectors.toMap(
|
|
|
+ d -> d.getTypeName() + "_" + d.getDictId(),
|
|
|
+ d -> d));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 转换每个举报信息
|
|
|
+ for (LifeUserViolation report : reports) {
|
|
|
+ SecondReportingVo reportingVo = new SecondReportingVo();
|
|
|
+ BeanUtils.copyProperties(report, reportingVo);
|
|
|
+
|
|
|
+ // 查询用户表 根据举报用户类型和举报用户ID 查询 life_user 表 user_phone
|
|
|
+ LifeUser reporter = lifeUserMapper.selectById(report.getReportingUserId());
|
|
|
+ if (reporter != null) {
|
|
|
+ // 处理举报用户名称 life_user 表 user_name
|
|
|
+ reportingVo.setReportingUserName(reporter.getUserName());
|
|
|
+ // 处理联系方式 life_user 表 user_phone
|
|
|
+ reportingVo.setReportingUserPhone(reporter.getUserPhone());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 基本信息
|
|
|
+ reportingVo.setId(report.getId());
|
|
|
+ // 处理状态
|
|
|
+ reportingVo.setProcessingStatus(report.getProcessingStatus());
|
|
|
+
|
|
|
+ // 举报时间
|
|
|
+ reportingVo.setReportingTime(report.getCreatedTime());
|
|
|
+ // 举报内容补充
|
|
|
+ reportingVo.setReportingContext(report.getOtherReasonContent());
|
|
|
+
|
|
|
+ // 获取举报类型信息
|
|
|
+ StoreDictionary storeDictionary = dictMap.get(report.getDictType() + "_" + report.getDictId());
|
|
|
+ // 举报类型
|
|
|
+ reportingVo.setReportContextType(storeDictionary.getDictDetail());
|
|
|
+
|
|
|
+ // 二手商品举报
|
|
|
+ SecondGoods secondGoods = secondGoodsMapper.selectById(report.getBusinessId());
|
|
|
+ if (secondGoods != null) {
|
|
|
+ reportingVo.setPrice(secondGoods.getPrice() != null ?
|
|
|
+ secondGoods.getPrice().toString() : null);
|
|
|
+ reportingVo.setHomeImage(secondGoods.getHomeImage());
|
|
|
+ reportingVo.setTitle(secondGoods.getTitle());
|
|
|
+ reportingVo.setDescription(secondGoods.getDescription());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理举报凭证图片
|
|
|
+ QueryWrapper<StoreImg> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.lambda()
|
|
|
+ .eq(StoreImg::getStoreId, report.getId())
|
|
|
+ .eq(StoreImg::getImgType, Constants.ImageType.SECOND_HAND_REPORT);
|
|
|
+ List<StoreImg> imgList = storeImgMapper.selectList(wrapper);
|
|
|
+ if (CollectionUtil.isNotEmpty(imgList)) {
|
|
|
+ // 提取图片URL
|
|
|
+ reportingVo.setImgList(processReportImages(imgList, 1));
|
|
|
+ }
|
|
|
+
|
|
|
+ reportingVos.add(reportingVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ return reportingVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理举报凭证图片
|
|
|
+ * @param imageList 图片URL集合
|
|
|
+ * @param type 类型 1-举报 2-商品
|
|
|
+ * @return 图片列表
|
|
|
+ */
|
|
|
+ private List<Map<String, Object>> processReportImages(List<StoreImg> imageList, Integer type) {
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ List<String> videoFileType = Arrays.asList("mp4", "avi", "flv", "mkv", "rmvb", "wmv", "3gp", "mov");
|
|
|
+
|
|
|
+ for (StoreImg img : imageList) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ String fileType = img.getImgUrl().substring(img.getImgUrl().lastIndexOf(".") + 1);
|
|
|
+ if (videoFileType.contains(fileType.toLowerCase())) {
|
|
|
+ map.put("type", "video");
|
|
|
+ } else {
|
|
|
+ map.put("type", "image");
|
|
|
+ }
|
|
|
+ map.put("imgUrl", img.getImgUrl());
|
|
|
+ if (type == 1) {
|
|
|
+ map.put("videoUrl", img.getImgUrl());
|
|
|
+ }
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|