Commit ac85ee8fc7f9696259bf61b2de10aebbf9965703
1 parent
10d1b272
Exists in
parentassistant
给network瘦身,添加德育报告和场景接口
Showing
4 changed files
with
115 additions
and
88 deletions
Show diff stats
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ParentAssistant/ParentAssistant/Classes/controllers/report/MoralViewController.swift
| ... | ... | @@ -16,9 +16,21 @@ class MoralViewController: UIViewController,UITableViewDelegate,UITableViewDataS |
| 16 | 16 | self.title = "德育报告" |
| 17 | 17 | tableView.delegate = self |
| 18 | 18 | tableView.dataSource = self |
| 19 | - // Do any additional setup after loading the view. | |
| 19 | + | |
| 20 | + | |
| 21 | + downLoadDataFromNet() | |
| 20 | 22 | } |
| 21 | - | |
| 23 | + | |
| 24 | + private func downLoadDataFromNet(){ | |
| 25 | + | |
| 26 | + let params = ["name":"sss"] | |
| 27 | + HTTPServer.shared.getEvaluationSceneAnalysis(parameters: params as [String : AnyObject]) { (backData, error) in | |
| 28 | + | |
| 29 | + } | |
| 30 | + } | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 22 | 34 | func numberOfSections(in tableView: UITableView) -> Int { |
| 23 | 35 | return 3 |
| 24 | 36 | } | ... | ... |
ParentAssistant/ParentAssistant/Classes/util/Macro.swift
| ... | ... | @@ -8,12 +8,71 @@ |
| 8 | 8 | |
| 9 | 9 | import Foundation |
| 10 | 10 | import UIKit |
| 11 | -//全局变量 | |
| 11 | + | |
| 12 | +//MARK: -------------------------- 全局常量 ----------------------------- | |
| 12 | 13 | |
| 13 | 14 | let appDelegate = UIApplication.shared.delegate as! AppDelegate |
| 14 | 15 | |
| 15 | 16 | let screenWidth = UIScreen.main.bounds.size.width |
| 16 | 17 | let screenHeight = UIScreen.main.bounds.size.height |
| 17 | 18 | |
| 19 | +//MARK: -------------------------- 接口地址 ---------------------------- | |
| 20 | +let appsecret="sincere:3a530f39f99411b454e667d69693c127" | |
| 21 | +var ReleaseHOST:String!="http://campus.myjxt.com"//正式网址 | |
| 22 | +var ReleaseHOSTWap:String!="http://parent.myjxt.com" | |
| 23 | +var ReleaseHOSTImage:String!="http://manage.myjxt.com" | |
| 24 | +var DebugHOST:String!="http://60.190.202.57:1000"//测试网址 | |
| 25 | +var DebugHOSTWap:String!="http://60.190.202.57:8101" | |
| 26 | +var DebugHOSTImage:String!="http://60.190.202.57:8196" | |
| 27 | +var HOST:String! = Debug.isFormal ? ReleaseHOST : DebugHOST | |
| 28 | +var HOSTWAP:String! = Debug.isFormal ? ReleaseHOSTWap : DebugHOSTWap | |
| 29 | +var HOSTImage:String! = Debug.isFormal ? ReleaseHOSTImage : DebugHOSTImage | |
| 30 | + | |
| 31 | +let URL_UPLOAD_FILE=HOST+"/api/Class/UploadFile" //上传图片 | |
| 32 | + | |
| 33 | +var URL_GETHOSTURL:String! = "http://campus.myjxt.com/api/Common/GetListSchoolPrivate" | |
| 34 | + | |
| 35 | +let URL_OAUTH_TOKEN="/Token" | |
| 36 | +let URL_CURRENT_INFO="/api/Account/CurrentInfo" | |
| 37 | +let URL_CHANGE_PASSWORD="/api/Account/ChangePassword" | |
| 38 | +let URL_CHANGE_INFO="/api/Account/ChangeInfo" | |
| 39 | +let URL_CHANGEPHONECAPTCHA="/api/Account/ChangePhoneCaptcha" | |
| 40 | +let URL_RESTPW="/api/Account/ReSetpass" | |
| 41 | +let URL_SCANLOGINCODE = "/api/Account/ScanLogin" | |
| 42 | +let URL_IDENTITYLIST = "/api/Account/IdentityList" | |
| 43 | +let URL_IDENTITYCONFRIM = "/api/Account/IdentityConfrim" | |
| 44 | + | |
| 45 | +let URL_PARENTREGISTER = "/api/ParentHelper/ParentRegister"//家长注册 | |
| 46 | +let URL_CAPTCHA="/api/Account/ChangePhoneCaptcha"//获取注册验证码 | |
| 47 | +let URL_GETPARENTINFO = "/api/ParentHelper/GetParentInfo"//登录获取家长信息(包括关联的孩子信息区分绑定状态) | |
| 48 | +let URL_UPDATEPARENTINFO = "/api/ParentHelper/UpdateParentInfo"//更新姓名和性别 | |
| 49 | +let URL_GETORDERLIST = "/api/ParentHelper/GetOrderList"//获取我的短信包列表 | |
| 50 | +let URL_UNBINDSTUDENT = "/api/ParentHelper/UnBindStudent"//解绑孩子 | |
| 51 | + | |
| 52 | +let URL_GETAREASCHOOL = "/api/ParentHelper/GetAreaSchool"//根据选择的市获取该地区的学校或者根据关键字搜索学校 | |
| 53 | +let URL_GETCLASSORGRADE = "/api/ParentHelper/GetClassOrGrade"//获取该学校的年级或班级 | |
| 54 | +let URL_BINDLINGCHILDREN = "/api/ParentHelper/BindlingChildren"//绑定孩子信息(合作学校绑定返回null,非合作学校返回“汇作业”账号和密码) | |
| 55 | + | |
| 56 | +let URL_GETOPENADS="/api/Index/GetOpenAds" //获取开屏广告URL | |
| 57 | +let URL_USER_MYLIVEREMIND="/api/User/MyLiveRemind" //我的课程提醒 | |
| 58 | +let URL_USER_USERINFO="/api/User/UserInfo" //更新本地个人信息 | |
| 59 | +let URL_USER_UPDATEPASSWORD="/api/User/UpdatePassword" //修改密码 | |
| 60 | + | |
| 61 | + | |
| 62 | +//MARK: ---- ParentService ----- | |
| 63 | +let URL_PARENTSERVICE_GETACTIVITYTOOL="/api/ParentService/GetActivityTool" //获取工具入口和活动 | |
| 64 | +let URL_PARENTSERVICE_GETCHANNELINFO="/api/ParentService/GetChannelInfo" //获取频道资讯 | |
| 65 | +let URL_PARENTSERVICE_GETINFORMATIONTOPIC="/api/ParentService/GetInformationTopic" //获取首页资讯话题/搜索资讯 | |
| 66 | +let URL_PARENTSERVICE_GETORDERSUBJECT="/api/ParentService/GetOrderSubject" //获取订购的报告或科目 | |
| 67 | +let URL_PARENTSERVICE_WORKREPORT="/api/ParentService/WorkReport" //获取报告列表 | |
| 68 | +let URL_PARENTSERVICE_WORKREPORTDETAILS="/api/ParentService/WorkReportDetails" //获取报告详情 | |
| 69 | +let URL_PARENTSERVICE_ORDERCENTER="/api/ParentService/OrderCenter" //订购信息 | |
| 70 | +let URL_PARENTSERVICE_ORDERSERVICEDETAILS="/api/ParentService/OrderServiceDetails" //查看订购详情 | |
| 71 | +let URL_PARENTSERVICE_GETADS="/api/ParentService/GetAds" //获取广告位信息 广告位置0-首次广告位1-开屏广告位2-资讯首页3-频道首页4-频道内容5-文章内容页 | |
| 18 | 72 | |
| 73 | +//MARK: 量规评价 | |
| 74 | +/// 德育报告整体详情 | |
| 75 | +let URL_POST_EVALUATION_ANALYSIS = "/api/EvaluationStatistics/GetEvaluationAlalysis" | |
| 76 | +/// 德育报告场景详情 | |
| 77 | +let URL_POST_EVALUATION_ANALYSIS_DETAILS = "/api/EvaluationLabel/GetSceneAnalysisDetails" | |
| 19 | 78 | ... | ... |
ParentAssistant/ParentAssistant/Classes/util/network.swift
| ... | ... | @@ -34,7 +34,9 @@ final class KHttp{ |
| 34 | 34 | // return (.CancelAuthenticationChallenge, nil) |
| 35 | 35 | // } |
| 36 | 36 | // } |
| 37 | - request(url, method: method, parameters: parameters, encoding: encoding, headers: headers).responseString { (response) -> Void in | |
| 37 | + | |
| 38 | + let requestUrl = HOST + url | |
| 39 | + request(requestUrl, method: method, parameters: parameters, encoding: encoding, headers: headers).responseString { (response) -> Void in | |
| 38 | 40 | let error=response.result.error |
| 39 | 41 | let str=response.result.value |
| 40 | 42 | if let er=error{ |
| ... | ... | @@ -45,7 +47,7 @@ final class KHttp{ |
| 45 | 47 | }else{ |
| 46 | 48 | appDelegate.window!.makeToast("加载失败:\(er.localizedDescription)", duration: 1, position: CSToastPositionBottom) |
| 47 | 49 | } |
| 48 | - NSLog("ERROR: url:\(url),error:\(er)") | |
| 50 | + NSLog("ERROR: url:\(requestUrl),error:\(er)") | |
| 49 | 51 | } |
| 50 | 52 | completionHandler(str,error as NSError?) |
| 51 | 53 | } |
| ... | ... | @@ -85,68 +87,15 @@ final class HTTPServer{ |
| 85 | 87 | static let shared = HTTPServer() |
| 86 | 88 | init() {} |
| 87 | 89 | |
| 88 | - let appsecret="sincere:3a530f39f99411b454e667d69693c127" | |
| 89 | - static var ReleaseHOST:String!="http://campus.myjxt.com"//正式网址 | |
| 90 | - static var ReleaseHOSTWap:String!="http://parent.myjxt.com" | |
| 91 | - static var ReleaseHOSTImage:String!="http://manage.myjxt.com" | |
| 92 | - static var DebugHOST:String!="http://60.190.202.57:1000"//测试网址 | |
| 93 | - static var DebugHOSTWap:String!="http://60.190.202.57:8101" | |
| 94 | - static var DebugHOSTImage:String!="http://60.190.202.57:8196" | |
| 95 | - static var HOST:String! = Debug.isFormal ? ReleaseHOST : DebugHOST | |
| 96 | - static var HOSTWAP:String! = Debug.isFormal ? ReleaseHOSTWap : DebugHOSTWap | |
| 97 | - static var HOSTImage:String! = Debug.isFormal ? ReleaseHOSTImage : DebugHOSTImage | |
| 98 | - | |
| 99 | - static let URL_UPLOAD_FILE=HOST+"/api/Class/UploadFile" //上传图片 | |
| 100 | - | |
| 101 | - static var URL_GETHOSTURL:String! = "http://campus.myjxt.com/api/Common/GetListSchoolPrivate" | |
| 102 | - | |
| 103 | - static var URL_OAUTH_TOKEN=HOST+"/Token" | |
| 104 | - static var URL_CURRENT_INFO=HOST+"/api/Account/CurrentInfo" | |
| 105 | - static var URL_CHANGE_PASSWORD=HOST+"/api/Account/ChangePassword" | |
| 106 | - static var URL_CHANGE_INFO=HOST+"/api/Account/ChangeInfo" | |
| 107 | - static var URL_CHANGEPHONECAPTCHA=HOST+"/api/Account/ChangePhoneCaptcha" | |
| 108 | - static var URL_RESTPW=HOST+"/api/Account/ReSetpass" | |
| 109 | - static var URL_SCANLOGINCODE = HOST+"/api/Account/ScanLogin" | |
| 110 | - static var URL_IDENTITYLIST = HOST+"/api/Account/IdentityList" | |
| 111 | - static var URL_IDENTITYCONFRIM = HOST+"/api/Account/IdentityConfrim" | |
| 112 | - | |
| 113 | - static var URL_PARENTREGISTER = HOST+"/api/ParentHelper/ParentRegister"//家长注册 | |
| 114 | - static var URL_CAPTCHA=HOST+"/api/Account/ChangePhoneCaptcha"//获取注册验证码 | |
| 115 | - static var URL_GETPARENTINFO = HOST+"/api/ParentHelper/GetParentInfo"//登录获取家长信息(包括关联的孩子信息区分绑定状态) | |
| 116 | - static var URL_UPDATEPARENTINFO = HOST+"/api/ParentHelper/UpdateParentInfo"//更新姓名和性别 | |
| 117 | - static var URL_GETORDERLIST = HOST+"/api/ParentHelper/GetOrderList"//获取我的短信包列表 | |
| 118 | - static var URL_UNBINDSTUDENT = HOST+"/api/ParentHelper/UnBindStudent"//解绑孩子 | |
| 119 | - | |
| 120 | - static var URL_GETAREASCHOOL = HOST+"/api/ParentHelper/GetAreaSchool"//根据选择的市获取该地区的学校或者根据关键字搜索学校 | |
| 121 | - static var URL_GETCLASSORGRADE = HOST+"/api/ParentHelper/GetClassOrGrade"//获取该学校的年级或班级 | |
| 122 | - static var URL_BINDLINGCHILDREN = HOST+"/api/ParentHelper/BindlingChildren"//绑定孩子信息(合作学校绑定返回null,非合作学校返回“汇作业”账号和密码) | |
| 123 | - | |
| 124 | - static let URL_GETOPENADS=HOST+"/api/Index/GetOpenAds" //获取开屏广告URL | |
| 125 | - static let URL_USER_MYLIVEREMIND=HOST+"/api/User/MyLiveRemind" //我的课程提醒 | |
| 126 | - static let URL_USER_USERINFO=HOST+"/api/User/UserInfo" //更新本地个人信息 | |
| 127 | - static let URL_USER_UPDATEPASSWORD=HOST+"/api/User/UpdatePassword" //修改密码 | |
| 128 | - | |
| 129 | - | |
| 130 | - //MARK: ---- ParentService ----- | |
| 131 | - static let URL_PARENTSERVICE_GETACTIVITYTOOL=HOST+"/api/ParentService/GetActivityTool" //获取工具入口和活动 | |
| 132 | - static let URL_PARENTSERVICE_GETCHANNELINFO=HOST+"/api/ParentService/GetChannelInfo" //获取频道资讯 | |
| 133 | - static let URL_PARENTSERVICE_GETINFORMATIONTOPIC=HOST+"/api/ParentService/GetInformationTopic" //获取首页资讯话题/搜索资讯 | |
| 134 | - static let URL_PARENTSERVICE_GETORDERSUBJECT=HOST+"/api/ParentService/GetOrderSubject" //获取订购的报告或科目 | |
| 135 | - static let URL_PARENTSERVICE_WORKREPORT=HOST+"/api/ParentService/WorkReport" //获取报告列表 | |
| 136 | - static let URL_PARENTSERVICE_WORKREPORTDETAILS=HOST+"/api/ParentService/WorkReportDetails" //获取报告详情 | |
| 137 | - static let URL_PARENTSERVICE_ORDERCENTER=HOST+"/api/ParentService/OrderCenter" //订购信息 | |
| 138 | - static let URL_PARENTSERVICE_ORDERSERVICEDETAILS=HOST+"/api/ParentService/OrderServiceDetails" //查看订购详情 | |
| 139 | - static let URL_PARENTSERVICE_GETADS=HOST+"/api/ParentService/GetAds" //获取广告位信息 广告位置0-首次广告位1-开屏广告位2-资讯首页3-频道首页4-频道内容5-文章内容页 | |
| 140 | - | |
| 141 | 90 | var token:String?{ |
| 142 | 91 | return AccountManager.shared.token |
| 143 | 92 | } |
| 144 | -// var accountManager:AccountManager! | |
| 93 | + | |
| 145 | 94 | //上传图片 |
| 146 | 95 | func uploadFile(file:NSURL,progress:((Int64, Int64, Int64) -> Void)? = nil,completionHandler: @escaping (String?, NSError?) -> Void){ |
| 147 | 96 | upload(multipartFormData: { (multipartFormData) in |
| 148 | 97 | multipartFormData.append(file as URL, withName: "file") |
| 149 | - }, usingThreshold: SessionManager.multipartFormDataEncodingMemoryThreshold, to: HTTPServer.URL_UPLOAD_FILE, method: .post, headers: nil) { (encodingResult) in | |
| 98 | + }, usingThreshold: SessionManager.multipartFormDataEncodingMemoryThreshold, to: URL_UPLOAD_FILE, method: .post, headers: nil) { (encodingResult) in | |
| 150 | 99 | switch encodingResult { |
| 151 | 100 | case .success(let upload, _, _): |
| 152 | 101 | upload.responseString(completionHandler: { (response) in |
| ... | ... | @@ -165,7 +114,7 @@ final class HTTPServer{ |
| 165 | 114 | let time=timeFormatter.string(from: Date())+"\(arc4random()%10000)" |
| 166 | 115 | let appSecret="5d744518ac1c" |
| 167 | 116 | let authorization=(time.md5()+":"+(time.md5()+appSecret).md5()).data(using: String.Encoding.ascii)?.base64EncodedString(options: Data.Base64EncodingOptions(rawValue: 0)) ?? "" |
| 168 | - KHttp.POST(url: HTTPServer.URL_OAUTH_TOKEN,parameters: ["grant_type":"password" as AnyObject,"username":phone as AnyObject,"password":password as AnyObject], encoding: URLEncoding.default,headers:["Authorization":"Basic "+authorization], completionHandler: completionHandler) | |
| 117 | + KHttp.POST(url: URL_OAUTH_TOKEN,parameters: ["grant_type":"password" as AnyObject,"username":phone as AnyObject,"password":password as AnyObject], encoding: URLEncoding.default,headers:["Authorization":"Basic "+authorization], completionHandler: completionHandler) | |
| 169 | 118 | } |
| 170 | 119 | //更新token |
| 171 | 120 | func refreshToken(completionHandler:@escaping (String?, NSError?) -> Void,token refresh_token:String){ |
| ... | ... | @@ -174,34 +123,34 @@ final class HTTPServer{ |
| 174 | 123 | let time=timeFormatter.string(from: Date())+"\(arc4random()%10000)" |
| 175 | 124 | let appSecret="5d744518ac1c" |
| 176 | 125 | let authorization=(time.md5()+":"+(time.md5()+appSecret).md5()).data(using: String.Encoding.ascii)?.base64EncodedString(options: Data.Base64EncodingOptions(rawValue: 0)) ?? "" |
| 177 | - KHttp.POST(url: HTTPServer.URL_OAUTH_TOKEN, parameters:["grant_type":"refresh_token" as AnyObject,"refresh_token":refresh_token as AnyObject], headers:["Authorization":"Basic "+authorization],completionHandler: completionHandler) | |
| 126 | + KHttp.POST(url: URL_OAUTH_TOKEN, parameters:["grant_type":"refresh_token" as AnyObject,"refresh_token":refresh_token as AnyObject], headers:["Authorization":"Basic "+authorization],completionHandler: completionHandler) | |
| 178 | 127 | } |
| 179 | 128 | //获取开屏广告URL |
| 180 | 129 | func getOpenAds(completionHandler:@escaping (String?, NSError?) -> ()){ |
| 181 | - KHttp.GET(url: HTTPServer.URL_GETOPENADS,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 130 | + KHttp.GET(url: URL_GETOPENADS,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 182 | 131 | } |
| 183 | 132 | //我的课程提醒 |
| 184 | 133 | func getMyLiveRemind(completionHandler:@escaping (String?, NSError?) -> ()){ |
| 185 | - KHttp.GET(url: HTTPServer.URL_USER_MYLIVEREMIND, headers:["Authorization":token!], completionHandler: completionHandler) | |
| 134 | + KHttp.GET(url: URL_USER_MYLIVEREMIND, headers:["Authorization":token!], completionHandler: completionHandler) | |
| 186 | 135 | } |
| 187 | 136 | //更新本地个人信息 |
| 188 | 137 | func uplocalUserInfo(completionHandler:@escaping (String?, NSError?) -> ()){ |
| 189 | - KHttp.GET(url: HTTPServer.URL_USER_USERINFO, headers:["Authorization":token!], completionHandler: completionHandler) | |
| 138 | + KHttp.GET(url: URL_USER_USERINFO, headers:["Authorization":token!], completionHandler: completionHandler) | |
| 190 | 139 | } |
| 191 | 140 | //修改密码 |
| 192 | 141 | func updatePassword(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ |
| 193 | - KHttp.POST(url: HTTPServer.URL_USER_UPDATEPASSWORD, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 142 | + KHttp.POST(url: URL_USER_UPDATEPASSWORD, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 194 | 143 | } |
| 195 | 144 | |
| 196 | 145 | |
| 197 | 146 | |
| 198 | 147 | //家长注册 |
| 199 | 148 | func parentRegister(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ |
| 200 | - KHttp.POST(url: HTTPServer.URL_PARENTREGISTER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 149 | + KHttp.POST(url: URL_PARENTREGISTER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 201 | 150 | } |
| 202 | 151 | //获取注册验证码 |
| 203 | 152 | func getCaptcha(_ mobile:String,completionHandler:@escaping (String?, NSError?) -> Void){ |
| 204 | - KHttp.GET(url: HTTPServer.URL_CAPTCHA,parameters:["mobile":mobile as AnyObject],headers:["Authorization":token!], completionHandler: completionHandler) | |
| 153 | + KHttp.GET(url: URL_CAPTCHA,parameters:["mobile":mobile as AnyObject],headers:["Authorization":token!], completionHandler: completionHandler) | |
| 205 | 154 | } |
| 206 | 155 | //找回密码 |
| 207 | 156 | func resetPassWord(_ mobile:String,pw:String?=nil,code:String,completionHandler:@escaping (String?, NSError?) -> Void){ |
| ... | ... | @@ -213,88 +162,95 @@ final class HTTPServer{ |
| 213 | 162 | } |
| 214 | 163 | //,headers:["Authorization":anonymousToken ?? ""] |
| 215 | 164 | |
| 216 | - KHttp.GET(url: HTTPServer.URL_RESTPW,parameters:p! as [String : AnyObject], completionHandler: completionHandler) | |
| 165 | + KHttp.GET(url: URL_RESTPW,parameters:p! as [String : AnyObject], completionHandler: completionHandler) | |
| 217 | 166 | } |
| 218 | 167 | //登录获取家长信息(包括关联的孩子信息区分绑定状态 |
| 219 | 168 | func getParentInfo(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 220 | - KHttp.POST(url: HTTPServer.URL_GETPARENTINFO,parameters:parameters, headers:["Authorization":token!], completionHandler: completionHandler) | |
| 169 | + KHttp.POST(url: URL_GETPARENTINFO,parameters:parameters, headers:["Authorization":token!], completionHandler: completionHandler) | |
| 221 | 170 | } |
| 222 | 171 | //更新姓名和性别 |
| 223 | 172 | func updateParentInfo(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ |
| 224 | - KHttp.POST(url: HTTPServer.URL_UPDATEPARENTINFO, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 173 | + KHttp.POST(url: URL_UPDATEPARENTINFO, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 225 | 174 | } |
| 226 | 175 | //获取我的短信包列表 |
| 227 | 176 | func getOrderList(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 228 | - KHttp.GET(url: HTTPServer.URL_GETORDERLIST,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 177 | + KHttp.GET(url: URL_GETORDERLIST,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 229 | 178 | } |
| 230 | 179 | //解绑孩子 |
| 231 | 180 | func getUnBindStudent(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 232 | - KHttp.GET(url: HTTPServer.URL_UNBINDSTUDENT,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 181 | + KHttp.GET(url: URL_UNBINDSTUDENT,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 233 | 182 | } |
| 234 | 183 | |
| 235 | 184 | //根据选择的市获取该地区的学校或者根据关键字搜索学校 |
| 236 | 185 | func getAreaSchool(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ |
| 237 | - // var urlStr = HTTPServer.URL_GETAREASCHOOL+"?AreaName=\(getPercentEncodingString(str: parameters["AreaName"]! as! String))" | |
| 186 | + // var urlStr = URL_GETAREASCHOOL+"?AreaName=\(getPercentEncodingString(str: parameters["AreaName"]! as! String))" | |
| 238 | 187 | // if let str = parameters["Keyword"]{ |
| 239 | 188 | // urlStr = urlStr + "&Keyword=\(getPercentEncodingString(str: str as! String))" |
| 240 | 189 | // } |
| 241 | 190 | |
| 242 | - KHttp.POST(url: HTTPServer.URL_GETAREASCHOOL, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 191 | + KHttp.POST(url: URL_GETAREASCHOOL, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 243 | 192 | } |
| 244 | 193 | |
| 245 | 194 | //获取该学校的年级或班级 |
| 246 | 195 | func getClassOrGrade(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 247 | - KHttp.GET(url: HTTPServer.URL_GETCLASSORGRADE,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 196 | + KHttp.GET(url: URL_GETCLASSORGRADE,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 248 | 197 | } |
| 249 | 198 | //MARK: ---- ParentService ----- |
| 250 | 199 | //获取工具入口和活动 |
| 251 | 200 | func getActivityTool(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 252 | - KHttp.GET(url: HTTPServer.URL_PARENTSERVICE_GETACTIVITYTOOL,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 201 | + KHttp.GET(url: URL_PARENTSERVICE_GETACTIVITYTOOL,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 253 | 202 | } |
| 254 | 203 | //绑定孩子信息(合作学校绑定返回null,非合作学校返回“汇作业”账号和密码) |
| 255 | 204 | func bindlingChildren(parameters: [String : AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 256 | - KHttp.POST(url: HTTPServer.URL_BINDLINGCHILDREN, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 205 | + KHttp.POST(url: URL_BINDLINGCHILDREN, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 257 | 206 | } |
| 258 | 207 | |
| 259 | 208 | |
| 260 | 209 | //获取频道资讯 |
| 261 | 210 | func getChannelInfo(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 262 | - KHttp.POST(url: HTTPServer.URL_PARENTSERVICE_GETCHANNELINFO,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 211 | + KHttp.POST(url: URL_PARENTSERVICE_GETCHANNELINFO,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 263 | 212 | } |
| 264 | 213 | |
| 265 | 214 | //获取首页资讯话题/搜索资讯 |
| 266 | 215 | func getInformationTopic(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 267 | - KHttp.POST(url: HTTPServer.URL_PARENTSERVICE_GETINFORMATIONTOPIC,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 216 | + KHttp.POST(url: URL_PARENTSERVICE_GETINFORMATIONTOPIC,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 268 | 217 | } |
| 269 | 218 | |
| 270 | 219 | //获取订购的报告或科目 |
| 271 | 220 | func getOrderSubject(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 272 | - KHttp.GET(url: HTTPServer.URL_PARENTSERVICE_GETORDERSUBJECT,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 221 | + KHttp.GET(url: URL_PARENTSERVICE_GETORDERSUBJECT,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 273 | 222 | } |
| 274 | 223 | |
| 275 | 224 | //获取报告列表 |
| 276 | 225 | func workReport(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ |
| 277 | - KHttp.POST(url: HTTPServer.URL_PARENTSERVICE_WORKREPORT, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 226 | + KHttp.POST(url: URL_PARENTSERVICE_WORKREPORT, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 278 | 227 | } |
| 279 | - | |
| 228 | + //MARK: - 量规评价 | |
| 280 | 229 | //获取报告详情 |
| 281 | 230 | func workReportDetails(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ |
| 282 | - KHttp.POST(url: HTTPServer.URL_PARENTSERVICE_WORKREPORTDETAILS, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 231 | + KHttp.POST(url: URL_PARENTSERVICE_WORKREPORTDETAILS, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 232 | + } | |
| 233 | + //获取德育报告-总体详情 | |
| 234 | + func getEvaluationSceneAnalysis(parameters:[String:AnyObject]?,completionHandler:@escaping (String?,NSError?)->()){ | |
| 235 | + KHttp.POST(url: URL_POST_EVALUATION_ANALYSIS, parameters: parameters, headers: ["Authorization":token!], completionHandler: completionHandler) | |
| 236 | + } | |
| 237 | + //获取德育报告-场景详情 | |
| 238 | + func getEvaluationSceneAnalysisDetails(parameters:[String:AnyObject]?,completionHandler:@escaping (String?,NSError?)->()){ | |
| 239 | + KHttp.POST(url: URL_POST_EVALUATION_ANALYSIS_DETAILS, parameters: parameters, headers: ["Authorization":token!], completionHandler: completionHandler) | |
| 283 | 240 | } |
| 284 | - | |
| 285 | 241 | //订购信息 |
| 286 | 242 | func orderCenter(parameters: [String : AnyObject]?,completionHandler:@escaping (String?, NSError?) -> ()){ |
| 287 | - KHttp.POST(url: HTTPServer.URL_PARENTSERVICE_ORDERCENTER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 243 | + KHttp.POST(url: URL_PARENTSERVICE_ORDERCENTER, parameters: parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 288 | 244 | } |
| 289 | 245 | |
| 290 | 246 | //查看订购详情 |
| 291 | 247 | func orderServiceDetails(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 292 | - KHttp.GET(url: HTTPServer.URL_PARENTSERVICE_ORDERSERVICEDETAILS,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 248 | + KHttp.GET(url: URL_PARENTSERVICE_ORDERSERVICEDETAILS,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 293 | 249 | } |
| 294 | 250 | |
| 295 | 251 | //获取广告位信息 |
| 296 | 252 | func getAds(_ parameters:[String:AnyObject],completionHandler:@escaping (String?, NSError?) -> ()){ |
| 297 | - KHttp.GET(url: HTTPServer.URL_PARENTSERVICE_GETADS,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 253 | + KHttp.GET(url: URL_PARENTSERVICE_GETADS,parameters:parameters,headers:["Authorization":token!], completionHandler: completionHandler) | |
| 298 | 254 | } |
| 299 | 255 | |
| 300 | 256 | ... | ... |