|
|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springblade.client.entity.TableMessage;
|
|
|
import org.springblade.client.serial.mapper.TableMessageMapper;
|
|
|
import org.springblade.client.serial.service.ITableMessageService;
|
|
|
+import org.springblade.client.serial.util.FileUtil;
|
|
|
import org.springblade.client.vo.TableMessageVO;
|
|
|
import org.springblade.common.utils.CreateFileUtil;
|
|
|
import org.springblade.core.oss.MinioTemplate;
|
|
|
@@ -71,7 +72,7 @@ public class TableMessageServiceImpl extends ServiceImpl<TableMessageMapper, Tab
|
|
|
}
|
|
|
//上传json文件]
|
|
|
try {
|
|
|
- String fileName = SecureUtil.getUser().getTenantId() + "/" + SecureUtil.getUser().getUserId() + "/" + tableMessage.getFileName();
|
|
|
+ String fileName = tableMessage.getFileName() +".json";
|
|
|
BladeFile bladeFile = minioTemplate.putFile(bucketName, fileName, multipartFile.getInputStream());
|
|
|
if (StringUtils.isNotBlank(bladeFile.getLink())) {
|
|
|
tableMessage.setFileUrl(bladeFile.getLink());
|
|
|
@@ -81,6 +82,7 @@ public class TableMessageServiceImpl extends ServiceImpl<TableMessageMapper, Tab
|
|
|
} catch (Exception e) {
|
|
|
return R.data(500, "上传json文件失败");
|
|
|
}
|
|
|
+
|
|
|
//R<BladeFile> bladeFileR = ossEndpointClient.putFile(multipartFile);
|
|
|
/*if (bladeFile != null){
|
|
|
tableMessage.setFileUrl(bladeFile.getLink());
|
|
|
@@ -114,4 +116,15 @@ public class TableMessageServiceImpl extends ServiceImpl<TableMessageMapper, Tab
|
|
|
return R.success("保存成功");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public TableMessage getMessage(TableMessage tableMessage) {
|
|
|
+ TableMessage table = baseMapper.selectOne(new QueryWrapper<TableMessage>().setEntity(tableMessage));
|
|
|
+ if (table != null && StringUtils.isNotBlank(table.getFileUrl())){
|
|
|
+ FileUtil fileUtil = new FileUtil();
|
|
|
+ String fileByUrl = fileUtil.readFileByUrl(table.getFileUrl());
|
|
|
+ table.setJsonMessage(fileByUrl);
|
|
|
+ }
|
|
|
+ return table;
|
|
|
+ }
|
|
|
+
|
|
|
}
|