From e79d8c8f9679839bf983341fe2cf3212e1bb3001 Mon Sep 17 00:00:00 2001 From: wangwh <2397901735@qq.com> Date: Mon, 28 Oct 2024 14:44:33 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/gzdyh_test' into gzdyh_test --- dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/client/FileInfoClientController.java | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/client/FileInfoClientController.java b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/client/FileInfoClientController.java index 29031ef..2f2f565 100644 --- a/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/client/FileInfoClientController.java +++ b/dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/client/FileInfoClientController.java @@ -1,11 +1,15 @@ package cn.huge.module.file.controller.client; +import cn.huge.base.common.utils.ObjectUtils; import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; +import cn.huge.module.file.domain.po.FileInfo; import cn.huge.module.file.service.FileInfoService; +import cn.huge.module.sys.dto.FileInfoBaseDTO; import io.lettuce.core.dynamic.annotation.Param; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -59,4 +63,23 @@ return ReturnFailUtils.getRepInfo(); } } + + /** + * 根据id查询 + * @url {ctx}/api/client/fileInfo/getFileInfoById + * @return Object + */ + @GetMapping("/getFileInfoById") + public Object getFileInfoById(@RequestParam(value = "id") String id) { + try { + FileInfoBaseDTO fileInfoBaseDTO = new FileInfoBaseDTO(); + FileInfo fileInfo = service.getById(id); + if (ObjectUtils.isNotEmpty(fileInfo)){ + BeanUtils.copyProperties(fileInfo, fileInfoBaseDTO); + } + return ReturnSucUtils.getRepInfo(fileInfoBaseDTO); + } catch (Exception e) { + return ReturnFailUtils.getRepInfo(); + } + } } -- Gitblit v1.8.0