package com.ruoyi.basic.controller;
|
|
import com.ruoyi.basic.dto.StorageAttachmentDTO;
|
import com.ruoyi.basic.service.StorageAttachmentService;
|
import com.ruoyi.framework.web.domain.R;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
@RestController
|
@AllArgsConstructor
|
@Tag(name = "通用上传")
|
@RequestMapping("/storageAttachment")
|
public class StorageAttachmentController {
|
private StorageAttachmentService storageAttachmentService;
|
|
/**
|
* 分页查询通用文件上传的附件信息
|
*
|
* @param storageAttachmentDTO 关联记录信息
|
* @return 分页结果
|
*/
|
@GetMapping("/list")
|
@Operation(summary = "分页查询通用文件上传的附件信息")
|
public R list(StorageAttachmentDTO storageAttachmentDTO) {
|
return R.ok(storageAttachmentService.list(storageAttachmentDTO));
|
}
|
|
/**
|
* 删除通用文件上传的附件信息
|
*
|
* @param ids 文件id列表
|
* @return 删除结果
|
*/
|
@DeleteMapping("/delete")
|
@Operation(summary = "删除通用文件上传的附件信息")
|
public R batchDelete(@RequestBody List<Long> ids) {
|
return R.ok(storageAttachmentService.batchDeleteStorageAttachment(ids));
|
}
|
|
/**
|
* 保存通用文件上传的附件信息
|
*/
|
@PostMapping("/add")
|
@Operation(summary = "保存通用文件上传的附件信息")
|
public R add(@RequestBody StorageAttachmentDTO storageAttachmentDTO) {
|
storageAttachmentService.saveStorageAttachment(storageAttachmentDTO);
|
return R.ok();
|
}
|
}
|