cleanup
This commit is contained in:
parent
5c53466dac
commit
17b2a4368f
@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
open class ActionActionsModel: ActionModelProtocol {
|
||||
public struct ActionActionsModel: ActionModelProtocol {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
@ -46,7 +46,7 @@ open class ActionActionsModel: ActionModelProtocol {
|
||||
// MARK: - Codec
|
||||
//--------------------------------------------------
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
actions = try typeContainer.decodeModels(codingKey: .actions)
|
||||
if let concurrent = try typeContainer.decodeIfPresent(Bool.self, forKey: .concurrent) {
|
||||
|
||||
@ -8,27 +8,27 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
open class ActionOpenPageModel: ActionModelProtocol, ActionOpenPageProtocol, ClientParameterActionProtocol {
|
||||
public struct ActionOpenPageModel: ActionModelProtocol, ActionOpenPageProtocol, ClientParameterActionProtocol {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
open class var identifier: String { "openPage" }
|
||||
open var actionType: String = identifier
|
||||
open var pageType: String
|
||||
open var modules: [String]?
|
||||
open var baseURL: URL?
|
||||
open var appContext: String?
|
||||
open var requestURL: URL?
|
||||
open var extraParameters: JSONValueDictionary?
|
||||
open var analyticsData: JSONValueDictionary?
|
||||
open var presentationStyle: String?
|
||||
open var tabBarIndex: Int?
|
||||
open var background: Bool?
|
||||
open var clientParameters: ClientParameterModel?
|
||||
open var customTimeoutTime: TimeInterval?
|
||||
public static var identifier: String = "openPage"
|
||||
public var actionType: String = identifier
|
||||
public var pageType: String
|
||||
public var modules: [String]?
|
||||
public var baseURL: URL?
|
||||
public var appContext: String?
|
||||
public var requestURL: URL?
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
public var presentationStyle: String?
|
||||
public var tabBarIndex: Int?
|
||||
public var background: Bool?
|
||||
public var clientParameters: ClientParameterModel?
|
||||
public var customTimeoutTime: TimeInterval?
|
||||
|
||||
open var requestParameters: MVMCoreRequestParameters
|
||||
public var requestParameters: MVMCoreRequestParameters
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initialzier
|
||||
@ -95,7 +95,7 @@ open class ActionOpenPageModel: ActionModelProtocol, ActionOpenPageProtocol, Cli
|
||||
requestParameters.actionMap = toJSON()
|
||||
}
|
||||
|
||||
open func encode(to encoder: Encoder) throws {
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(pageType, forKey: .pageType)
|
||||
try container.encodeIfPresent(baseURL, forKey: .baseURL)
|
||||
|
||||
@ -148,7 +148,7 @@ public protocol MVMCoreJSONActionHandlerProtocol: MVMCoreActionHandlerProtocol {
|
||||
/// Legacy handle action with json.
|
||||
@objc(handleActionWithDictionary:additionalData:delegateObject:)
|
||||
open func handleAction(with json: [AnyHashable: Any]?, additionalData: [AnyHashable: Any]?, delegateObject: DelegateObject?) {
|
||||
let task = Task(priority: .userInitiated) {
|
||||
_ = Task(priority: .userInitiated) {
|
||||
try Task.checkCancellation()
|
||||
do {
|
||||
guard let json = json else {
|
||||
@ -172,15 +172,6 @@ public protocol MVMCoreJSONActionHandlerProtocol: MVMCoreActionHandlerProtocol {
|
||||
}
|
||||
}
|
||||
}
|
||||
Task {
|
||||
let result = await task.result
|
||||
do {
|
||||
try result.get()
|
||||
print("ActionHandler: task done")
|
||||
} catch {
|
||||
print("ActionHandler: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Bridges the legacy json using functions and the new model using functions.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user