IAppHubClient.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Application.Abstractions.Chat;
  2. namespace Application.Abstractions.Hub;
  3. /// <summary>
  4. /// AppHub 클라이언트 인터페이스 — 모든 페이지에서 사용하는 공통 Hub
  5. /// 접속자 추적 + 채팅 + 알림 + 쪽지 + 크루 초대/동의/toast
  6. /// </summary>
  7. public interface IAppHubClient
  8. {
  9. // ── 채팅 (기존 ChatHub 통합) ──────────────────────────────────
  10. Task ReceiveMessage(ChatMessage message);
  11. Task ReceiveHistory(IReadOnlyList<ChatMessage> messages);
  12. Task ReceiveSystemMessage(string message);
  13. Task ReceiveParticipantCount(int count);
  14. Task ReceiveParticipants(IReadOnlyList<ChatParticipant> participants);
  15. Task Connected(string message);
  16. Task Logout(string message);
  17. Task Kick();
  18. // ── 알림 + 쪽지 ──────────────────────────────────────────────
  19. Task ReceiveNotification(object notification);
  20. Task ReceiveNote(object notePreview);
  21. Task ReceiveUnreadCounts(int notificationCount, int noteCount);
  22. // ── 채널 상태 (PubSub 기반 실시간) ─────────────────────────
  23. Task ReceiveChannelStatus(object channelStatus);
  24. // ── 크루 ─────────────────────────────────────────────────────
  25. Task ReceiveCrewInvitation(object invitation);
  26. Task ReceiveCrewConsentUpdate(object consentStatus);
  27. Task ReceiveCrewStarted(object sessionInfo);
  28. Task ReceiveCrewEnded(object sessionResult);
  29. Task ReceiveCrewToast(object toastData);
  30. /// <summary>
  31. /// 크루원 리스트 변경 (추가/수정/삭제/초대응답).
  32. /// payload: { kind: "added" | "updated" | "removed" | "invitationStatusChanged", data: object }
  33. /// 운영자(JoinCrew 그룹 구독자)에게만 broadcast.
  34. /// </summary>
  35. Task ReceiveCrewMemberChange(object payload);
  36. // ── 피드 ─────────────────────────────────────────────────────
  37. Task ReceiveFeedPost(object toast);
  38. // ── Presence (구독 기반 온라인 상태 broadcast) ──────────────
  39. Task ReceivePresenceChange(int memberID, bool isOnline);
  40. }