|  |  | 
 |  |  | import java.util.Date; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * web文件上传示例 | 
 |  |  |  * web文件上传 | 
 |  |  |  */ | 
 |  |  | @Slf4j | 
 |  |  | @RestController | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Value("${dy.webFile.fmUrl}") | 
 |  |  |     private String fmUrl ; | 
 |  |  |     //支持的文件类型 | 
 |  |  |  | 
 |  |  |     //支持的文档文件类型 | 
 |  |  |     @Value("${dy.webFile.supportedFileTypes}") | 
 |  |  |     private String supportedFileTypes ; | 
 |  |  |  | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @PostMapping("/upPhoto") | 
 |  |  |     @SsoPowerAop(power = "-1") //登录与权限同时验证 | 
 |  |  |     //https://blog.zhengru.top/posts/33486.html#%E5%8D%95%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0 | 
 |  |  |     //参考: https://blog.zhengru.top/posts/33486.html#%E5%8D%95%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0 | 
 |  |  |     public BaseResponse<?> upPhoto(MultipartFile file) { | 
 |  |  |         try { | 
 |  |  |             if (file != null) { | 
 
 |  |  | 
 |  |  |     photoZipWidth: 400 #缩略图尺寸 | 
 |  |  |     webFile: | 
 |  |  |         fmUrl: http://127.0.0.1:${pms.other.webPort}/other # fm的web上下文 URL | 
 |  |  |         supportedFileTypes: docx,xlsx,pdf | 
 |  |  |         supportedFileTypes: docx,xlsx,doc,xls,pdf #支持的文档(非媒体文件,如照片、录音、录像)文件类型 | 
 |  |  |         sv1: | 
 |  |  |             id: dyFile1 | 
 |  |  |             absolutePath: E:/java/nginx-1.24.0/html/webfiles/ | 
 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | import com.dy.common.util.NumUtil; | 
 |  |  | import com.dy.pmsGlobal.daoBa.BaUserMapper; | 
 |  |  | import com.dy.pmsGlobal.daoOth.OthFileMapper; | 
 |  |  | import com.dy.pmsGlobal.pojoOth.OthFile; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | @Slf4j |