Skip to content

Commit

Permalink
[fix] 차단 풀기 usecase identifier 재정의 #157
Browse files Browse the repository at this point in the history
  • Loading branch information
정상훈 authored and 정상훈 committed Sep 1, 2023
1 parent 0093c88 commit 1f0b0c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class DeleteBlockUseCase {
@Transactional
@DistributedLock(
lockType = DistributedLockType.BLOCK,
identifier = {"fromUserId, toUserId"})
identifier = {"fromUserId", "toUserId"})
public BlockResponse execute(BlockRequest request, Long fromUserId, Long toUserId) {
Long userId = SecurityUtil.getCurrentUserId();
validateExecution(userId, request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ private String getKey(ProceedingJoinPoint joinPoint, DistributedLock distributed
private String createDynamicKey(
String[] methodParameterNames, Object[] methodArgs, String[] identifiers) {
List<String> resultList = new ArrayList<>();
Arrays.stream(methodParameterNames).forEach(a -> log.info(a));
for (String identifier : identifiers) {
log.info(identifier);
int indexOfKey = Arrays.asList(methodParameterNames).indexOf(identifier);
Object arg = methodArgs[indexOfKey];
if (arg == null) {
Expand Down

0 comments on commit 1f0b0c0

Please sign in to comment.