forked from gzzfw/backEnd/gz-dyh

liyj
2024-09-05 716f57dacce347ba154f3b6a994f4e383e3a97a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package cn.huge.module.file.controller.client;
 
import cn.huge.base.common.utils.ReturnFailUtils;
import cn.huge.base.common.utils.ReturnSucUtils;
import cn.huge.module.file.service.FileInfoService;
import io.lettuce.core.dynamic.annotation.Param;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
 
/**
 * @title: 附件信息表接口api-web端
 * @description: 附件信息表接口api-web端
 * @company: hugeinfo
 * @author: liyj
 * @time: 2024-08-28 20:06:18
 * @version: 1.0.0
 */
@Slf4j
@RestController
@RequestMapping("/api/client/fileInfo")
public class FileInfoClientController {
 
    @Autowired(required = false)
    private HttpServletRequest request;
 
    @Autowired
    private FileInfoService service;
 
    /**
     * 根据多个所属编号查询附件并根据先根据ownerId再根据附件类型分组
     * @url {ctx}/api/client/fileRelate/listIdTypeInfoByOwnerIdList
     * @return Object
     */
    @PostMapping("/listIdTypeInfoByOwnerIdList")
    public Object listIdTypeInfoByOwnerIdList(@RequestBody  Map<String, Object> term, @RequestParam(value = "mainId") String mainId) {
        try {
            return ReturnSucUtils.getRepInfo(service.listIdTypeInfoByOwnerIdList(term, mainId));
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
 
    /**
     * 根据多个所属编号查询附件
     * @url {ctx}/api/client/fileRelate/listInfoByOwnerIdList
     * @return Object
     */
    @PostMapping("/listInfoByOwnerIdList")
    public Object listInfoByOwnerIdList(@RequestBody Map<String, Object> term, @RequestParam(value = "mainId") String mainId) {
        try {
            return ReturnSucUtils.getRepInfo(service.listInfoByOwnerIdList(term, mainId));
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
}