45 lines
1.0 KiB
Swift
45 lines
1.0 KiB
Swift
//
|
|
// AudioRecordDto.swift
|
|
// AutoCatCore
|
|
//
|
|
// Created by Selim Mustafaev on 12.06.2024.
|
|
// Copyright © 2024 Selim Mustafaev. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct AudioRecordDto: Decodable, Sendable {
|
|
|
|
public var path: String = ""
|
|
public var number: String?
|
|
public var rawText: String = ""
|
|
public var addedDate: TimeInterval = 0
|
|
public var duration: TimeInterval = 0
|
|
public var event: VehicleEventDto?
|
|
|
|
public init(
|
|
path: String,
|
|
number: String?,
|
|
raw: String,
|
|
addedDate: TimeInterval = Date().timeIntervalSince1970,
|
|
duration: TimeInterval,
|
|
event: VehicleEventDto?
|
|
) {
|
|
self.path = path
|
|
self.number = number
|
|
self.duration = duration
|
|
self.rawText = raw
|
|
self.event = event
|
|
self.addedDate = addedDate
|
|
}
|
|
|
|
public func getAddedDate() -> TimeInterval {
|
|
addedDate
|
|
}
|
|
}
|
|
|
|
extension AudioRecordDto: Identifiable {
|
|
|
|
public var id: TimeInterval { addedDate }
|
|
}
|