All files / src/types/service chat.ts

0% Statements 0/100
0% Branches 0/1
0% Functions 0/1
0% Lines 0/100

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101                                                                                                                                                                                                         
export interface ChattingRoom {
  chatRoomId: number;
  chatType: 'DM' | 'GROUP';
  chatRoomName: string;
  groupId: number;
  participantCount: number;
  lastMessage: {
    content: string;
    senderName: string;
    timestamp: string;
  };
  participants: ChatUser[];
  unreadCount: number;
  thumbnail: string;
}

export interface ChatMessage {
  messageId: number;
  senderId: number | null;
  senderName: string | null;
  senderProfileImage: string | null;
  content: string;
  messageType: 'TEXT' | 'SYSTEM' | 'KICK';
  timestamp?: string;
  createdAt?: string;
  targetUserId: number;
}

export interface ChatUser {
  joinedAt: string;
  nickName: string;
  participantId: 77;
  profileImage: string;
  status: 'ACTIVE' | 'INACTIVE'; // 확인 필요💥💥
  userId: number;
  profileMessage: string;
  isOwner: boolean;
}

export interface GetChatRoomsResponse {
  chatRooms: ChattingRoom[];
}

export interface CreateDMPayloads {
  targetUserId: number;
}

export interface GetChatMessagesParams {
  roomId: number;
  cursor?: number;
  size?: number;
}

export interface GetChatMessagesResponse {
  messages: ChatMessage[];
  nextCursor: number | null;
  hasNext: boolean;
}

export interface ReadMessagesParams {
  roomId: number;
}

export interface ReadMessagesResponse {
  chatRoomId: number;
  lastReadMessageId: number;
  unreadCount: number;
}

export interface GetChatRoomParams {
  roomId: number;
}

export interface getChatRoomResponse {
  chatRoomId: number;
  chatRoomName: string;
  chatType: string;
  createdAt: string;
  groupId: number | null;
  participantCount: number;
  participants: ChatUser[];
}

export interface GetParticipantsParams {
  roomId: number;
}

export interface GetParticipantsResponse {
  chatRoomId: number;
  totalCount: number;
  participants: ChatUser[];
}

export interface KickUserParams {
  roomId: number;
}

export interface KickUserPayloads {
  targetUserId: number;
}