File tree Expand file tree Collapse file tree 4 files changed +0
-102
lines changed
src/main/java/org/dfbf/soundlink/domain/user Expand file tree Collapse file tree 4 files changed +0
-102
lines changed Original file line number Diff line number Diff line change 88import org .dfbf .soundlink .domain .user .exception .NoUserDataException ;
99import org .dfbf .soundlink .domain .user .repository .UserRepository ;
1010import org .dfbf .soundlink .domain .user .service .UserStatusService ;
11- import org .dfbf .soundlink .domain .user .service .UserStatusSseService ;
1211import org .dfbf .soundlink .global .exception .ErrorCode ;
1312import org .dfbf .soundlink .global .exception .ResponseResult ;
1413import org .springframework .web .bind .annotation .*;
15- import org .springframework .web .servlet .mvc .method .annotation .SseEmitter ;
1614
1715@ RestController
1816@ RequestMapping ("/api/userStatus" )
1917@ RequiredArgsConstructor
2018@ Tag (name = "User Status API" , description = "유저 상태 관련 API" )
2119public class UserStatusController {
2220 private final UserStatusService userStatusService ;
23- private final UserStatusSseService userStatusSseService ;
2421 private final UserRepository userRepository ;
2522
26- @ GetMapping ("/subscribe" )
27- public SseEmitter subscribe (@ RequestParam String loginId ) {
28-
29- User user = userRepository .findByLoginId (loginId )
30- .orElseThrow (NoUserDataException ::new );
31- Long userId = user .getUserId ();
32-
33- return userStatusSseService .subscribe (userId );
34- }
35-
3623 @ GetMapping ("/{loginId}" )
3724 public ResponseResult getUserStatus (@ PathVariable String loginId ) {
3825
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ public class UserService {
5151 private final MailService mailService ;
5252 private final RedisService redisService ;
5353 private final UserStatusService userStatusService ;
54- private final UserStatusSseService userStatusSseService ;
5554
5655 private final JwtProvider jwtProvider ;
5756 private final TokenProperties tokenProperties ;
Original file line number Diff line number Diff line change 1313public class UserStatusService {
1414 private final RedisTemplate <String , String > redisTemplate ;
1515 private final ObjectMapper objectMapper = new ObjectMapper ();
16- private final UserStatusSseService userStatusSseService ;
1716
1817 // Redis Key Prefix
1918 private static final String USER_STATUS_KEY_PREFIX = "user:status:" ;
@@ -25,9 +24,6 @@ public void saveUserStatus(UserStatusDto status) {
2524 String json = objectMapper .writeValueAsString (status );
2625 redisTemplate .opsForValue ().set (key , json );
2726
28- // 이게 SSE로 알림 보냄
29- userStatusSseService .sendUserStatus (status .getUserId (), status );
30-
3127 } catch (JsonProcessingException e ) {
3228 log .error ("유저 상태 저장 중 JsonProcessingException 오류: {}" , e .getMessage ());
3329 }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments