Skip to content

Commit

Permalink
Merge pull request #340 from Team-Smeme/develop
Browse files Browse the repository at this point in the history
deploy: 실서버 배포
  • Loading branch information
thguss authored Oct 12, 2024
2 parents f446b12 + cb40557 commit 7eca1c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public void visit(long memberId) {
String key = "visit:" + today;

if (!cachePort.getBit(key, foundMember.getId())) {
System.out.println("test");
foundMember.visit();
memberPort.update(foundMember);
cachePort.setBit(key, foundMember.getId(), true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.smeem.http.aspect;

import com.smeem.common.exception.ExceptionCode;
import com.smeem.http.controller.dto.ExceptionResponse;
import com.smeem.common.exception.SmeemException;
import lombok.val;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
Expand All @@ -33,7 +32,7 @@ public Object duplicateRequestCheck(ProceedingJoinPoint joinPoint) throws Throwa
val requestId = joinPoint.getSignature().toLongString();
if (requestSet.contains(requestId)) {
// 중복 요청인 경우
return handleDuplicateRequest();
throw new SmeemException(ExceptionCode.TOO_MANY_REQUESTS);
}
requestSet.add(requestId);

Expand All @@ -43,10 +42,4 @@ public Object duplicateRequestCheck(ProceedingJoinPoint joinPoint) throws Throwa
requestSet.remove(requestId);
}
}

private ResponseEntity<ExceptionResponse> handleDuplicateRequest() {
return ResponseEntity
.status(ExceptionCode.TOO_MANY_REQUESTS.getStatusCode())
.body(ExceptionResponse.of(ExceptionCode.TOO_MANY_REQUESTS.getMessage() + ": 중복된 요청"));
}
}

0 comments on commit 7eca1c3

Please sign in to comment.