From 1ac0d92fc65b6e1524b172af4adffbf8974e467b Mon Sep 17 00:00:00 2001 From: liyj <15602261488@163.com> Date: Mon, 28 Oct 2024 08:00:17 +0800 Subject: [PATCH] 1、新功能优化 --- dyh-service/dyh-sys/src/main/java/cn/huge/module/file/controller/client/FileInfoClientController.java | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 insertions(+), 6 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 45a42f5..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.*; @@ -34,13 +38,13 @@ /** * 根据多个所属编号查询附件并根据先根据ownerId再根据附件类型分组 - * @url {ctx}/api/client/fileRelate/listIdTypeInfoByOwnerIdList + * @url {ctx}/api/client/fileInfo/listIdTypeInfoByOwnerIdList * @return Object */ @PostMapping("/listIdTypeInfoByOwnerIdList") - public Object listIdTypeInfoByOwnerIdList(@RequestBody Map<String, Object> term, @RequestParam(value = "mainId") String mainId) { + public Object listIdTypeInfoByOwnerIdList(@RequestBody Map<String, Object> term) { try { - return ReturnSucUtils.getRepInfo(service.listIdTypeInfoByOwnerIdList(term, mainId)); + return ReturnSucUtils.getRepInfo(service.listIdTypeInfoByOwnerIdList(term)); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); } @@ -48,13 +52,32 @@ /** * 根据多个所属编号查询附件 - * @url {ctx}/api/client/fileRelate/listInfoByOwnerIdList + * @url {ctx}/api/client/fileInfo/listInfoByOwnerIdList * @return Object */ @PostMapping("/listInfoByOwnerIdList") - public Object listInfoByOwnerIdList(@RequestBody Map<String, Object> term, @RequestParam(value = "mainId") String mainId) { + public Object listInfoByOwnerIdList(@RequestBody Map<String, Object> term) { try { - return ReturnSucUtils.getRepInfo(service.listInfoByOwnerIdList(term, mainId)); + return ReturnSucUtils.getRepInfo(service.listInfoByOwnerIdList(term)); + } catch (Exception e) { + 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