//
//  MineInfoViewController+http.swift
//  SYMobilePortal
//
//  Created by xiejiangbo on 2018/5/14.
//  Copyright © 2018年 yin chen. All rights reserved.
//

import UIKit

extension MineInfoViewController {

    //获取个人信息接口
    func getMyInformationHttpGetCmd(){
        let cmd:HttpCommand = MyInformationHttpGetCmd.init(version: PHttpVersion_v1)
        let block:httpBlock = {[weak self] (result:RequestResult!,useInfo:Any!)->() in
            if result != nil {
                self?.httpMyInformationHttpGetResultResponse(result: result)
            }else{
                print("空的")
            }
        }
        let dic:NSMutableDictionary = NSMutableDictionary()
        dic[kHttpMyInformationHttpGetCmd_userid] = AccountInfo.sharedInstance().UserId
        let completeDelegate = SMBaseHttpComplete.init(block: block , withUserInfo: nil)
        cmd.requestInfo = dic as? [AnyHashable : Any]
        cmd.completeDelegate=completeDelegate
        print("url==%@",cmd.getUrl())
        cmd.execute()
        
    }
    func httpMyInformationHttpGetResultResponse(result:RequestResult){
        let r:MyInformationHttpGetResult = result as! MyInformationHttpGetResult
        if r.isOk() {
            let array:NSMutableArray = r.getMyInformationAllData()
            self.inforHttpModel = array[0] as! MyInformationHttpModel
            self.dataSource = NSMutableArray()
            initDate()
        }else{
            SMToastView.showMessage("请查看当前网络状态！")
        }
        group.leave()
//        hidenHintView()
//        self.myTableView.mj_header.endRefreshing()
    }
    
    
}
