|
|
|
@ -130,6 +130,10 @@ public class TbUploadFileNewController {
|
|
|
|
|
ServletRequest servletRequest) {
|
|
|
|
|
// 记录日志
|
|
|
|
|
log.info("TbUploadFileNewController:fileUpload | taskName="+taskName+"===== isEcryptionNew="+isEcryptionNew);
|
|
|
|
|
// 校验上传是否有文件
|
|
|
|
|
if (file== null ){
|
|
|
|
|
return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.NO_FILE_INPUT), HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
// FIXME: 2021/4/23 0023
|
|
|
|
|
Integer isEcryption = Integer.parseInt(isEcryptionNew);
|
|
|
|
|
// FIXME: 2021/4/23 0023
|
|
|
|
@ -139,14 +143,14 @@ public class TbUploadFileNewController {
|
|
|
|
|
String token = "";
|
|
|
|
|
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
|
|
|
|
|
Cookie[] cookies = httpServletRequest.getCookies();
|
|
|
|
|
for(Cookie cookie : cookies) {
|
|
|
|
|
//获取cookie的名字
|
|
|
|
|
String cookieName = cookie.getName();
|
|
|
|
|
token=cookie.getValue();
|
|
|
|
|
// FIXME: 2021/4/23 0023
|
|
|
|
|
// System.out.println(cookieName);
|
|
|
|
|
// System.out.println(cookieName+" : "+ cookie.getValue() );
|
|
|
|
|
if (cookies != null){
|
|
|
|
|
for(Cookie cookie : cookies) {
|
|
|
|
|
//获取cookie的名字
|
|
|
|
|
String cookieName = cookie.getName();
|
|
|
|
|
token=cookie.getValue();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FIXME: 2021/4/23 0023 ===
|
|
|
|
|
keyName = token+"==="+name;
|
|
|
|
|
Object keyValue = redisTemplate.opsForValue().get(keyName);
|
|
|
|
@ -181,10 +185,7 @@ public class TbUploadFileNewController {
|
|
|
|
|
return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.EMPTY_ARGUMENT), HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验上传是否有文件
|
|
|
|
|
if (file== null ){
|
|
|
|
|
return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.NO_FILE_INPUT), HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 生成本地文件
|
|
|
|
|
TbUploadFileNewDto tbUploadFileNewDto = tbUploadFileNewService.encryptDataAndSaveToFileNew(file, taskName, isEcryption);
|
|
|
|
@ -201,22 +202,5 @@ public class TbUploadFileNewController {
|
|
|
|
|
return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.SUCCESS), HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/aa")
|
|
|
|
|
@Log("查询文件上传接口")
|
|
|
|
|
@ApiOperation("查询文件上传接口")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public ResponseEntity<Object> aa(){
|
|
|
|
|
redisTemplate.opsForValue().set("key111", "value11");
|
|
|
|
|
Object key111 = redisTemplate.opsForValue().get("key111");
|
|
|
|
|
System.out.println("key111 = " + key111.toString());
|
|
|
|
|
|
|
|
|
|
redisTemplate.delete("key111");
|
|
|
|
|
|
|
|
|
|
Object aaaa = redisTemplate.opsForValue().get("key111");
|
|
|
|
|
System.out.println("aaaa = " + aaaa);
|
|
|
|
|
|
|
|
|
|
return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.SUCCESS), HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|