Skip to content

Commit

Permalink
Merge pull request #284 from team-haribo/283-feat/user-profile-cache-…
Browse files Browse the repository at this point in the history
…delete

#283 feat/user profile cache delete
  • Loading branch information
KimGyeongsuuu authored Jul 10, 2024
2 parents 1a8f0ad + 8b3ce5d commit 2d7f08e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ import com.goms.v2.domain.account.updateAuthority
import com.goms.v2.domain.auth.exception.AccountNotFoundException
import com.goms.v2.domain.studentCouncil.data.dto.GrantAuthorityDto
import com.goms.v2.repository.account.AccountRepository
import org.springframework.cache.annotation.CacheEvict

@UseCaseWithTransaction
class GrantAuthorityUseCase(
private val accountRepository: AccountRepository
) {

@CacheEvict(
value = ["userProfiles"],
key = "#dto.accountIdx",
cacheManager = "contentCacheManager"
)
fun execute(dto: GrantAuthorityDto) {
val account = accountRepository.findByIdOrNull(dto.accountIdx)
?: throw AccountNotFoundException()
Expand Down

0 comments on commit 2d7f08e

Please sign in to comment.