Merge branch 'master' into dev
# Conflicts: # lego-core/src/main/java/com/lego/core/service/impl/CourseServiceImpl.java # lego-system/src/main/java/com/lego/system/service/impl/SysOssServiceImpl.java
Showing
10 changed files
with
111 additions
and
63 deletions
| ... | @@ -103,6 +103,9 @@ public class SysOssController extends BaseController { | ... | @@ -103,6 +103,9 @@ public class SysOssController extends BaseController { |
| 103 | @DeleteMapping("/{ossIds}") | 103 | @DeleteMapping("/{ossIds}") |
| 104 | public R<Void> remove(@NotEmpty(message = "主键不能为空") | 104 | public R<Void> remove(@NotEmpty(message = "主键不能为空") |
| 105 | @PathVariable Long[] ossIds) { | 105 | @PathVariable Long[] ossIds) { |
| 106 | for(Long id:ossIds){ | ||
| 107 | iSysOssService.delete(id); | ||
| 108 | } | ||
| 106 | return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true)); | 109 | return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true)); |
| 107 | } | 110 | } |
| 108 | 111 | ... | ... |
| ... | @@ -17,9 +17,9 @@ spring: | ... | @@ -17,9 +17,9 @@ spring: |
| 17 | driverClassName: com.mysql.cj.jdbc.Driver | 17 | driverClassName: com.mysql.cj.jdbc.Driver |
| 18 | # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 | 18 | # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 |
| 19 | # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) | 19 | # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) |
| 20 | url: jdbc:mysql://rm-bp13d3m8b478rn6f7do.mysql.rds.aliyuncs.com:3306/lego_manage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true | 20 | url: jdbc:mysql://localhost:3306/lego_manage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true |
| 21 | username: root | 21 | username: root |
| 22 | password: gyongyi!1991 | 22 | password: 1234a! |
| 23 | hikari: | 23 | hikari: |
| 24 | # 最大连接池数量 | 24 | # 最大连接池数量 |
| 25 | maxPoolSize: 20 | 25 | maxPoolSize: 20 | ... | ... |
| ... | @@ -7,19 +7,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ... | @@ -7,19 +7,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 8 | import com.lego.common.core.domain.PageQuery; | 8 | import com.lego.common.core.domain.PageQuery; |
| 9 | import com.lego.common.core.page.TableDataInfo; | 9 | import com.lego.common.core.page.TableDataInfo; |
| 10 | import com.lego.common.core.service.OssService; | ||
| 11 | import com.lego.common.utils.MessageUtils; | 10 | import com.lego.common.utils.MessageUtils; |
| 12 | import com.lego.core.annotation.LanguageAnnotation; | 11 | import com.lego.core.annotation.LanguageAnnotation; |
| 13 | import com.lego.core.domin.Advert; | 12 | import com.lego.core.domin.Advert; |
| 14 | import com.lego.core.domin.BuildingBlock; | ||
| 15 | import com.lego.core.domin.Entirety; | ||
| 16 | import com.lego.core.domin.bo.AdvertBo; | 13 | import com.lego.core.domin.bo.AdvertBo; |
| 17 | import com.lego.core.domin.vo.AdvertVo; | 14 | import com.lego.core.domin.vo.AdvertVo; |
| 18 | import com.lego.core.domin.vo.BuildingBlockVo; | ||
| 19 | import com.lego.core.domin.vo.EntiretyVo; | ||
| 20 | import com.lego.core.enums.StatusEnums; | 15 | import com.lego.core.enums.StatusEnums; |
| 21 | import com.lego.core.mapper.AdvertMapper; | 16 | import com.lego.core.mapper.AdvertMapper; |
| 22 | import com.lego.core.service.IAdvertService; | 17 | import com.lego.core.service.IAdvertService; |
| 18 | import com.lego.system.domain.vo.SysOssVo; | ||
| 19 | import com.lego.system.service.ISysOssService; | ||
| 23 | import lombok.RequiredArgsConstructor; | 20 | import lombok.RequiredArgsConstructor; |
| 24 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| 25 | 22 | ||
| ... | @@ -36,7 +33,7 @@ import java.util.List; | ... | @@ -36,7 +33,7 @@ import java.util.List; |
| 36 | @Service | 33 | @Service |
| 37 | public class AdvertServiceImpl implements IAdvertService { | 34 | public class AdvertServiceImpl implements IAdvertService { |
| 38 | private final AdvertMapper baseMapper; | 35 | private final AdvertMapper baseMapper; |
| 39 | private final OssService ossService; | 36 | private final ISysOssService iSysOssService; |
| 40 | 37 | ||
| 41 | /** | 38 | /** |
| 42 | * 查询列表 | 39 | * 查询列表 |
| ... | @@ -51,7 +48,8 @@ public class AdvertServiceImpl implements IAdvertService { | ... | @@ -51,7 +48,8 @@ public class AdvertServiceImpl implements IAdvertService { |
| 51 | if (ObjectUtil.isNotEmpty(list)) { | 48 | if (ObjectUtil.isNotEmpty(list)) { |
| 52 | for (AdvertVo vo : list) { | 49 | for (AdvertVo vo : list) { |
| 53 | if (StrUtil.isNotBlank(vo.getOssId())) { | 50 | if (StrUtil.isNotBlank(vo.getOssId())) { |
| 54 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | 51 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 52 | vo.setOssUrl(oss.getUrl()); | ||
| 55 | } | 53 | } |
| 56 | } | 54 | } |
| 57 | } | 55 | } |
| ... | @@ -68,7 +66,8 @@ public class AdvertServiceImpl implements IAdvertService { | ... | @@ -68,7 +66,8 @@ public class AdvertServiceImpl implements IAdvertService { |
| 68 | List<AdvertVo> list = baseMapper.selectVoList(Wrappers.<Advert>lambdaQuery().eq(Advert::getStatus, "1")); | 66 | List<AdvertVo> list = baseMapper.selectVoList(Wrappers.<Advert>lambdaQuery().eq(Advert::getStatus, "1")); |
| 69 | for (AdvertVo vo : list) { | 67 | for (AdvertVo vo : list) { |
| 70 | if (StrUtil.isNotBlank(vo.getOssId())) { | 68 | if (StrUtil.isNotBlank(vo.getOssId())) { |
| 71 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | 69 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 70 | vo.setOssUrl(oss.getUrl()); | ||
| 72 | } | 71 | } |
| 73 | } | 72 | } |
| 74 | return list; | 73 | return list; | ... | ... |
| ... | @@ -6,13 +6,11 @@ import cn.hutool.core.util.StrUtil; | ... | @@ -6,13 +6,11 @@ import cn.hutool.core.util.StrUtil; |
| 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 8 | import com.lego.common.core.page.TableDataInfo; | 8 | import com.lego.common.core.page.TableDataInfo; |
| 9 | import com.lego.common.core.service.OssService; | ||
| 10 | import com.lego.common.utils.MessageUtils; | 9 | import com.lego.common.utils.MessageUtils; |
| 11 | import com.lego.common.utils.StreamUtils; | 10 | import com.lego.common.utils.StreamUtils; |
| 12 | import com.lego.core.annotation.LanguageAnnotation; | 11 | import com.lego.core.annotation.LanguageAnnotation; |
| 13 | import com.lego.core.domin.BuildingBlock; | 12 | import com.lego.core.domin.BuildingBlock; |
| 14 | import com.lego.core.domin.Course; | 13 | import com.lego.core.domin.Course; |
| 15 | import com.lego.core.domin.Entirety; | ||
| 16 | import com.lego.core.domin.bo.BuildingBlockBo; | 14 | import com.lego.core.domin.bo.BuildingBlockBo; |
| 17 | import com.lego.core.domin.bo.BuildingBlockQueryBo; | 15 | import com.lego.core.domin.bo.BuildingBlockQueryBo; |
| 18 | import com.lego.core.domin.vo.BuildingBlockVo; | 16 | import com.lego.core.domin.vo.BuildingBlockVo; |
| ... | @@ -21,6 +19,8 @@ import com.lego.core.mapper.BuildingBlockMapper; | ... | @@ -21,6 +19,8 @@ import com.lego.core.mapper.BuildingBlockMapper; |
| 21 | import com.lego.core.mapper.CourseMapper; | 19 | import com.lego.core.mapper.CourseMapper; |
| 22 | import com.lego.core.service.IBuildingBlockService; | 20 | import com.lego.core.service.IBuildingBlockService; |
| 23 | import com.lego.core.service.IEntiretyService; | 21 | import com.lego.core.service.IEntiretyService; |
| 22 | import com.lego.system.domain.vo.SysOssVo; | ||
| 23 | import com.lego.system.service.ISysOssService; | ||
| 24 | import lombok.RequiredArgsConstructor; | 24 | import lombok.RequiredArgsConstructor; |
| 25 | import org.apache.commons.compress.utils.Lists; | 25 | import org.apache.commons.compress.utils.Lists; |
| 26 | import org.springframework.stereotype.Service; | 26 | import org.springframework.stereotype.Service; |
| ... | @@ -43,8 +43,8 @@ import java.util.Set; | ... | @@ -43,8 +43,8 @@ import java.util.Set; |
| 43 | public class BuildingBlockServiceImpl implements IBuildingBlockService { | 43 | public class BuildingBlockServiceImpl implements IBuildingBlockService { |
| 44 | private final BuildingBlockMapper baseMapper; | 44 | private final BuildingBlockMapper baseMapper; |
| 45 | private final IEntiretyService entiretyService; | 45 | private final IEntiretyService entiretyService; |
| 46 | private final OssService ossService; | ||
| 47 | private final CourseMapper courseMapper; | 46 | private final CourseMapper courseMapper; |
| 47 | private final ISysOssService iSysOssService; | ||
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | * 查询所有列表(带分页) | 50 | * 查询所有列表(带分页) |
| ... | @@ -69,7 +69,8 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { | ... | @@ -69,7 +69,8 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { |
| 69 | for (BuildingBlockVo vo : list) { | 69 | for (BuildingBlockVo vo : list) { |
| 70 | vo.setEntiretyName(entiretyMap.getOrDefault(vo.getEntiretyId(), new EntiretyVo()).getName()); | 70 | vo.setEntiretyName(entiretyMap.getOrDefault(vo.getEntiretyId(), new EntiretyVo()).getName()); |
| 71 | if (StrUtil.isNotBlank(vo.getOssId())) { | 71 | if (StrUtil.isNotBlank(vo.getOssId())) { |
| 72 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | 72 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 73 | vo.setOssUrl(oss.getUrl()); | ||
| 73 | } | 74 | } |
| 74 | } | 75 | } |
| 75 | } | 76 | } |
| ... | @@ -98,7 +99,8 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { | ... | @@ -98,7 +99,8 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { |
| 98 | List<BuildingBlockVo> list = baseMapper.selectVoList(null); | 99 | List<BuildingBlockVo> list = baseMapper.selectVoList(null); |
| 99 | for (BuildingBlockVo vo : list) { | 100 | for (BuildingBlockVo vo : list) { |
| 100 | if (StrUtil.isNotBlank(vo.getOssId())) { | 101 | if (StrUtil.isNotBlank(vo.getOssId())) { |
| 101 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | 102 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 103 | vo.setOssUrl(oss.getUrl()); | ||
| 102 | } | 104 | } |
| 103 | } | 105 | } |
| 104 | return list; | 106 | return list; | ... | ... |
| ... | @@ -17,7 +17,6 @@ import com.lego.core.domin.bo.CourseQueryBo; | ... | @@ -17,7 +17,6 @@ import com.lego.core.domin.bo.CourseQueryBo; |
| 17 | import com.lego.core.domin.vo.BuildingBlockVo; | 17 | import com.lego.core.domin.vo.BuildingBlockVo; |
| 18 | import com.lego.core.domin.vo.CourseVo; | 18 | import com.lego.core.domin.vo.CourseVo; |
| 19 | import com.lego.core.mapper.CourseMapper; | 19 | import com.lego.core.mapper.CourseMapper; |
| 20 | import com.lego.core.mapper.UpgradeMapper; | ||
| 21 | import com.lego.core.service.IBuildingBlockService; | 20 | import com.lego.core.service.IBuildingBlockService; |
| 22 | import com.lego.core.service.ICourseService; | 21 | import com.lego.core.service.ICourseService; |
| 23 | import com.lego.system.domain.vo.SysOssVo; | 22 | import com.lego.system.domain.vo.SysOssVo; |
| ... | @@ -41,7 +40,7 @@ import java.util.Set; | ... | @@ -41,7 +40,7 @@ import java.util.Set; |
| 41 | public class CourseServiceImpl implements ICourseService { | 40 | public class CourseServiceImpl implements ICourseService { |
| 42 | private final CourseMapper baseMapper; | 41 | private final CourseMapper baseMapper; |
| 43 | private final IBuildingBlockService buildingBlockService; | 42 | private final IBuildingBlockService buildingBlockService; |
| 44 | private final ISysOssService ossService; | 43 | private final ISysOssService iSysOssService; |
| 45 | private final OssService ossUrlService; | 44 | private final OssService ossUrlService; |
| 46 | 45 | ||
| 47 | /** | 46 | /** |
| ... | @@ -63,19 +62,24 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -63,19 +62,24 @@ public class CourseServiceImpl implements ICourseService { |
| 63 | for (CourseVo vo : list) { | 62 | for (CourseVo vo : list) { |
| 64 | vo.setBuildingBlockName(blockMap.getOrDefault(vo.getBuildingBlockId(), new BuildingBlockVo()).getName()); | 63 | vo.setBuildingBlockName(blockMap.getOrDefault(vo.getBuildingBlockId(), new BuildingBlockVo()).getName()); |
| 65 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ | 64 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ |
| 66 | vo.setTwoDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getTwoDimensionalOssId())); | 65 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalOssId())); |
| 66 | vo.setTwoDimensionalOssUrl(oss.getUrl()); | ||
| 67 | } | 67 | } |
| 68 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ | 68 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ |
| 69 | vo.setThreeDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getThreeDimensionalOssId())); | 69 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalOssId())); |
| 70 | vo.setThreeDimensionalOssUrl(oss.getUrl()); | ||
| 70 | } | 71 | } |
| 71 | if(StrUtil.isNotBlank(vo.getCaseOssId())){ | 72 | if(StrUtil.isNotBlank(vo.getCaseOssId())){ |
| 72 | vo.setCaseOssUrl(ossUrlService.selectUrlByIds(vo.getCaseOssId())); | 73 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getCaseOssId())); |
| 74 | vo.setCaseOssUrl(oss.getUrl()); | ||
| 73 | } | 75 | } |
| 74 | if(StrUtil.isNotBlank(vo.getTeachingOssId())){ | 76 | if(StrUtil.isNotBlank(vo.getTeachingOssId())){ |
| 75 | vo.setTeachingOssUrl(ossUrlService.selectUrlByIds(vo.getTeachingOssId())); | 77 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTeachingOssId())); |
| 78 | vo.setTeachingOssUrl(oss.getUrl()); | ||
| 76 | } | 79 | } |
| 77 | if(StrUtil.isNotBlank(vo.getPptOssId())){ | 80 | if(StrUtil.isNotBlank(vo.getPptOssId())){ |
| 78 | vo.setPptOssUrl(ossUrlService.selectUrlByIds(vo.getPptOssId())); | 81 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getPptOssId())); |
| 82 | vo.setPptOssUrl(oss.getUrl()); | ||
| 79 | } | 83 | } |
| 80 | } | 84 | } |
| 81 | } | 85 | } |
| ... | @@ -92,19 +96,24 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -92,19 +96,24 @@ public class CourseServiceImpl implements ICourseService { |
| 92 | List<CourseVo> list = baseMapper.selectVoList(Wrappers.<Course>lambdaQuery().eq(Course::getBuildingBlockId, buildingBlockId)); | 96 | List<CourseVo> list = baseMapper.selectVoList(Wrappers.<Course>lambdaQuery().eq(Course::getBuildingBlockId, buildingBlockId)); |
| 93 | for (CourseVo vo : list) { | 97 | for (CourseVo vo : list) { |
| 94 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ | 98 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ |
| 95 | vo.setTwoDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getTwoDimensionalOssId())); | 99 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalOssId())); |
| 100 | vo.setTwoDimensionalOssUrl(oss.getUrl()); | ||
| 96 | } | 101 | } |
| 97 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ | 102 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ |
| 98 | vo.setThreeDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getThreeDimensionalOssId())); | 103 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalOssId())); |
| 104 | vo.setThreeDimensionalOssUrl(oss.getUrl()); | ||
| 99 | } | 105 | } |
| 100 | if(StrUtil.isNotBlank(vo.getCaseOssId())){ | 106 | if(StrUtil.isNotBlank(vo.getCaseOssId())){ |
| 101 | vo.setCaseOssUrl(ossUrlService.selectUrlByIds(vo.getCaseOssId())); | 107 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getCaseOssId())); |
| 108 | vo.setCaseOssUrl(oss.getUrl()); | ||
| 102 | } | 109 | } |
| 103 | if(StrUtil.isNotBlank(vo.getTeachingOssId())){ | 110 | if(StrUtil.isNotBlank(vo.getTeachingOssId())){ |
| 104 | vo.setTeachingOssUrl(ossUrlService.selectUrlByIds(vo.getTeachingOssId())); | 111 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTeachingOssId())); |
| 112 | vo.setTeachingOssUrl(oss.getUrl()); | ||
| 105 | } | 113 | } |
| 106 | if(StrUtil.isNotBlank(vo.getPptOssId())){ | 114 | if(StrUtil.isNotBlank(vo.getPptOssId())){ |
| 107 | vo.setPptOssUrl(ossUrlService.selectUrlByIds(vo.getPptOssId())); | 115 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getPptOssId())); |
| 116 | vo.setPptOssUrl(oss.getUrl()); | ||
| 108 | } | 117 | } |
| 109 | } | 118 | } |
| 110 | return list; | 119 | return list; |
| ... | @@ -126,37 +135,48 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -126,37 +135,48 @@ public class CourseServiceImpl implements ICourseService { |
| 126 | List<CourseVo> list = baseMapper.selectVoList(null); | 135 | List<CourseVo> list = baseMapper.selectVoList(null); |
| 127 | for (CourseVo vo : list) { | 136 | for (CourseVo vo : list) { |
| 128 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ | 137 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ |
| 129 | vo.setTwoDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getTwoDimensionalOssId())); | 138 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalOssId())); |
| 139 | vo.setTwoDimensionalOssUrl(oss.getUrl()); | ||
| 130 | } | 140 | } |
| 131 | if(StrUtil.isNotBlank(vo.getTwoDimensionalUrl())){ | 141 | if(StrUtil.isNotBlank(vo.getTwoDimensionalUrl())){ |
| 132 | vo.setTwoDimensionalUrl(ossUrlService.selectUrlByIds(vo.getTwoDimensionalUrl())); | 142 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalUrl())); |
| 143 | vo.setTwoDimensionalUrl(oss.getUrl()); | ||
| 133 | } | 144 | } |
| 134 | if(StrUtil.isNotBlank(vo.getTwoDimensionalType())){ | 145 | if(StrUtil.isNotBlank(vo.getTwoDimensionalType())){ |
| 135 | vo.setTwoDimensionalType(ossUrlService.selectUrlByIds(vo.getTwoDimensionalType())); | 146 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalType())); |
| 147 | vo.setTwoDimensionalType(oss.getUrl()); | ||
| 136 | } | 148 | } |
| 137 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ | 149 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ |
| 138 | vo.setThreeDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getThreeDimensionalOssId())); | 150 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalOssId())); |
| 151 | vo.setThreeDimensionalOssUrl(oss.getUrl()); | ||
| 139 | } | 152 | } |
| 140 | if(StrUtil.isNotBlank(vo.getThreeDimensionalUrl())){ | 153 | if(StrUtil.isNotBlank(vo.getThreeDimensionalUrl())){ |
| 141 | vo.setThreeDimensionalUrl(ossUrlService.selectUrlByIds(vo.getThreeDimensionalUrl())); | 154 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalUrl())); |
| 155 | vo.setThreeDimensionalUrl(oss.getUrl()); | ||
| 142 | } | 156 | } |
| 143 | if(StrUtil.isNotBlank(vo.getThreeDimensionalType())){ | 157 | if(StrUtil.isNotBlank(vo.getThreeDimensionalType())){ |
| 144 | vo.setThreeDimensionalType(ossUrlService.selectUrlByIds(vo.getThreeDimensionalType())); | 158 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalType())); |
| 159 | vo.setThreeDimensionalType(oss.getUrl()); | ||
| 145 | } | 160 | } |
| 146 | if(StrUtil.isNotBlank(vo.getCaseOssId())){ | 161 | if(StrUtil.isNotBlank(vo.getCaseOssId())){ |
| 147 | vo.setCaseOssUrl(ossUrlService.selectUrlByIds(vo.getCaseOssId())); | 162 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getCaseOssId())); |
| 163 | vo.setCaseOssUrl(oss.getUrl()); | ||
| 148 | vo.setCaseFileVoList(ossUrlService.selectFileVoByIds(vo.getCaseOssId())); | 164 | vo.setCaseFileVoList(ossUrlService.selectFileVoByIds(vo.getCaseOssId())); |
| 149 | } | 165 | } |
| 150 | if(StrUtil.isNotBlank(vo.getTeachingOssId())){ | 166 | if(StrUtil.isNotBlank(vo.getTeachingOssId())){ |
| 151 | vo.setTeachingOssUrl(ossUrlService.selectUrlByIds(vo.getTeachingOssId())); | 167 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTeachingOssId())); |
| 168 | vo.setTeachingOssUrl(oss.getUrl()); | ||
| 152 | vo.setTeachingFileVoList(ossUrlService.selectFileVoByIds(vo.getTeachingOssId())); | 169 | vo.setTeachingFileVoList(ossUrlService.selectFileVoByIds(vo.getTeachingOssId())); |
| 153 | } | 170 | } |
| 154 | if(StrUtil.isNotBlank(vo.getPptOssId())){ | 171 | if(StrUtil.isNotBlank(vo.getPptOssId())){ |
| 155 | vo.setPptOssUrl(ossUrlService.selectUrlByIds(vo.getPptOssId())); | 172 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getPptOssId())); |
| 173 | vo.setPptOssUrl(oss.getUrl()); | ||
| 156 | vo.setPptFileVoList(ossUrlService.selectFileVoByIds(vo.getPptOssId())); | 174 | vo.setPptFileVoList(ossUrlService.selectFileVoByIds(vo.getPptOssId())); |
| 157 | } | 175 | } |
| 176 | |||
| 158 | if(StrUtil.isNotBlank(vo.getOssId())){ | 177 | if(StrUtil.isNotBlank(vo.getOssId())){ |
| 159 | vo.setOssUrl(ossUrlService.selectUrlByIds(vo.getOssId())); | 178 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 179 | vo.setOssUrl(oss.getUrl()); | ||
| 160 | } | 180 | } |
| 161 | } | 181 | } |
| 162 | return list; | 182 | return list; |
| ... | @@ -214,7 +234,7 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -214,7 +234,7 @@ public class CourseServiceImpl implements ICourseService { |
| 214 | */ | 234 | */ |
| 215 | private void setCaseName(Course course) { | 235 | private void setCaseName(Course course) { |
| 216 | if (StrUtil.isNotBlank(course.getCaseOssId())) { | 236 | if (StrUtil.isNotBlank(course.getCaseOssId())) { |
| 217 | SysOssVo sysOssVo = ossService.getById(Long.valueOf(course.getCaseOssId())); | 237 | SysOssVo sysOssVo = iSysOssService.getById(Long.valueOf(course.getCaseOssId())); |
| 218 | String suffix = sysOssVo.getFileSuffix(); | 238 | String suffix = sysOssVo.getFileSuffix(); |
| 219 | if (sysOssVo.getOriginalName().endsWith(suffix)) { | 239 | if (sysOssVo.getOriginalName().endsWith(suffix)) { |
| 220 | course.setCaseName(sysOssVo.getOriginalName().replace(suffix, "")); | 240 | course.setCaseName(sysOssVo.getOriginalName().replace(suffix, "")); |
| ... | @@ -231,7 +251,7 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -231,7 +251,7 @@ public class CourseServiceImpl implements ICourseService { |
| 231 | */ | 251 | */ |
| 232 | private void setTeachingName(Course course) { | 252 | private void setTeachingName(Course course) { |
| 233 | if (StrUtil.isNotBlank(course.getCaseOssId())) { | 253 | if (StrUtil.isNotBlank(course.getCaseOssId())) { |
| 234 | SysOssVo sysOssVo = ossService.getById(Long.valueOf(course.getCaseOssId())); | 254 | SysOssVo sysOssVo = iSysOssService.getById(Long.valueOf(course.getCaseOssId())); |
| 235 | String suffix = sysOssVo.getFileSuffix(); | 255 | String suffix = sysOssVo.getFileSuffix(); |
| 236 | if (sysOssVo.getOriginalName().endsWith(suffix)) { | 256 | if (sysOssVo.getOriginalName().endsWith(suffix)) { |
| 237 | course.setTeachingName(sysOssVo.getOriginalName().replace(suffix, "")); | 257 | course.setTeachingName(sysOssVo.getOriginalName().replace(suffix, "")); |
| ... | @@ -248,7 +268,7 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -248,7 +268,7 @@ public class CourseServiceImpl implements ICourseService { |
| 248 | */ | 268 | */ |
| 249 | private void setPptName(Course course) { | 269 | private void setPptName(Course course) { |
| 250 | if (StrUtil.isNotBlank(course.getCaseOssId())) { | 270 | if (StrUtil.isNotBlank(course.getCaseOssId())) { |
| 251 | SysOssVo sysOssVo = ossService.getById(Long.valueOf(course.getCaseOssId())); | 271 | SysOssVo sysOssVo = iSysOssService.getById(Long.valueOf(course.getCaseOssId())); |
| 252 | String suffix = sysOssVo.getFileSuffix(); | 272 | String suffix = sysOssVo.getFileSuffix(); |
| 253 | if (sysOssVo.getOriginalName().endsWith(suffix)) { | 273 | if (sysOssVo.getOriginalName().endsWith(suffix)) { |
| 254 | course.setPptName(sysOssVo.getOriginalName().replace(suffix, "")); | 274 | course.setPptName(sysOssVo.getOriginalName().replace(suffix, "")); | ... | ... |
| ... | @@ -2,12 +2,10 @@ package com.lego.core.service.impl; | ... | @@ -2,12 +2,10 @@ package com.lego.core.service.impl; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.util.StrUtil; | 4 | import cn.hutool.core.util.StrUtil; |
| 5 | import com.baomidou.mybatisplus.core.toolkit.BeanUtils; | ||
| 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 8 | import com.lego.common.core.domain.PageQuery; | 7 | import com.lego.common.core.domain.PageQuery; |
| 9 | import com.lego.common.core.page.TableDataInfo; | 8 | import com.lego.common.core.page.TableDataInfo; |
| 10 | import com.lego.common.core.service.OssService; | ||
| 11 | import com.lego.common.utils.MessageUtils; | 9 | import com.lego.common.utils.MessageUtils; |
| 12 | import com.lego.common.utils.StreamUtils; | 10 | import com.lego.common.utils.StreamUtils; |
| 13 | import com.lego.common.utils.spring.SpringUtils; | 11 | import com.lego.common.utils.spring.SpringUtils; |
| ... | @@ -21,12 +19,17 @@ import com.lego.core.mapper.BuildingBlockMapper; | ... | @@ -21,12 +19,17 @@ import com.lego.core.mapper.BuildingBlockMapper; |
| 21 | import com.lego.core.mapper.EntiretyMapper; | 19 | import com.lego.core.mapper.EntiretyMapper; |
| 22 | import com.lego.core.service.IBuildingBlockService; | 20 | import com.lego.core.service.IBuildingBlockService; |
| 23 | import com.lego.core.service.IEntiretyService; | 21 | import com.lego.core.service.IEntiretyService; |
| 22 | import com.lego.system.domain.vo.SysOssVo; | ||
| 23 | import com.lego.system.service.ISysOssService; | ||
| 24 | import io.micrometer.core.instrument.util.StringUtils; | 24 | import io.micrometer.core.instrument.util.StringUtils; |
| 25 | import lombok.RequiredArgsConstructor; | 25 | import lombok.RequiredArgsConstructor; |
| 26 | import org.springframework.stereotype.Service; | 26 | import org.springframework.stereotype.Service; |
| 27 | 27 | ||
| 28 | import java.rmi.ServerException; | 28 | import java.rmi.ServerException; |
| 29 | import java.util.*; | 29 | import java.util.Collection; |
| 30 | import java.util.List; | ||
| 31 | import java.util.Map; | ||
| 32 | import java.util.Set; | ||
| 30 | 33 | ||
| 31 | /** | 34 | /** |
| 32 | * 套件Service业务层处理 | 35 | * 套件Service业务层处理 |
| ... | @@ -39,7 +42,7 @@ import java.util.*; | ... | @@ -39,7 +42,7 @@ import java.util.*; |
| 39 | public class EntiretyServiceImpl implements IEntiretyService { | 42 | public class EntiretyServiceImpl implements IEntiretyService { |
| 40 | private final EntiretyMapper baseMapper; | 43 | private final EntiretyMapper baseMapper; |
| 41 | private final BuildingBlockMapper buildingBlockMapper; | 44 | private final BuildingBlockMapper buildingBlockMapper; |
| 42 | private final OssService ossService; | 45 | private final ISysOssService iSysOssService; |
| 43 | 46 | ||
| 44 | public IBuildingBlockService getBuildingBlockService() { | 47 | public IBuildingBlockService getBuildingBlockService() { |
| 45 | return SpringUtils.getBean(IBuildingBlockService.class); | 48 | return SpringUtils.getBean(IBuildingBlockService.class); |
| ... | @@ -65,12 +68,16 @@ public class EntiretyServiceImpl implements IEntiretyService { | ... | @@ -65,12 +68,16 @@ public class EntiretyServiceImpl implements IEntiretyService { |
| 65 | List<BuildingBlockVo> buildingBlockList = getBuildingBlockService().list(language, buildingBlockIdList); | 68 | List<BuildingBlockVo> buildingBlockList = getBuildingBlockService().list(language, buildingBlockIdList); |
| 66 | for(BuildingBlockVo vo : buildingBlockList){ | 69 | for(BuildingBlockVo vo : buildingBlockList){ |
| 67 | if(StrUtil.isNotBlank(vo.getOssId())) { | 70 | if(StrUtil.isNotBlank(vo.getOssId())) { |
| 68 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | 71 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 72 | vo.setOssUrl(oss.getUrl()); | ||
| 69 | } | 73 | } |
| 70 | } | 74 | } |
| 71 | Map<String,List<BuildingBlockVo>> buildingBlockMap = StreamUtils.groupByKey(buildingBlockList,BuildingBlockVo::getEntiretyId); | 75 | Map<String,List<BuildingBlockVo>> buildingBlockMap = StreamUtils.groupByKey(buildingBlockList,BuildingBlockVo::getEntiretyId); |
| 72 | for(EntiretyVo vo:list){ | 76 | for(EntiretyVo vo:list){ |
| 73 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | 77 | if(StrUtil.isNotBlank(vo.getOssId())) { |
| 78 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); | ||
| 79 | vo.setOssUrl(oss.getUrl()); | ||
| 80 | } | ||
| 74 | vo.setBuildingblockList(buildingBlockMap.get(vo.getId())); | 81 | vo.setBuildingblockList(buildingBlockMap.get(vo.getId())); |
| 75 | } | 82 | } |
| 76 | return TableDataInfo.build(page); | 83 | return TableDataInfo.build(page); |
| ... | @@ -86,12 +93,14 @@ public class EntiretyServiceImpl implements IEntiretyService { | ... | @@ -86,12 +93,14 @@ public class EntiretyServiceImpl implements IEntiretyService { |
| 86 | List<EntiretyVo> list = baseMapper.selectVoList(Wrappers.<Entirety>lambdaQuery().eq(Entirety::getLanguage, language).orderByAsc(Entirety::getSort)); | 93 | List<EntiretyVo> list = baseMapper.selectVoList(Wrappers.<Entirety>lambdaQuery().eq(Entirety::getLanguage, language).orderByAsc(Entirety::getSort)); |
| 87 | for(EntiretyVo vo:list){ | 94 | for(EntiretyVo vo:list){ |
| 88 | if(StrUtil.isNotBlank(vo.getOssId())){ | 95 | if(StrUtil.isNotBlank(vo.getOssId())){ |
| 89 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | 96 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 97 | vo.setOssUrl(oss.getUrl()); | ||
| 90 | } | 98 | } |
| 91 | List<BuildingBlockVo> buildingBlockVoList = buildingBlockMapper.selectVoList(Wrappers.<BuildingBlock>lambdaQuery().eq(BuildingBlock::getLanguage, language).eq(BuildingBlock::getEntiretyId, vo.getId())); | 99 | List<BuildingBlockVo> buildingBlockVoList = buildingBlockMapper.selectVoList(Wrappers.<BuildingBlock>lambdaQuery().eq(BuildingBlock::getLanguage, language).eq(BuildingBlock::getEntiretyId, vo.getId())); |
| 92 | for(BuildingBlockVo blockVo:buildingBlockVoList){ | 100 | for(BuildingBlockVo blockVo:buildingBlockVoList){ |
| 93 | if(StrUtil.isNotBlank(blockVo.getOssId())){ | 101 | if(StrUtil.isNotBlank(blockVo.getOssId())){ |
| 94 | blockVo.setOssUrl(ossService.selectUrlByIds(blockVo.getOssId())); | 102 | SysOssVo oss = iSysOssService.getById(Long.valueOf(blockVo.getOssId())); |
| 103 | vo.setOssUrl(oss.getUrl()); | ||
| 95 | } | 104 | } |
| 96 | } | 105 | } |
| 97 | vo.setBuildingblockList(buildingBlockVoList); | 106 | vo.setBuildingblockList(buildingBlockVoList); |
| ... | @@ -110,7 +119,8 @@ public class EntiretyServiceImpl implements IEntiretyService { | ... | @@ -110,7 +119,8 @@ public class EntiretyServiceImpl implements IEntiretyService { |
| 110 | List<EntiretyVo> list = baseMapper.selectVoList(null); | 119 | List<EntiretyVo> list = baseMapper.selectVoList(null); |
| 111 | for(EntiretyVo vo:list){ | 120 | for(EntiretyVo vo:list){ |
| 112 | if(StrUtil.isNotBlank(vo.getOssId())){ | 121 | if(StrUtil.isNotBlank(vo.getOssId())){ |
| 113 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | 122 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 123 | vo.setOssUrl(oss.getUrl()); | ||
| 114 | } | 124 | } |
| 115 | } | 125 | } |
| 116 | return list; | 126 | return list; | ... | ... |
| ... | @@ -5,10 +5,8 @@ import cn.hutool.core.util.StrUtil; | ... | @@ -5,10 +5,8 @@ import cn.hutool.core.util.StrUtil; |
| 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 7 | import com.lego.common.core.page.TableDataInfo; | 7 | import com.lego.common.core.page.TableDataInfo; |
| 8 | import com.lego.common.core.service.OssService; | ||
| 9 | import com.lego.common.utils.MessageUtils; | 8 | import com.lego.common.utils.MessageUtils; |
| 10 | import com.lego.core.annotation.LanguageAnnotation; | 9 | import com.lego.core.annotation.LanguageAnnotation; |
| 11 | import com.lego.core.domin.Course; | ||
| 12 | import com.lego.core.domin.Question; | 10 | import com.lego.core.domin.Question; |
| 13 | import com.lego.core.domin.bo.QuestionBo; | 11 | import com.lego.core.domin.bo.QuestionBo; |
| 14 | import com.lego.core.domin.bo.QuestionQueryBo; | 12 | import com.lego.core.domin.bo.QuestionQueryBo; |
| ... | @@ -16,6 +14,8 @@ import com.lego.core.domin.vo.QuestionVo; | ... | @@ -16,6 +14,8 @@ import com.lego.core.domin.vo.QuestionVo; |
| 16 | import com.lego.core.enums.StatusEnums; | 14 | import com.lego.core.enums.StatusEnums; |
| 17 | import com.lego.core.mapper.QuestionMapper; | 15 | import com.lego.core.mapper.QuestionMapper; |
| 18 | import com.lego.core.service.IQuestionService; | 16 | import com.lego.core.service.IQuestionService; |
| 17 | import com.lego.system.domain.vo.SysOssVo; | ||
| 18 | import com.lego.system.service.ISysOssService; | ||
| 19 | import lombok.RequiredArgsConstructor; | 19 | import lombok.RequiredArgsConstructor; |
| 20 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
| 21 | 21 | ||
| ... | @@ -32,7 +32,7 @@ import java.util.List; | ... | @@ -32,7 +32,7 @@ import java.util.List; |
| 32 | @Service | 32 | @Service |
| 33 | public class QuestionServiceImpl implements IQuestionService { | 33 | public class QuestionServiceImpl implements IQuestionService { |
| 34 | private final QuestionMapper baseMapper; | 34 | private final QuestionMapper baseMapper; |
| 35 | private final OssService ossService; | 35 | private final ISysOssService iSysOssService; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * 查询列表 | 38 | * 查询列表 |
| ... | @@ -62,10 +62,12 @@ public class QuestionServiceImpl implements IQuestionService { | ... | @@ -62,10 +62,12 @@ public class QuestionServiceImpl implements IQuestionService { |
| 62 | vo.setShowStr(sb.substring(0, sb.length() - 1)); | 62 | vo.setShowStr(sb.substring(0, sb.length() - 1)); |
| 63 | } | 63 | } |
| 64 | if(StrUtil.isNotBlank(vo.getCoverOssId())){ | 64 | if(StrUtil.isNotBlank(vo.getCoverOssId())){ |
| 65 | vo.setCoverOssUrl(ossService.selectUrlByIds(vo.getCoverOssId())); | 65 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getCoverOssId())); |
| 66 | vo.setCoverOssUrl(oss.getUrl()); | ||
| 66 | } | 67 | } |
| 67 | if(StrUtil.isNotBlank(vo.getVideoOssId())){ | 68 | if(StrUtil.isNotBlank(vo.getVideoOssId())){ |
| 68 | vo.setVideoOssUrl(ossService.selectUrlByIds(vo.getVideoOssId())); | 69 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getVideoOssId())); |
| 70 | vo.setVideoOssUrl(oss.getUrl()); | ||
| 69 | } | 71 | } |
| 70 | } | 72 | } |
| 71 | return TableDataInfo.build(page); | 73 | return TableDataInfo.build(page); |
| ... | @@ -93,10 +95,12 @@ public class QuestionServiceImpl implements IQuestionService { | ... | @@ -93,10 +95,12 @@ public class QuestionServiceImpl implements IQuestionService { |
| 93 | vo.setShowStr(sb.substring(0, sb.length() - 1)); | 95 | vo.setShowStr(sb.substring(0, sb.length() - 1)); |
| 94 | } | 96 | } |
| 95 | if(StrUtil.isNotBlank(vo.getCoverOssId())){ | 97 | if(StrUtil.isNotBlank(vo.getCoverOssId())){ |
| 96 | vo.setCoverOssUrl(ossService.selectUrlByIds(vo.getCoverOssId())); | 98 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getCoverOssId())); |
| 99 | vo.setCoverOssUrl(oss.getUrl()); | ||
| 97 | } | 100 | } |
| 98 | if(StrUtil.isNotBlank(vo.getVideoOssId())){ | 101 | if(StrUtil.isNotBlank(vo.getVideoOssId())){ |
| 99 | vo.setVideoOssUrl(ossService.selectUrlByIds(vo.getVideoOssId())); | 102 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getVideoOssId())); |
| 103 | vo.setVideoOssUrl(oss.getUrl()); | ||
| 100 | } | 104 | } |
| 101 | } | 105 | } |
| 102 | return list; | 106 | return list; | ... | ... |
| ... | @@ -19,6 +19,8 @@ import com.lego.core.domin.vo.*; | ... | @@ -19,6 +19,8 @@ import com.lego.core.domin.vo.*; |
| 19 | import com.lego.core.enums.StatusEnums; | 19 | import com.lego.core.enums.StatusEnums; |
| 20 | import com.lego.core.mapper.UpgradeMapper; | 20 | import com.lego.core.mapper.UpgradeMapper; |
| 21 | import com.lego.core.service.*; | 21 | import com.lego.core.service.*; |
| 22 | import com.lego.system.domain.vo.SysOssVo; | ||
| 23 | import com.lego.system.service.ISysOssService; | ||
| 22 | import lombok.RequiredArgsConstructor; | 24 | import lombok.RequiredArgsConstructor; |
| 23 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
| 24 | 26 | ||
| ... | @@ -35,12 +37,12 @@ import java.util.List; | ... | @@ -35,12 +37,12 @@ import java.util.List; |
| 35 | @Service | 37 | @Service |
| 36 | public class UpgradeServiceImpl implements IUpgradeService { | 38 | public class UpgradeServiceImpl implements IUpgradeService { |
| 37 | private final UpgradeMapper baseMapper; | 39 | private final UpgradeMapper baseMapper; |
| 38 | private final OssService ossService; | ||
| 39 | private final IAdvertService advertService; | 40 | private final IAdvertService advertService; |
| 40 | private final IEntiretyService entiretyService; | 41 | private final IEntiretyService entiretyService; |
| 41 | private final IBuildingBlockService buildingBlockService; | 42 | private final IBuildingBlockService buildingBlockService; |
| 42 | private final ICourseService courseService; | 43 | private final ICourseService courseService; |
| 43 | private final IQuestionService questionService; | 44 | private final IQuestionService questionService; |
| 45 | private final ISysOssService iSysOssService; | ||
| 44 | 46 | ||
| 45 | @Override | 47 | @Override |
| 46 | public ResourceVo list() { | 48 | public ResourceVo list() { |
| ... | @@ -81,7 +83,8 @@ public class UpgradeServiceImpl implements IUpgradeService { | ... | @@ -81,7 +83,8 @@ public class UpgradeServiceImpl implements IUpgradeService { |
| 81 | List<UpgradeVo> list = page.getRecords(); | 83 | List<UpgradeVo> list = page.getRecords(); |
| 82 | for (UpgradeVo vo : list) { | 84 | for (UpgradeVo vo : list) { |
| 83 | if (StrUtil.isNotBlank(vo.getFileOssId())) { | 85 | if (StrUtil.isNotBlank(vo.getFileOssId())) { |
| 84 | vo.setOssUrl(ossService.selectUrlByIds(vo.getFileOssId())); | 86 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getFileOssId())); |
| 87 | vo.setOssUrl(oss.getUrl()); | ||
| 85 | } | 88 | } |
| 86 | } | 89 | } |
| 87 | return TableDataInfo.build(page); | 90 | return TableDataInfo.build(page); | ... | ... |
| ... | @@ -35,4 +35,6 @@ public interface ISysOssService { | ... | @@ -35,4 +35,6 @@ public interface ISysOssService { |
| 35 | 35 | ||
| 36 | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); | 36 | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| 37 | 37 | ||
| 38 | void delete(Long ossId); | ||
| 39 | |||
| 38 | } | 40 | } | ... | ... |
| ... | @@ -8,13 +8,11 @@ import cn.hutool.core.util.StrUtil; | ... | @@ -8,13 +8,11 @@ import cn.hutool.core.util.StrUtil; |
| 8 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 8 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 9 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 9 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 10 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 10 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 11 | import com.lego.common.core.service.ConfigService; | ||
| 12 | import com.lego.system.domain.bo.SysOssBo; | ||
| 13 | import com.lego.common.core.domain.dto.BizFileVo; | ||
| 14 | import com.lego.system.service.ISysOssService; | ||
| 15 | import com.lego.common.constant.CacheNames; | 11 | import com.lego.common.constant.CacheNames; |
| 16 | import com.lego.common.core.domain.PageQuery; | 12 | import com.lego.common.core.domain.PageQuery; |
| 13 | import com.lego.common.core.domain.dto.BizFileVo; | ||
| 17 | import com.lego.common.core.page.TableDataInfo; | 14 | import com.lego.common.core.page.TableDataInfo; |
| 15 | import com.lego.common.core.service.ConfigService; | ||
| 18 | import com.lego.common.core.service.OssService; | 16 | import com.lego.common.core.service.OssService; |
| 19 | import com.lego.common.exception.ServiceException; | 17 | import com.lego.common.exception.ServiceException; |
| 20 | import com.lego.common.utils.BeanCopyUtils; | 18 | import com.lego.common.utils.BeanCopyUtils; |
| ... | @@ -26,10 +24,13 @@ import com.lego.oss.entity.UploadResult; | ... | @@ -26,10 +24,13 @@ import com.lego.oss.entity.UploadResult; |
| 26 | import com.lego.oss.enumd.AccessPolicyType; | 24 | import com.lego.oss.enumd.AccessPolicyType; |
| 27 | import com.lego.oss.factory.OssFactory; | 25 | import com.lego.oss.factory.OssFactory; |
| 28 | import com.lego.system.domain.SysOss; | 26 | import com.lego.system.domain.SysOss; |
| 27 | import com.lego.system.domain.bo.SysOssBo; | ||
| 29 | import com.lego.system.domain.vo.SysOssVo; | 28 | import com.lego.system.domain.vo.SysOssVo; |
| 30 | import com.lego.system.mapper.SysOssMapper; | 29 | import com.lego.system.mapper.SysOssMapper; |
| 30 | import com.lego.system.service.ISysOssService; | ||
| 31 | import lombok.RequiredArgsConstructor; | 31 | import lombok.RequiredArgsConstructor; |
| 32 | import lombok.extern.slf4j.Slf4j; | 32 | import lombok.extern.slf4j.Slf4j; |
| 33 | import org.springframework.cache.annotation.CacheEvict; | ||
| 33 | import org.springframework.cache.annotation.Cacheable; | 34 | import org.springframework.cache.annotation.Cacheable; |
| 34 | import org.springframework.http.MediaType; | 35 | import org.springframework.http.MediaType; |
| 35 | import org.springframework.stereotype.Service; | 36 | import org.springframework.stereotype.Service; |
| ... | @@ -88,7 +89,6 @@ public class SysOssServiceImpl implements ISysOssService, OssService { | ... | @@ -88,7 +89,6 @@ public class SysOssServiceImpl implements ISysOssService, OssService { |
| 88 | @Override | 89 | @Override |
| 89 | public List<SysOssVo> listByIds(Collection<Long> ossIds) { | 90 | public List<SysOssVo> listByIds(Collection<Long> ossIds) { |
| 90 | List<SysOssVo> list = new ArrayList<>(); | 91 | List<SysOssVo> list = new ArrayList<>(); |
| 91 | String baseUrl = configService.getConfigValue("sys.oss.baseUrl"); | ||
| 92 | for (Long id : ossIds) { | 92 | for (Long id : ossIds) { |
| 93 | SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); | 93 | SysOssVo vo = SpringUtils.getAopProxy(this).getById(id); |
| 94 | if (ObjectUtil.isNotNull(vo)) { | 94 | if (ObjectUtil.isNotNull(vo)) { |
| ... | @@ -276,6 +276,11 @@ public class SysOssServiceImpl implements ISysOssService, OssService { | ... | @@ -276,6 +276,11 @@ public class SysOssServiceImpl implements ISysOssService, OssService { |
| 276 | } | 276 | } |
| 277 | return baseMapper.deleteBatchIds(ids) > 0; | 277 | return baseMapper.deleteBatchIds(ids) > 0; |
| 278 | } | 278 | } |
| 279 | @Override | ||
| 280 | @CacheEvict(cacheNames = CacheNames.SYS_OSS, key = "#ossId") | ||
| 281 | public void delete(Long ossId){ | ||
| 282 | } | ||
| 283 | |||
| 279 | 284 | ||
| 280 | /** | 285 | /** |
| 281 | * 匹配Url | 286 | * 匹配Url | ... | ... |
-
Please register or sign in to post a comment