18 lines
403 B
Swift
18 lines
403 B
Swift
|
import Foundation
|
||
|
|
||
|
struct RequestData {
|
||
|
var action: Action = .send
|
||
|
|
||
|
var content: String?
|
||
|
var from: String?
|
||
|
var to: String?
|
||
|
|
||
|
init(serializedData: Data) throws {
|
||
|
let d = try ReqData(serializedData: serializedData)
|
||
|
action = d.action
|
||
|
if d.content != "" { content = d.content }
|
||
|
if d.from != "" { from = d.from }
|
||
|
if d.to != "" { to = d.to }
|
||
|
}
|
||
|
}
|