|
@@ -3,6 +3,7 @@ package com.gis.cms.service.impl;
|
|
|
|
|
|
import cn.hutool.core.io.FileTypeUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.gis.cms.config.RabbitConfig;
|
|
|
import com.gis.cms.entity.po.FodderEntity;
|
|
|
import com.gis.cms.mapper.FodderMapper;
|
|
@@ -19,6 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by owen on 2022/3/23 0023 16:45
|
|
@@ -61,6 +63,8 @@ public class ProduceServiceImpl implements ProducerService {
|
|
|
|
|
|
//生成预览图、固定命名
|
|
|
ImgUtil.compressImg(savePath, "/preview.jpg", 1920, 960);
|
|
|
+ //生成缩略图
|
|
|
+ ImgUtil.compressImg(savePath, "/thumb.jpg", 100, 100);
|
|
|
|
|
|
FodderEntity entity = new FodderEntity();
|
|
|
entity.setFileName(file.getOriginalFilename());
|
|
@@ -71,6 +75,7 @@ public class ProduceServiceImpl implements ProducerService {
|
|
|
entity.setCreatorId(userId);
|
|
|
entity.setFilePath(basePath);
|
|
|
entity.setTempId(tempId);
|
|
|
+ entity.setIcon("/thumb.jpg");
|
|
|
|
|
|
|
|
|
fodderMapper.insert(entity);
|
|
@@ -86,6 +91,17 @@ public class ProduceServiceImpl implements ProducerService {
|
|
|
return Result.success(entity);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result checkStatus(String ids) {
|
|
|
+ Long userId = JwtUtil.getUserId(request.getHeader("token"));
|
|
|
+
|
|
|
+ LambdaQueryWrapper<FodderEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(FodderEntity::getCreatorId, userId);
|
|
|
+ wrapper.in(FodderEntity::getId, ids);
|
|
|
+
|
|
|
+ return Result.success(fodderMapper.selectList(wrapper));
|
|
|
+ }
|
|
|
+
|
|
|
private void checkImgType(MultipartFile file){
|
|
|
// 次方法可以读取到图片内部结构, 可以检验非全景图
|
|
|
try {
|