From ab06dfb98b00254a4505445ee860ba93ae786325 Mon Sep 17 00:00:00 2001 From: Gary Date: Thu, 7 Mar 2024 11:10:29 +0800 Subject: [PATCH] 1.update cache config --- luoo_comment/src/main/resources/bootstrap.yml | 12 ++++++++++-- luoo_music/src/main/resources/bootstrap.yml | 14 ++++++++++++-- .../com/luoo/user/controller/MyController.java | 4 ++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/luoo_comment/src/main/resources/bootstrap.yml b/luoo_comment/src/main/resources/bootstrap.yml index 520850e..f951c0e 100644 --- a/luoo_comment/src/main/resources/bootstrap.yml +++ b/luoo_comment/src/main/resources/bootstrap.yml @@ -16,7 +16,7 @@ j2cache: # 缓存中不存在时,运行缓存空对象 allowNullValues: true redisClient: lettuce - l2CacheOpen: false + l2CacheOpen: true serialization: json sync_ttl_to_redis: true # 一级缓存使用caffeine @@ -31,7 +31,15 @@ j2cache: # 上面配置的一级缓存为caffeine, 那么这里对一级缓存的配置就必须以这个caffeine开头 caffeine: - properties: caffeine.properties + region: + default: 100000, 365d + journal_query_page: 10000, 365d + journal_id: 2000, 365d + journal_no: 2000, 365d + journal_song_key: 10000, 365d + journal_song_list: 2000, 365d + search_auto_complete: 200000, 365d + user_info: 20000, 365d --- spring: cache: diff --git a/luoo_music/src/main/resources/bootstrap.yml b/luoo_music/src/main/resources/bootstrap.yml index 2b67e71..28a6709 100644 --- a/luoo_music/src/main/resources/bootstrap.yml +++ b/luoo_music/src/main/resources/bootstrap.yml @@ -19,7 +19,7 @@ j2cache: # 缓存中不存在时,运行缓存空对象 allowNullValues: true redisClient: lettuce - l2CacheOpen: false + l2CacheOpen: true serialization: json sync_ttl_to_redis: true # 一级缓存使用caffeine @@ -34,7 +34,17 @@ j2cache: # 上面配置的一级缓存为caffeine, 那么这里对一级缓存的配置就必须以这个caffeine开头 caffeine: - properties: caffeine.properties + region: + default: 100000, 365d + journal_query_page: 10000, 365d + journal_id: 2000, 365d + journal_no: 2000, 365d + journal_song_key: 10000, 365d + journal_song_list: 2000, 365d + search_auto_complete: 200000, 365d + user_info: 20000, 365d +#caffeine: +# properties: caffeine.properties --- spring: cache: diff --git a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java index 950a921..2c5b9e2 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java @@ -138,14 +138,14 @@ public class MyController extends BaseController { return Result.success(); } - @ApiOperation(value = "3.上传个人头像", notes = "图片压缩为70X70 JPEG,存入S3,桶为indie,目录为 user/avatar/") + @ApiOperation(value = "3.上传个人头像", notes = "图片存入S3,桶为indie,目录为 user/avatar/") @PostMapping("/avatar") @GlobalInterceptor(checkAppUserLogin = true) public Result uploadAvatar(@RequestHeader(value = "Authorization", required = true) String authorization, @VerifyParam(required = true) MultipartFile file) throws IOException { UserLoginDto userLoginDto = getUserLoginDto(authorization); - byte[] thumbnail = ScaleFilter.createThumbnail(file.getInputStream(), Constants.LENGTH_512, Constants.LENGTH_512); + byte[] thumbnail = file.getBytes();//.createThumbnail(file.getInputStream(), Constants.LENGTH_512, Constants.LENGTH_512); String avatarName = userLoginDto.getUserId() + "_" + idWorker.nextId() + StringTools.getFileSuffix(file.getOriginalFilename()); String filePath = USER_AVATAR_DIRECTORY + avatarName;