From 945455e2282d3e3fe0923231c7ec6072476ce688 Mon Sep 17 00:00:00 2001 From: 葛建军 Date: Thu, 18 May 2017 09:52:57 +0800 Subject: [PATCH] no message --- YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj | 4 ---- YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist | 18 ++++++++++++++++++ YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift | 238 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard | 785 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/util/account.swift | 8 ++++---- YouerLiveVideo/YouerLiveVideo/util/network.swift | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------- 6 files changed, 80 insertions(+), 1044 deletions(-) delete mode 100644 YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj index 099f01e..facfff0 100644 --- a/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj +++ b/YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj @@ -164,7 +164,6 @@ BFBB83D71ECC4446008B404B /* PassWordView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83D51ECC4446008B404B /* PassWordView.xib */; }; BFBB83E31ECC445D008B404B /* User.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83D91ECC445D008B404B /* User.storyboard */; }; BFBB83E61ECC445D008B404B /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83DD1ECC445D008B404B /* LoginViewController.swift */; }; - BFBB83E81ECC445D008B404B /* PersonalSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83DF1ECC445D008B404B /* PersonalSettingViewController.swift */; }; BFBB83E91ECC445D008B404B /* RegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83E01ECC445D008B404B /* RegisterViewController.swift */; }; BFBB83EA1ECC445D008B404B /* User.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFBB83E11ECC445D008B404B /* User.storyboard */; }; BFBB83EB1ECC445D008B404B /* UserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBB83E21ECC445D008B404B /* UserViewController.swift */; }; @@ -502,7 +501,6 @@ BFBB83D51ECC4446008B404B /* PassWordView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PassWordView.xib; sourceTree = ""; }; BFBB83D91ECC445D008B404B /* User.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = User.storyboard; sourceTree = ""; }; BFBB83DD1ECC445D008B404B /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = ""; }; - BFBB83DF1ECC445D008B404B /* PersonalSettingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonalSettingViewController.swift; sourceTree = ""; }; BFBB83E01ECC445D008B404B /* RegisterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegisterViewController.swift; sourceTree = ""; }; BFBB83E11ECC445D008B404B /* User.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = User.storyboard; sourceTree = ""; }; BFBB83E21ECC445D008B404B /* UserViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserViewController.swift; sourceTree = ""; }; @@ -1165,7 +1163,6 @@ isa = PBXGroup; children = ( BFBB83DD1ECC445D008B404B /* LoginViewController.swift */, - BFBB83DF1ECC445D008B404B /* PersonalSettingViewController.swift */, BFBB83E01ECC445D008B404B /* RegisterViewController.swift */, BFBB83E11ECC445D008B404B /* User.storyboard */, ); @@ -1478,7 +1475,6 @@ 59C25B491ECAD643009FF276 /* MoreTVStationViewController.swift in Sources */, 5904FC511ECA8B8C00E631FF /* TVStationViewController.swift in Sources */, BFBB83D31ECBEB4E008B404B /* JYScrollView.m in Sources */, - BFBB83E81ECC445D008B404B /* PersonalSettingViewController.swift in Sources */, BF25E0081DDAA36A003EC0C1 /* UIView+WebCache.m in Sources */, 5904FC5D1ECA8ED400E631FF /* HomePageViewController.swift in Sources */, BFBB83A91ECAE35E008B404B /* LeadViewController.swift in Sources */, diff --git a/YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index fe2b454..cf7047e 100644 --- a/YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/YouerLiveVideo/YouerLiveVideo.xcodeproj/xcuserdata/jun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,4 +2,22 @@ + + + + + + diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift deleted file mode 100644 index 049827f..0000000 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/PersonalSettingViewController.swift +++ /dev/null @@ -1,238 +0,0 @@ -// -// PersonalSettingViewController.swift -// YouerLiveVideo -// -// Created by 左丞 on 16/11/12. -// Copyright © 2016年 左丞. All rights reserved. -// - -import UIKit - -class PersonalSettingViewController: UIViewController ,UITableViewDelegate,UITableViewDataSource,UINavigationControllerDelegate,UIImagePickerControllerDelegate{ - @IBOutlet weak var userSettingTableView: UITableView! - @IBOutlet var rightBarBtn: UIBarButtonItem! - @IBOutlet var loginoutBtn: UIButton! - var titleArr:[String] = ["头像","昵称","手机号(账号)"]//["头像","账号","昵称","性别"] - var user:Contact! - var isUserActivity:Bool=false - override func viewDidLoad() { - super.viewDidLoad() - user = Contact() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - switch indexPath.row { - case 0: - let sheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - sheet.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) - sheet.addAction(UIAlertAction(title: "拍照", style: .default, handler: { (action) in - if cameraOrPhotPermissions(1, view: self.view){ - let vc = UIImagePickerController() - vc.delegate = self - vc.sourceType = .camera - self.present(vc, animated: true, completion: nil) - }else{ - - } - self.userSettingTableView.reloadData() - })) - sheet.addAction(UIAlertAction(title: "从相册选择", style: .default, handler: { (action) in - if cameraOrPhotPermissions(1, view: self.view){ - let vc = UIImagePickerController() - vc.delegate = self - vc.sourceType = .photoLibrary - self.present(vc, animated: true, completion: nil) - }else{ - - } - self.userSettingTableView.reloadData() - })) - self.present(sheet, animated: true, completion: nil) - break - case 1: - let alert = UIAlertController(title: "修改昵称", message: "", preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "确定", style: .default, handler: { (action) in - if alert.textFields![0].text == ""{ - return - } - if (alert.textFields![0].text?.characters.count)!>15{ - self.user.nickName = (alert.textFields![0].text! as NSString).substring(to: 15) - }else{ - self.user.nickName = alert.textFields![0].text - } - self.userSettingTableView.reloadData() - })) - alert.addAction(UIAlertAction(title: "取消", style: .default, handler: nil)) - alert.addTextField { (text) in - text.placeholder = "请输入昵称,且不能超过15个字符" - } - self.present(alert, animated: true, completion: nil) - break - case 3: - let sheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - sheet.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil)) - sheet.addAction(UIAlertAction(title: "男", style: .default, handler: { (action) in - self.user.userSex = "男" - self.userSettingTableView.reloadData() - })) - sheet.addAction(UIAlertAction(title: "女", style: .default, handler: { (action) in - self.user.userSex = "女" - self.userSettingTableView.reloadData() - })) - self.present(sheet, animated: true, completion: nil) - break - default: - break - } - } - - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return titleArr.count - } - - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return 44 - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! PersonalSettingCell - cell.nameTitleLabel.text = titleArr[indexPath.row] - cell.nameLabelRightSpace.constant = 8 - cell.imagePhoto.isHidden = true - cell.namelabel.isHidden = false - cell.rightArrow.isHidden = false - cell.isUserInteractionEnabled = true - if isUserActivity { - cell.isUserInteractionEnabled=true - }else{ - cell.isUserInteractionEnabled=false - } - switch indexPath.row { - case 0: - cell.imagePhoto.isHidden = false - cell.namelabel.isHidden = true - cell.imagePhoto.sd_setImage(with: URL(string: user.imageURL), placeholderImage: UIImage(named: "defphoto")) - break - case 1: - cell.namelabel.text = user.nickName//AppDelegate.instance().accountManager.name() - break - case 2: - cell.nameLabelRightSpace.constant = -10 - cell.rightArrow.isHidden = true - cell.isUserInteractionEnabled = false - cell.namelabel.text = user.userId//AppDelegate.instance().accountManager.phone() - break - case 3: - cell.namelabel.text = user.userSex - break - - default: - break - } - return cell - } - - func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { - picker.dismiss(animated: true, completion: { () -> Void in - var oimage = info[UIImagePickerControllerOriginalImage] as? UIImage - oimage = oimage!.imageScaledToScale() - let filePath=FilesManager.imageFilePath(String(format:"%f.jpg",Date().timeIntervalSince1970)) - try? UIImageJPEGRepresentation(oimage!,0.5)!.write(to: URL(fileURLWithPath: filePath), options: [.atomic]) - self.updateImage(file: filePath) - }) - } - func updateImage(file:String){ - SVProgressHUD.show(withStatus: "图片上传中...") - SVProgressHUD.setDefaultMaskType(.black) - AppDelegate.instance().httpServer.uploadFile(file: NSURL(fileURLWithPath: file)) { (str, error) in - SVProgressHUD.dismiss() - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in - let str=json.contentData().arrayValue[0].stringValue - self.user.imageURL=str - }, failHandler: { (error) in - self.user.imageURL="" - self.view.makeToast("图片上传失败:\(error.localizedDescription)") - }) - self.userSettingTableView.reloadData() - } - } - // MARK: - 退出登录按钮点击事件 - @IBAction func ExsitBtnClickAction(_ sender: Any) { - AppDelegate.instance().accountManager.logOut() - } - // MARK: - 完成按钮点击事件 - @IBAction func finishAction(_ sender: UIBarButtonItem) { - if isUserActivity { - //需要新的接口来修改个人信息 - SVProgressHUD.show(withStatus: "修改个人信息...") - SVProgressHUD.setDefaultMaskType(.black) - let parameters:Dictionary=["f_RealName":self.user.nickName as AnyObject,"f_HeadIcon":self.user.imageURL as AnyObject] - AppDelegate.instance().httpServer.updataUserInfo(parameters: parameters, completionHandler: { (str, error) in - SVProgressHUD.dismiss() - if error==nil { - if JSON.fromString(jsonString: str)!["status"].intValue == 1{ - //把账号信息存储下来,暂时这样修改。若以后个人信息中有其他元素,需加新的接口来更新个人信息。 - // var dic=Setting.getUserInfo()?.dictionaryValue["data"]?.dictionaryObject - // _=dic?.updateValue(self.user.nickName, forKey: "f_RealName") - // _=dic?.updateValue(self.user.imageURL, forKey: "f_HeadIcon") - // let userInfo:Dictionary=["status":1 as AnyObject,"data":dic as AnyObject] - // AppDelegate.instance().accountManager.rawUserInfo=JSON(userInfo) - // _=Setting.saveUserInfo(JSON(userInfo).rawString()) - XSTLiveManager.shareXSTLiveManager().setUpPersonInfo(name: self.user.nickName, icon: self.user.imageURL) - AppDelegate.instance().window?.makeToast("修改个人信息成功") - self.rightBarBtn.title="修改" - self.isUserActivity=false - self.loginoutBtn.isHidden=false - self.userSettingTableView.reloadData() - AppDelegate.instance().accountManager.refreshUserInfo(completionHandler: { (finish) in - if !finish{ - AppDelegate.instance().window?.makeToast("身份获取失败") - } - }) - }else{ - self.view.makeToast("修改个人信息失败:\(JSON.fromString(jsonString: str)!["message"].stringValue)") - } - }else{ - self.view.makeToast("修改个人信息失败:\(error!.description)") - } - }) - }else{ - self.rightBarBtn.title="保存" - self.isUserActivity=true - self.loginoutBtn.isHidden=true - self.userSettingTableView.reloadData() - } - } - -} - -class PersonalSettingCell: UITableViewCell { - - - @IBOutlet weak var nameLabelRightSpace: NSLayoutConstraint! - - @IBOutlet weak var rightArrow: UIImageView! - @IBOutlet weak var namelabel: UILabel! - @IBOutlet weak var imagePhoto: UIImageView! - @IBOutlet weak var nameTitleLabel: UILabel! - - -} - -class Contact { - var nickName:String! - var userId:String! - var userSex:String! - var imageURL:String! - init() { - nickName = AppDelegate.instance().accountManager.name() - userId = AppDelegate.instance().accountManager.phone() - userSex = "男" - imageURL = AppDelegate.instance().accountManager.photo() - } -} diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard index 0067c76..3d3dc0d 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/controllers/User/UserCenter/User.storyboard @@ -235,171 +235,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -859,632 +694,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/YouerLiveVideo/YouerLiveVideo/util/account.swift b/YouerLiveVideo/YouerLiveVideo/util/account.swift index 3ac4ee2..a393335 100644 --- a/YouerLiveVideo/YouerLiveVideo/util/account.swift +++ b/YouerLiveVideo/YouerLiveVideo/util/account.swift @@ -106,7 +106,7 @@ class AccountManager{ return topVC! } func refreshUserInfo(completionHandler:((Bool) -> Void)?){ - AppDelegate.instance().httpServer.uplocalUserInfo { (str, error) -> Void in + AppDelegate.instance().httpServer.getCurrentInfo { (str, error) -> Void in if error == nil { if JSON.fromString(jsonString: str)!["status"].intValue==4 { AppDelegate.instance().httpServer.refreshToken(completionHandler: { (str, error) in @@ -158,14 +158,14 @@ class Setting{ class func saveUserInfo(_ info:String?)->Bool{ if let ret=info{ - UserDefaults.standard.set(ret, forKey: HTTPServer.URL_LIVEUSERINFO) + UserDefaults.standard.set(ret, forKey: HTTPServer.URL_ACCOUNTCURRENTINFO) }else{ - UserDefaults.standard.set(nil, forKey: HTTPServer.URL_LIVEUSERINFO) + UserDefaults.standard.set(nil, forKey: HTTPServer.URL_ACCOUNTCURRENTINFO) } return UserDefaults.standard.synchronize() } class func getUserInfo()->JSON?{ - let ob = UserDefaults.standard.string(forKey: HTTPServer.URL_LIVEUSERINFO) + let ob = UserDefaults.standard.string(forKey: HTTPServer.URL_ACCOUNTCURRENTINFO) return JSON.fromString(jsonString: ob) } class func saveJson(json:JSON,forKey key:String)->Bool{ diff --git a/YouerLiveVideo/YouerLiveVideo/util/network.swift b/YouerLiveVideo/YouerLiveVideo/util/network.swift index 49d348c..429ac07 100644 --- a/YouerLiveVideo/YouerLiveVideo/util/network.swift +++ b/YouerLiveVideo/YouerLiveVideo/util/network.swift @@ -89,7 +89,7 @@ final class KHttp{ } final class HTTPServer{ - static let HOST="http://60.190.202.49:8096/swagger/ui/index#"//"https://zbapi.myjxt.com"//"http://60.190.202.49:8096/swagger/ui/index#" + static let HOST="http://60.190.202.49:8096"//"https://zbapi.myjxt.com"//"http://60.190.202.49:8096/swagger/ui/index#" static let URL_OAUTH_TOKEN=HOST+"/OAuth/Token" //登录 @@ -110,16 +110,16 @@ final class HTTPServer{ static let URL_UPLOAD_FILE=HOST+"/api/Common/UploadFile" //文件上传接口,接受图片(gif,jpg,jpeg,png,bmp)、视频(flv,mp4)、音频(mp3,aac) static let URL_COURSEGETHOTRESCOURSE=HOST+"/api/Course/GetHotRescourse" //获取热门微课/课件/电视台节目 - static let URL_COMMONGETSUBJECTS=HOST+"/api/Course/GetResourceCount" //获取微课/课件/电视台节目的总数量 - static let URL_COMMONGETSCHOOLTYPES=HOST+"/api/Course/GetTopTenSchool" //获取十佳校园电视台 - static let URL_COMMONGETLUNBOLIST=HOST+"/api/Course/GetExcellentSchool" //获取优秀电视台 - static let URL_COMMONGETGRADES=HOST+"/api/Course/GetExcellentProgram" //获取校园电视节目 - static let URL_COMMONGETCOURSEWAVES=HOST+"/api/Course/GetResourceModel" //获取单个课程 - static let URL_UPLOAD_FILE=HOST+"/api/Course/GetResourceList" //根据知识点/教材等各种条件来分页获取资源/课件 - static let URL_COMMONGETLUNBOLIST=HOST+"/api/Course/GetWaveCatagory" //获取教材目录(已初始化成ztree所要求的格式) - static let URL_COMMONGETGRADES=HOST+"/api/Course/GetTopicCatagory" //获取知识点目录(已初始化成ztree所要求的格式) - static let URL_COMMONGETCOURSEWAVES=HOST+"/api/Course/GetTestCatagory" //获取考点目录(已初始化成ztree所要求的格式) - static let URL_UPLOAD_FILE=HOST+"/api/Course/GetTelevisionStationCatagory" //获取电视台目录 + static let URL_COURSEGETRESOURCECOUNT=HOST+"/api/Course/GetResourceCount" //获取微课/课件/电视台节目的总数量 + static let URL_COURSEGETTOPTENSCHOOL=HOST+"/api/Course/GetTopTenSchool" //获取十佳校园电视台 + static let URL_COURSEGETEXCELLENTSCHOOL=HOST+"/api/Course/GetExcellentSchool" //获取优秀电视台 + static let URL_COURSEGETEXCELLENTPROGRAM=HOST+"/api/Course/GetExcellentProgram" //获取校园电视节目 + static let URL_COURSEGETRESOURCEMODEL=HOST+"/api/Course/GetResourceModel" //获取单个课程 + static let URL_COURSEGETRESOURCELIST=HOST+"/api/Course/GetResourceList" //根据知识点/教材等各种条件来分页获取资源/课件 + static let URL_COURSEGETWAVEGATAGORY=HOST+"/api/Course/GetWaveCatagory" //获取教材目录(已初始化成ztree所要求的格式) + static let URL_COURSEGETTOPICCATAGORY=HOST+"/api/Course/GetTopicCatagory" //获取知识点目录(已初始化成ztree所要求的格式) + static let URL_COURSEGETTESTCATAGORY=HOST+"/api/Course/GetTestCatagory" //获取考点目录(已初始化成ztree所要求的格式) + static let URL_COURSEGETTELEVISIONSTATIONCATAGORY=HOST+"/api/Course/GetTelevisionStationCatagory" //获取电视台目录 var token:String?{ @@ -174,8 +174,8 @@ final class HTTPServer{ KHttp.GET(url: HTTPServer.URL_ACCOUNTUPDATEPASSWORD, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) } //获取当前登陆用户的信息 - func getCurrentInfo(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ - KHttp.GET(url: HTTPServer.URL_ACCOUNTCURRENTINFO, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + func getCurrentInfo(completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_ACCOUNTCURRENTINFO, headers:["Authorization":token!], completionHandler: completionHandler) } //激活账号 func postActivateAccount(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ @@ -216,6 +216,51 @@ final class HTTPServer{ KHttp.GET(url: HTTPServer.URL_COMMONGETCOURSEWAVES, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) } //MARK:-Course + //获取热门微课/课件/电视台节目 + func getHotRescourse(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_COURSEGETHOTRESCOURSE, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //获取微课/课件/电视台节目的总数量 + func getResourceCount(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_COURSEGETRESOURCECOUNT, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //获取十佳校园电视台 + func getTopTenSchool(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_COURSEGETTOPTENSCHOOL, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + + //获取优秀电视台 + func postExcellentSchool(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.POST(url: HTTPServer.URL_COURSEGETEXCELLENTSCHOOL, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //获取校园电视节目 + func postExcellentProgram(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.POST(url: HTTPServer.URL_COURSEGETEXCELLENTPROGRAM, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //获取单个课程 + func getResourceModel(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_COURSEGETRESOURCEMODEL, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //根据知识点/教材等各种条件来分页获取资源/课件 + func postResourceList(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.POST(url: HTTPServer.URL_COURSEGETRESOURCELIST, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //获取教材目录(已初始化成ztree所要求的格式) + func getWaveCatagory(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_COURSEGETWAVEGATAGORY, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //获取知识点目录(已初始化成ztree所要求的格式) + func getTopicCatagory(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_COURSEGETTOPICCATAGORY, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //获取考点目录(已初始化成ztree所要求的格式) + func getTestCatagory(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_COURSEGETTESTCATAGORY, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } + //获取电视台目录 + func getTelevisionStationCatagory(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ + KHttp.GET(url: HTTPServer.URL_COURSEGETTELEVISIONSTATIONCATAGORY, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) + } //MARK:-DataStatistics //MARK:-UserCenter -- libgit2 0.21.0