cuilei
7 天以前 b0ec9895cde2519bc085ac40acbeea89ae8b6f9d
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
package org.jeecg.modules.system.controller;
 
import java.util.List;
 
import org.jeecg.common.api.vo.Result;
 
import org.jeecg.common.system.base.entity.SysUploadRela;
import org.jeecg.modules.system.service.IUploadRelaService;
import org.jeecg.modules.system.service.IUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import io.swagger.annotations.Api;
 
@Api(tags = "上传文件与业务数据关系 前端控制器")
@RestController
@RequestMapping("/sys/uploadRela")
public class UploadRelaController {
 
    @Autowired
    private IUploadService uploadService;
 
    @Autowired
    private IUploadRelaService uploadRelaService;
 
    @GetMapping("/listByBusIdAndBusType")
    public Result<?> listByBusIdAndBusType(@RequestParam("busId") String busId,
            @RequestParam("busType") String busType) {
        List<SysUploadRela> uploadRelaList = uploadRelaService.listByBusIdAndBusType(busId, busType);
        for (SysUploadRela uploadRela : uploadRelaList) {
            uploadRela.setUpload(uploadService.getById(uploadRela.getUploadId()));
        }
        return Result.ok(uploadRelaList);
    }
    
    @GetMapping("/listByUploadId")
    public Result<?> listByUploadId(@RequestParam("uploadId") String uploadId) {
        List<SysUploadRela> uploadRelaList = uploadRelaService.listByUploadId(uploadId);
        for (SysUploadRela uploadRela : uploadRelaList) {
            uploadRela.setUpload(uploadService.getById(uploadRela.getUploadId()));
        }
        return Result.ok(uploadRelaList);
    }
 
}