Skip to content

Commit

Permalink
[#222] 로그인 및 저장시 캐시 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
JoosungKwon committed Aug 8, 2023
1 parent f71da67 commit 3b3080a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.prgrms.mukvengers.domain.user.service;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -57,7 +58,7 @@ public UserProfileResponse getUserProfile(Long userId) {
/* [회원 프로필 수정] UpdateUserRequest DTO를 사용해서 사용자의 프로필(닉네임, 프로필 이미지, 자기소개)를 한번에 수정합니다. */
@Override
@Transactional
@CacheEvict(value = "User", key = "#userId")
@CachePut(value = "User", key = "#userId")
public UserProfileResponse updateUserProfile(UpdateUserRequest updateUserRequest, Long userId) {
return userRepository.findById(userId)
.map(user -> user.changeProfile(updateUserRequest))
Expand Down

0 comments on commit 3b3080a

Please sign in to comment.