移动端上传接口
parent
3b83a3f948
commit
09a74c8f3b
|
|
@ -0,0 +1,39 @@
|
|||
package org.qinan.safetyeval.adapter.web.institution.app;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.qinan.safetyeval.client.api.FileUploadApi;
|
||||
import org.qinan.safetyeval.client.co.FileInfoCO;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
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.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 文件上传适配层(Controller)
|
||||
* <p>
|
||||
* 区分公开上传(创建人默认 system)与内部上传(创建人为当前登录用户)。
|
||||
* 上传完成后自动同步元信息到 filestorage 表。
|
||||
* </p>
|
||||
*
|
||||
* @author safety-eval
|
||||
*/
|
||||
@Api(tags = "移动端文件上传")
|
||||
@RestController
|
||||
@RequestMapping("/safetyEval/app/file")
|
||||
public class AppFileUploadController {
|
||||
|
||||
@Resource
|
||||
private FileUploadApi fileUploadApi;
|
||||
@ApiOperation("内部上传单个文件(创建人为当前用户)")
|
||||
@PostMapping("/upload")
|
||||
public SingleResponse<FileInfoCO> uploadInternal(
|
||||
@ApiParam("上传文件") @RequestParam("file") MultipartFile file) {
|
||||
return fileUploadApi.uploadInternal(file);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue