| | |
| | | import com.ard.sample.media.model.FileUploadDTO; |
| | | import com.ard.sample.media.service.IMediaService; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | /** |
| | | * @author sean |
| | | * @author sean/workspaces |
| | | * @version 0.2 |
| | | * @date 2021/12/7 |
| | | */ |
| | | @Api(tags = "媒体库管理") |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/dock/media/workspaces") |
| | | @RequestMapping("/dock/media") |
| | | public class MediaController { |
| | | |
| | | @Autowired |
| | |
| | | * @param file |
| | | * @return |
| | | */ |
| | | @ApiOperation("检查文件是否已上传") |
| | | @PostMapping("/fast-upload") |
| | | public ResponseResult fastUpload( @RequestBody FileUploadDTO file) { |
| | | |
| | |
| | | * @param file |
| | | * @return |
| | | */ |
| | | @ApiOperation("上报文件基本信息") |
| | | @PostMapping("/upload-callback") |
| | | public ResponseResult<String> uploadCallback(@RequestBody FileUploadDTO file) { |
| | | mediaService.saveMediaFile(file); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Query the files that already exist in this workspace based on the workspace id and the collection of tiny fingerprints. |
| | | * 根据工作区 ID 和微小指纹的集合查询此工作区中已存在的文件。 |
| | | * @param tinyFingerprints There is only one tiny_fingerprint parameter in the body. |
| | | * But it is not recommended to use Map to receive the parameter. |
| | | * @return |
| | | */ |
| | | @ApiOperation("查询已存在的文件") |
| | | @PostMapping("/files/tiny-fingerprints") |
| | | public ResponseResult<Map<String, List<String>>> uploadCallback( |
| | | @RequestBody Map<String, List<String>> tinyFingerprints){ |