52 lines
		
	
	
		
			1000 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1000 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
//
 | 
						|
//  LiveRoomChat.swift
 | 
						|
//  SodaLive
 | 
						|
//
 | 
						|
//  Created by klaus on 2023/08/14.
 | 
						|
//
 | 
						|
 | 
						|
import Foundation
 | 
						|
 | 
						|
enum LiveRoomChatType: String {
 | 
						|
    case CHAT, DONATION, JOIN, ROULETTE_DONATION
 | 
						|
}
 | 
						|
 | 
						|
protocol LiveRoomChat {
 | 
						|
    var type: LiveRoomChatType { get set }
 | 
						|
}
 | 
						|
 | 
						|
struct LiveRoomNormalChat: LiveRoomChat {
 | 
						|
    let userId: Int
 | 
						|
    let profileUrl: String
 | 
						|
    let nickname: String
 | 
						|
    let rank: Int
 | 
						|
    let chat: String
 | 
						|
    
 | 
						|
    var type: LiveRoomChatType = .CHAT
 | 
						|
}
 | 
						|
 | 
						|
struct LiveRoomDonationChat: LiveRoomChat {
 | 
						|
    let memberId: Int
 | 
						|
    let profileUrl: String
 | 
						|
    let nickname: String
 | 
						|
    let chat: String
 | 
						|
    let can: Int
 | 
						|
    let donationMessage: String
 | 
						|
    
 | 
						|
    var type: LiveRoomChatType = .DONATION
 | 
						|
}
 | 
						|
 | 
						|
struct LiveRoomRouletteDonationChat: LiveRoomChat {
 | 
						|
    let profileUrl: String
 | 
						|
    let nickname: String
 | 
						|
    let rouletteResult: String
 | 
						|
    
 | 
						|
    var type: LiveRoomChatType = .ROULETTE_DONATION
 | 
						|
}
 | 
						|
 | 
						|
struct LiveRoomJoinChat: LiveRoomChat {
 | 
						|
    let nickname: String
 | 
						|
    
 | 
						|
    var type: LiveRoomChatType = .JOIN
 | 
						|
}
 |