package com.template.api;

import com.template.annotation.PassToken;
import com.template.model.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

@Api(tags = {"UploadController"}, value = "cos文件操作")
@RequestMapping("/api/upload")
public interface UploadControllerAPI {

    @PostMapping("/toCos")
    @ApiOperation(value = "文件上传",httpMethod = "POST")
    @PassToken
    CommonResult toCos(@RequestParam("files") MultipartFile[] files);

    @GetMapping("/deleteFile")
    @ApiOperation(value = "文件上传",httpMethod = "POST")
    @PassToken
    CommonResult deleteFile(@RequestParam String fileName);

    @GetMapping("/ossSign")
    @ApiOperation(value = "获取Oss签名",httpMethod = "GET")
    @PassToken
    CommonResult ossSign(@RequestParam String suffix);
}
