yanghb
2024-12-17 1287337fd0b0c156ec79712f9a600ebeffefe3a6
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
package com.zzg.web.controller.common;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zzg.common.core.domain.AjaxResult;
import com.zzg.system.domain.AttachFile;
import com.zzg.system.service.system.IAttachFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.List;
 
 
@RestController
@Api(tags = "附件管理")
@RequestMapping("/attachFile")
public class AttachFileController {
 
    @Resource
    IAttachFileService attachFileService;
 
    /**
     * @param id 外键id
     * @return
     */
    @GetMapping("/{id}")
    @ApiOperation("根据外键查询")
    public AjaxResult getBy(@PathVariable String id) {
        List<AttachFile> list = attachFileService.list(new LambdaQueryWrapper<AttachFile>()
                .eq(AttachFile::getInventoryId, id));
        return AjaxResult.success(list);
    }
 
}