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 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 uploadRelaList = uploadRelaService.listByUploadId(uploadId); for (SysUploadRela uploadRela : uploadRelaList) { uploadRela.setUpload(uploadService.getById(uploadRela.getUploadId())); } return Result.ok(uploadRelaList); } }