//
//  ViewController.swift
//  VattiCSS
//
//  Created by fishxiaou on 2023/8/15.
//

import UIKit
import WebKit

class ViewController: UIViewController {

    var network = TWOCNetwork()
    override func viewDidLoad() {
        super.viewDidLoad()

    }

    func requestData() {
        var param = [String:Any]()
        param["userid"] = "xx"
        param["countrycode"] = "xx"
        param["usertype"] = "xx"
        param["languege"] = "xx"
        
        SVProgressHUD.show()
        
        network = TWOCNetwork.init(url: "/mobile/mobile/head/index", andParam: param)
        network.successCall = { (result) in
            SVProgressHUD.dismiss()
            debugPrint(result)
        }
        network.failCall = {(code,errorStr) in
            SVProgressHUD.dismiss()
            DispatchQueue.main.async(execute: {
                SVProgressHUD.showError(withStatus: errorStr)
            })
        }
        network.postRequest()
    }

}

