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);
|
}
|
|
}
|