Commit d203bcfb authored by David黄金龙's avatar David黄金龙

旅行证件准备 接口

parent 87502c67
......@@ -50,7 +50,7 @@ extension YHTravelDocsPreparationViewModel {
//获取旅行证件详情
func getTravelDocsDetailInfo(param : [String:Any],callBackBlock:@escaping (_ success: Bool,_ err:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.TravelDocsPreparation.getTravelDocsListApi
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.TravelDocsPreparation.getTravelDocsDetailApi
let _ = YHNetRequest.getRequest(url: strUrl,params:param) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
......@@ -78,4 +78,27 @@ extension YHTravelDocsPreparationViewModel {
}
}
//保存旅行证件
func saveTravelDocsInfo(params: [String: Any], callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.TravelDocsPreparation.saveTravelDocsInfoApi
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else {
callBackBlock(false,nil)
return
}
if json.code == 200 {
callBackBlock(true,nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment