 //  API.swift
 //  Created by ctslin on 4/20/16.
 
-
 import Foundation
 import Alamofire
-//import AlamofireObjectMapper
 
 extension String {
   public func hostUrl() -> String {

    }
    _logForUIMode(K.Api.userToken, title: "K.Api.userToken")
    _logForUIMode(K.Api.userToken)

    //    Alamofire.upload(method, url.hostUrl(), headers: headers(), multipartFormData: { (multipartFormData) in
    //      multipartFormData.appendBodyPart(data: data, name: name, fileName: filename, mimeType: mimeType)
    //      }, encodingCompletion: { (result) in
    //        switch result {
    //        case .success(let upload, _, _):
    //          upload.responseJSON(completionHandler: onComplete)
    //        case .failure(let error):
    //          //          prompt(result)
    //          break
    //        }
    //    })
  }
  
  class public func get(_ url: String, parameters: [String: AnyObject] = [:], fileName: String? = #file, funcName: String? = #function, run: @escaping (_ response: DataResponse<Any>) -> ()) {

      processJSONResponse(response, run: run)
      indicatorEnd(indicator: indicator)
    }
    delayedJob(Development.delayed) {
      _logForAnyMode(requestTime, title: "本次請求秒數: \(method),  \(url)")
    }
  }

  class func processJSONResponse(_ response: DataResponse<Any>, run: (_ response: DataResponse<Any>) -> ()) {
    if Development.Log.API.request { _logForAnyMode(response.request!, title: "response.request") }
    switch response.result {
    case .success(let value):
      if value is NSArray {
        run(response)
      } else if let item = value as? NSDictionary {
        let message = item.value(forKey: K.Api.Response.message) as? String
        switch (response.response?.statusCode)! {
        case 400, 404, 405, 422:
