| | |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TPubWithdrawal; |
| | | import com.stylefeng.guns.modular.system.util.GoogleCloudStorageUtil; |
| | | import com.stylefeng.guns.modular.system.util.OBSUploadUtil; |
| | | import com.stylefeng.guns.modular.system.util.OssUploadUtil; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @RequestMapping("/saveApk") |
| | | public Map<String, Object> saveApk(@RequestPart("myfile") MultipartFile myfile, HttpServletRequest request){ |
| | | Map<String, Object> m = new HashMap<>(); |
| | | /*try { |
| | | String pictureName = UUID.randomUUID().toString() + "." + ToolUtil.getFileSuffix(file.getOriginalFilename()); |
| | | try { |
| | | String fileSavePath = gunsProperties.getFileUploadPath()+"apk\\"; |
| | | file.transferTo(new File(fileSavePath + pictureName)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | m.put("imgUrl", gunsProperties.getPictureServerAddress()+"apk/"+pictureName); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | }*/ |
| | | try { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) myfile; |
| | | |
| | | String pictureName = OBSUploadUtil.inputStreamUpload(file); |
| | | String pictureName = GoogleCloudStorageUtil.upload(myfile); |
| | | m.put("imgUrl", pictureName); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |