Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit. On branch develop Your branch is ahead of 'goflyapp/develop' by 2 commits. (use "git push" to publish your local commits) Changes to be committed: modified: README.md modified: pom.xml modified: zlt-business/device-center/pom.xml modified: zlt-business/device-center/src/main/java/com/central/device/controller/AgeDeviceController.java modified: zlt-business/device-center/src/main/java/com/central/device/controller/ApiDeviceController.java modified: zlt-business/device-center/src/main/java/com/central/device/controller/LineFileController.java modified: zlt-business/device-center/src/main/java/com/central/device/feign/OrderCenterService.java modified: zlt-business/device-center/src/main/java/com/central/device/feign/fallback/OrderCenterServiceFallbackFactory.java modified: zlt-business/device-center/src/main/java/com/central/device/listener/DeviceImportListener.java modified: zlt-business/device-center/src/main/java/com/central/device/model/AgeDevice.java modified: zlt-business/device-center/src/main/java/com/central/device/model/LineFile.java modified: zlt-business/device-center/src/main/java/com/central/device/model/excel/AgeDeviceExcel.java modified: zlt-business/device-center/src/main/java/com/central/device/service/IAgeDeviceService.java modified: zlt-business/device-center/src/main/java/com/central/device/service/ILineFileService.java modified: zlt-business/device-center/src/main/java/com/central/device/service/impl/AgeDeviceServiceImpl.java modified: zlt-business/device-center/src/main/java/com/central/device/service/impl/LineFileServiceImpl.java modified: zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java modified: zlt-business/file-center/src/main/java/com/central/file/service/impl/OssService.java modified: zlt-business/file-center/src/main/resources/application.yml modified: zlt-business/order-center/src/main/java/com/central/order/controller/OrderController.java modified: zlt-business/order-center/src/main/java/com/central/order/controller/QrCodeController.java modified: zlt-business/order-center/src/main/java/com/central/order/feign/DeviceCenterService.java modified: zlt-business/order-center/src/main/java/com/central/order/feign/fallback/DeviceCenterServiceFallbackFactory.java modified: zlt-business/order-center/src/main/java/com/central/order/model/Order.java modified: zlt-commons/zlt-common-core/src/main/java/com/central/common/model/FileInfo.java modified: zlt-web/react-web/src/main/frontend/config/config.ts modified: zlt-web/react-web/src/main/frontend/config/routes.ts modified: zlt-web/react-web/src/main/frontend/nginx.conf modified: zlt-web/react-web/src/main/frontend/package.json new file: zlt-web/react-web/src/main/frontend/src/pages/device/Device/components/UpdateForm.tsx new file: zlt-web/react-web/src/main/frontend/src/pages/device/Device/index.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline/components/UpdateForm.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline/index.tsx deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/components/UpdateForm.tsx deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/index.less deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/index.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/orders/OrderFile/index.tsx modified: zlt-web/react-web/src/main/frontend/src/services/device/api.ts modified: zlt-web/react-web/src/main/frontend/src/services/device/typings.d.ts
This commit is contained in:
+6
-1
@@ -5,6 +5,7 @@ import com.central.common.model.PageResult;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.file.service.IFileService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -26,6 +27,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author 作者 owen E-mail: 624191343@qq.com
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class FileController {
|
||||
@Autowired
|
||||
@@ -103,7 +105,10 @@ public class FileController {
|
||||
|
||||
@GetMapping("/file/{id}")
|
||||
public String getFileViewUrl(@PathVariable String id) {
|
||||
return fileService.getViewUrl(id);
|
||||
log.info("请求文件可访问链接,参数文件Id:{}",id);
|
||||
String viewUrl = fileService.getViewUrl(id);
|
||||
log.info("请求文件可访问链接,链接值:{}",viewUrl);
|
||||
return viewUrl;
|
||||
}
|
||||
|
||||
@GetMapping("/files/{id}")
|
||||
|
||||
+22
-1
@@ -8,8 +8,10 @@ import com.central.common.model.FileInfo;
|
||||
import com.central.oss.model.ObjectInfo;
|
||||
import com.central.oss.properties.FileServerProperties;
|
||||
import com.central.oss.template.OssTemplate;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -22,6 +24,7 @@ import java.io.OutputStream;
|
||||
* @date 2025/1/13
|
||||
* <p>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@ConditionalOnProperty(prefix = FileServerProperties.PREFIX, name = "type", havingValue = FileServerProperties.TYPE_OSS)
|
||||
public class OssService extends AbstractIFileService {
|
||||
@@ -87,7 +90,25 @@ public class OssService extends AbstractIFileService {
|
||||
|
||||
@Override
|
||||
public FileInfo getFileInfo(String id) {
|
||||
return baseMapper.findById(id);
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
log.warn("文件ID为空");
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
log.info("开始查询文件信息: fileId={}", id);
|
||||
FileInfo fileInfo = baseMapper.selectById(id.trim()); // 添加trim()去除可能的空格
|
||||
|
||||
if (fileInfo == null) {
|
||||
log.warn("未找到文件信息: fileId={}", id);
|
||||
return null;
|
||||
}
|
||||
|
||||
log.info("查询文件信息成功: fileId={}, path={}", fileInfo.getId(), fileInfo.getPath());
|
||||
return fileInfo;
|
||||
} catch (Exception e) {
|
||||
log.error("查询文件信息异常: fileId={}, error={}", id, e.getMessage(), e);
|
||||
throw new RuntimeException("查询文件信息失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,7 +47,7 @@ zlt:
|
||||
bucketName: ${zlt.oss.bucketName}
|
||||
#多租户配置
|
||||
tenant:
|
||||
enable: true
|
||||
enable: false
|
||||
|
||||
#fastDFS配置
|
||||
#fdfs:
|
||||
|
||||
Reference in New Issue
Block a user