huminmin
22 小时以前 271f4a25576ac6c2c8f2c4eb4c9782d6eef85124
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
49
50
51
52
53
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();
    }
}