feat(live-room): 라이브룸 채팅 삭제 기능 구현

This commit is contained in:
Yu Sung
2026-03-20 10:51:22 +09:00
parent 793b5dd95a
commit 8eca5df62b
9 changed files with 433 additions and 27 deletions

View File

@@ -16,6 +16,7 @@ protocol LiveRoomChat {
}
struct LiveRoomNormalChat: LiveRoomChat {
let chatId: String
let userId: Int
let profileUrl: String
let nickname: String
@@ -37,6 +38,7 @@ struct LiveRoomDonationChat: LiveRoomChat {
}
struct LiveRoomRouletteDonationChat: LiveRoomChat {
let memberId: Int
let profileUrl: String
let nickname: String
let rouletteResult: String

View File

@@ -12,6 +12,7 @@ struct LiveRoomChatItemView: View {
let chatMessage: LiveRoomNormalChat
let onClickProfile: () -> Void
let onLongPressChat: (() -> Void)?
private var rankValue: Int {
chatMessage.rank + 1
@@ -132,6 +133,9 @@ struct LiveRoomChatItemView: View {
Color.black.opacity(0.6)
)
.cornerRadius(3.3)
.onLongPressGesture {
onLongPressChat?()
}
}
.frame(width: screenSize().width - 86, alignment: .leading)
.padding(.leading, 20)

View File

@@ -10,7 +10,7 @@ import Foundation
struct LiveRoomChatRawMessage: Codable {
enum LiveRoomChatRawMessageType: String, Codable {
case DONATION, SECRET_DONATION, EDIT_ROOM_INFO, SET_MANAGER, TOGGLE_ROULETTE, TOGGLE_CHAT_FREEZE, ROULETTE_DONATION
case HEART_DONATION, BIG_HEART_DONATION
case HEART_DONATION, BIG_HEART_DONATION, NORMAL_CHAT, DELETE_CHAT, DELETE_CHAT_BY_USER
}
let type: LiveRoomChatRawMessageType
@@ -21,4 +21,6 @@ struct LiveRoomChatRawMessage: Codable {
let donationMessage: String?
var isActiveRoulette: Bool? = nil
var isChatFrozen: Bool? = nil
var chatId: String? = nil
var targetUserId: Int? = nil
}

View File

@@ -66,6 +66,6 @@ struct LiveRoomRouletteDonationChatItemView: View {
struct LiveRoomRouletteDonationChatItemView_Previews: PreviewProvider {
static var previews: some View {
LiveRoomRouletteDonationChatItemView(chatMessage: LiveRoomRouletteDonationChat(profileUrl: "", nickname: "유저일", rouletteResult: "옵션1"))
LiveRoomRouletteDonationChatItemView(chatMessage: LiveRoomRouletteDonationChat(memberId: 0, profileUrl: "", nickname: "유저일", rouletteResult: "옵션1"))
}
}