| | |
| | | String type = FileUtil.getFileType(suffix); |
| | | String reaName = System.currentTimeMillis() + "." + suffix; |
| | | String objectKey = type + "/" + reaName; |
| | | if (properties.getEnabled()) { |
| | | objectKey = "test/" +objectKey; |
| | | } |
| | | PutObjectResult result = ObsUtils.putObject(properties, file, objectKey, AccessControlList.REST_CANNED_PUBLIC_READ); |
| | | if (ObjectUtil.isNull(result)) { |
| | | throw new BadRequestException("上传失败"); |
| | |
| | | String type = FileUtil.getFileType(suffix); |
| | | String reaName = IdUtil.getSnowflake(1, 1).nextId() + "." + suffix; |
| | | String objectKey = type + "/" + reaName; |
| | | if (properties.getEnabled()) { |
| | | objectKey = "test/" +objectKey; |
| | | } |
| | | PutObjectResult result = ObsUtils.putObject(properties, FileUtil.toFile(file), objectKey, AccessControlList.REST_CANNED_PUBLIC_READ); |
| | | if (ObjectUtil.isNull(result)) { |
| | | throw new BadRequestException("上传失败"); |