2
2
3
3
import com .softeer .podoarrival .event .exception .ExistingUserException ;
4
4
import com .softeer .podoarrival .event .model .dto .ArrivalApplicationResponseDto ;
5
- import com .softeer .podoarrival .security .AuthInfo ;
6
5
import com .softeer .podoarrival .event .model .entity .ArrivalUser ;
7
6
import com .softeer .podoarrival .event .model .entity .Role ;
8
7
import com .softeer .podoarrival .event .repository .ArrivalUserRepository ;
8
+ import com .softeer .podoarrival .security .AuthInfo ;
9
9
import lombok .RequiredArgsConstructor ;
10
10
import lombok .extern .slf4j .Slf4j ;
11
11
import org .redisson .api .BatchResult ;
12
12
import org .redisson .api .RBatch ;
13
13
import org .redisson .api .RedissonClient ;
14
14
import org .springframework .scheduling .annotation .Async ;
15
+ import org .springframework .scheduling .annotation .Scheduled ;
15
16
import org .springframework .stereotype .Service ;
16
17
17
18
import java .time .LocalDate ;
@@ -28,14 +29,14 @@ public class ArrivalEventReleaseService {
28
29
private final String ARRIVAL_SET = "arrivalset" ;
29
30
private boolean CHECK = false ;
30
31
31
- private final int MAX_ARRIVAL = 100 ;
32
+ private static int MAX_ARRIVAL = 0 ;
32
33
33
34
/**
34
35
* 비동기로 Redis 호출하는 메서드
35
36
* 반환값은 ArrivalEventService에서 받아서 선착순 처리
36
37
*/
37
38
@ Async ("arrivalExecutor" )
38
- public CompletableFuture <ArrivalApplicationResponseDto > applyEvent (AuthInfo authInfo ){
39
+ public CompletableFuture <ArrivalApplicationResponseDto > applyEvent (AuthInfo authInfo ) {
39
40
return CompletableFuture .supplyAsync (() -> {
40
41
LocalDate now = LocalDate .now ();
41
42
@@ -51,7 +52,6 @@ public CompletableFuture<ArrivalApplicationResponseDto> applyEvent(AuthInfo auth
51
52
52
53
//첫번째 응답
53
54
if (!(boolean ) res .getResponses ().get (0 )){
54
- log .info ("전화번호-중복 = {}" , authInfo .getPhoneNum ());
55
55
throw new ExistingUserException ("이미 응모한 전화번호입니다." );
56
56
}
57
57
@@ -73,4 +73,8 @@ public CompletableFuture<ArrivalApplicationResponseDto> applyEvent(AuthInfo auth
73
73
}
74
74
});
75
75
}
76
+
77
+ public static void setMaxArrival (int val ) {
78
+ MAX_ARRIVAL = val ;
79
+ }
76
80
}
0 commit comments