临时授权-监控日志与性能添加
This commit is contained in:
parent
0de24c6b00
commit
4a20517829
@ -734,6 +734,7 @@ public class FileServiceImpl implements FileService {
|
|||||||
@Override
|
@Override
|
||||||
public List<SignUrlDownloadResponse> signUrlDownload(SignUrlDownloadDto dto) {
|
public List<SignUrlDownloadResponse> signUrlDownload(SignUrlDownloadDto dto) {
|
||||||
log.info("signUrl download dto = {}", JsonUtil.obj2Str(dto));
|
log.info("signUrl download dto = {}", JsonUtil.obj2Str(dto));
|
||||||
|
Long start = System.currentTimeMillis();
|
||||||
|
|
||||||
List<File> fileList = fileDao.getByFileUuids(dto.getFileKeys());
|
List<File> fileList = fileDao.getByFileUuids(dto.getFileKeys());
|
||||||
if (CollectionUtils.isEmpty(fileList)) {
|
if (CollectionUtils.isEmpty(fileList)) {
|
||||||
@ -742,7 +743,7 @@ public class FileServiceImpl implements FileService {
|
|||||||
List<FileBusinessScene> fileBusinessSceneList = fileBusinessSceneManager.queryByBucketNoAndScene(fileList.stream().map(File::getAppChannelBucketNo).collect(Collectors.toList()), dto.getBizScene());
|
List<FileBusinessScene> fileBusinessSceneList = fileBusinessSceneManager.queryByBucketNoAndScene(fileList.stream().map(File::getAppChannelBucketNo).collect(Collectors.toList()), dto.getBizScene());
|
||||||
Map<String, Long> bizSceneExpireMap = fileBusinessSceneList.stream().collect(Collectors.toMap(FileBusinessScene::getAppChannelBucketNo, FileBusinessScene::getDownloadExpiration, (x, y) -> y));
|
Map<String, Long> bizSceneExpireMap = fileBusinessSceneList.stream().collect(Collectors.toMap(FileBusinessScene::getAppChannelBucketNo, FileBusinessScene::getDownloadExpiration, (x, y) -> y));
|
||||||
|
|
||||||
return fileList.stream().map(item -> {
|
List<SignUrlDownloadResponse> responseList = fileList.stream().map(item -> {
|
||||||
Long expire = bizSceneExpireMap.get(item.getAppChannelBucketNo());
|
Long expire = bizSceneExpireMap.get(item.getAppChannelBucketNo());
|
||||||
// bucket下的key
|
// bucket下的key
|
||||||
String tgtFileKey = Utility.generateFileKey(item.getDirectory(), item.getFileUuid(), item.getFileFormat());
|
String tgtFileKey = Utility.generateFileKey(item.getDirectory(), item.getFileUuid(), item.getFileFormat());
|
||||||
@ -752,6 +753,8 @@ public class FileServiceImpl implements FileService {
|
|||||||
.fileKey(item.getFileUuid())
|
.fileKey(item.getFileUuid())
|
||||||
.build();
|
.build();
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
log.info("signUrl download end dto = {}, times:{}", JsonUtil.obj2Str(dto), System.currentTimeMillis() - start);
|
||||||
|
return responseList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -760,6 +763,7 @@ public class FileServiceImpl implements FileService {
|
|||||||
@Override
|
@Override
|
||||||
public SignUrlUploadResponse signUrlUpload(SignUrlUploadDto dto, ContextInfo.LiteSaasContext liteSaasContext) {
|
public SignUrlUploadResponse signUrlUpload(SignUrlUploadDto dto, ContextInfo.LiteSaasContext liteSaasContext) {
|
||||||
log.info("signUrl upload dto = {}", JsonUtil.obj2Str(dto));
|
log.info("signUrl upload dto = {}", JsonUtil.obj2Str(dto));
|
||||||
|
Long start = System.currentTimeMillis();
|
||||||
//1 校验
|
//1 校验
|
||||||
checkAppCode(dto.getAppCode());
|
checkAppCode(dto.getAppCode());
|
||||||
|
|
||||||
@ -791,7 +795,9 @@ public class FileServiceImpl implements FileService {
|
|||||||
//操作日志记录
|
//操作日志记录
|
||||||
operateLog(dto.toString(), dto.getServiceName(), FILE_UPLOAD_CODE, FILE_UPLOAD_NAME, liteSaasContext);
|
operateLog(dto.toString(), dto.getServiceName(), FILE_UPLOAD_CODE, FILE_UPLOAD_NAME, liteSaasContext);
|
||||||
//3 保存File对象
|
//3 保存File对象
|
||||||
return this.signUrlSaveFile(dto, fileUploadConfig, scene);
|
SignUrlUploadResponse response = this.signUrlSaveFile(dto, fileUploadConfig, scene);
|
||||||
|
log.info("signUrl upload dto = {}, times:{}", JsonUtil.obj2Str(dto), System.currentTimeMillis() - start);
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user