//
//  SetEcaArea.swift
//  Sailassist
//
//  Created by 三浦薫巳 on 2023/11/28.
//

import Foundation

class SetEcaArea {
    var sessionTaskList = SessionTaskList()

    func start(eca : ReqTaskList) {
        print(debug: "called")
//        sessionTaskList.RequestPostTaskList(eca, completion: responsePostTaskList)
    }

    private func responsePostTaskList(result: Result<Data, APIError>) {
        print(debug: "called")
        switch result {
        case .success(let resultData):
            let serverSession = ServerSession()
            let resjson = serverSession.fromJSON(resultData: resultData, resltType: ReqTaskList.self)
            if let res = resjson {
                //ECA保存
            }
        case .failure(let errorCode):
            print(debug: errorCode)
            break
        }
    }
}
