| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.StorageAttachmentDTO; |
| | | import com.ruoyi.basic.dto.StorageBlobDTO; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.basic.enums.ApplicationTypeEnum; |
| | | import com.ruoyi.basic.enums.RecordTypeEnum; |
| | | import com.ruoyi.basic.pojo.StorageAttachment; |
| | | import com.ruoyi.basic.service.StorageAttachmentService; |
| | | import com.ruoyi.common.constant.StorageAttachmentConstants; |
| | | import com.ruoyi.common.enums.StorageAttachmentRecordType; |
| | | 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.*; |
| | | |
| | |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/basic/storage_attachment") |
| | | @Tag(name = "通用上传") |
| | | @RequestMapping("/storageAttachment") |
| | | public class StorageAttachmentController { |
| | | private StorageAttachmentService storageAttachmentService; |
| | | |
| | | /** |
| | | * 分页查询通用文件上传的附件信息 |
| | | * @param page 分页参数 |
| | | * |
| | | * @param storageAttachmentDTO 关联记录信息 |
| | | * @return 分页结果 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public R listPage(Page page, StorageAttachmentDTO storageAttachmentDTO) { |
| | | return R.ok(storageAttachmentService.listPage(page, storageAttachmentDTO)); |
| | | @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)); |
| | | } |
| | | |
| | | /** |
| | | * 保存通用文件上传的附件信息 |
| | | * @param storageBlobs 文件信息列表 |
| | | * @param recordId 管理记录id |
| | | * @param recordType 关联记录类型 |
| | | * @param fileType 文件类型 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody List<StorageBlobDTO> storageBlobs, Long recordId, String recordType, String fileType) { |
| | | storageAttachmentService.saveStorageAttachment(storageBlobs, recordId, recordType, fileType); |
| | | @Operation(summary = "保存通用文件上传的附件信息") |
| | | public R add(@RequestBody StorageAttachmentDTO storageAttachmentDTO) { |
| | | storageAttachmentService.saveStorageAttachment(storageAttachmentDTO); |
| | | return R.ok(); |
| | | } |
| | | } |