高质量运营:oss上传、点赞、评论
This commit is contained in:
@ -3,6 +3,9 @@ package com.chinaunicom.mall.ebtp.extend.highquality.controller;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BasePageResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.common.log.OperationLogDetail;
|
||||
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
|
||||
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
|
||||
import com.chinaunicom.mall.ebtp.common.poiExport.constant.ExportConstant;
|
||||
import com.chinaunicom.mall.ebtp.common.poiExport.entity.ExcelTable;
|
||||
import com.chinaunicom.mall.ebtp.extend.highquality.entity.*;
|
||||
@ -79,7 +82,6 @@ public class HighQualityMaintainController {
|
||||
return BasePageResponse.success(highQualityStyleService.queryStyleAndProject(inVO));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("保存风采或项目")
|
||||
@PostMapping("/styleProject/save")
|
||||
public BaseResponse<Boolean> saveStyleOrProject(@RequestBody HighQualityMaintainOutVO inVO) {
|
||||
@ -100,6 +102,7 @@ public class HighQualityMaintainController {
|
||||
|
||||
@ApiOperation("oss文件上传")
|
||||
@PostMapping("/upload")
|
||||
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER, operationType = EbtpLogType.SELECT, detail = "高质量-视频上传")
|
||||
public BaseResponse upload(@RequestParam("file") MultipartFile file) throws IOException {
|
||||
return BaseResponse.success(iUploadOssService.uploadFile(file,"oss/highquality"));
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ public class UploadOssServiceImpl implements IUploadOssService {
|
||||
DateFormat yearMonthPath = new SimpleDateFormat("yyyy/MM/dd");
|
||||
String filePathPrefix = prefix + File.separator + yearMonthPath.format(new Date((System.currentTimeMillis())));
|
||||
String objectName = filePathPrefix + File.separator + RandomUtil.randomString(32).toUpperCase(Locale.ROOT) + "." + fileType;
|
||||
log.info("uploadFile--------bucketName:"+bucketName+",objectName:"+objectName+",file:"+file.getSize());
|
||||
client.putObject(new PutObjectRequest(bucketName, objectName, file.getInputStream(), new ObjectMetadata()));
|
||||
return bucketName+":"+objectName;
|
||||
}
|
||||
|
Reference in New Issue
Block a user