package cn.iocoder.yudao.module.mes.controller.admin.safety; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.mes.service.safety.SafetyFileService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.springframework.http.MediaType; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** * 安全生产 - 移动端现场拍照上传 * *
巡检、隐患上报、作业票、演练等环节的照片统一走此接口, * 返回可访问 URL,前端拼成逗号串写入业务表。
* * @author 超级管理员 */ @Tag(name = "管理后台 - 安全生产-附件上传") @RestController @RequestMapping("/safety/file") @Validated public class SafetyFileController { @Resource private SafetyFileService fileService; @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @Operation(summary = "上传单个附件(移动端拍照)") @Parameter(name = "file", description = "文件", required = true) @PreAuthorize("@ss.hasPermission('safety:file:upload')") public CommonResult