//
//  EcaArea.swift
//  Sailassist
//
//  Created by 三浦薫巳 on 2023/11/26.
//

import Foundation
import CoreLocation

class EcaArea {
    var sessionEcaArea = SessionEcaArea()

    func start() {
        print(debug: "called")
        sessionEcaArea.RequestEcaArea(responseEcaArea)
    }

    private func responseEcaArea(result: Result<Data, APIError>) {
        print(debug: "called")
        switch result {
        case .success(let resultData):
            let serverSession = ServerSession()
            let resjson = serverSession.fromJSON(resultData: resultData, resltType: [ResEcaArea].self)
            if let res = resjson {
                print(debug: res)
            }
        case .failure(let errorCode):
            print(debug: errorCode)
            break
        }
    }
}
