Browse Source

resend lit api added

pull/1/head
gme_2 6 years ago
parent
commit
89a23f21ca
  1. 26
      GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift

26
GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift

@ -14,20 +14,24 @@ protocol ResendServiceType: class {
} }
protocol FetchResendTransactionList: ApiServiceType {
func fetch()
protocol FetchResendService: ApiServiceType {
func fetchResendService(user: String, param: [String: String]?, success: @escaping (([ResendListModel]) -> ()), failure: @escaping ((Error) -> ()))
} }
extension FetchResendTransactionList {
func fetch() {
// http://localhost:9500/api/v1/resend/list
let url = baseUrl + "v1/resend/list"
auth.request(method: .post, url: url, params: nil, success: { (response: SuccessMessageContainer) in
print(response)
extension FetchResendService {
func fetchResendService(user: String, param: [String: String]?, success: @escaping (([ResendListModel]) -> ()), failure: @escaping ((Error) -> ())) {
let url = oldBaseUrl + "v1/resend/list" + "\(user)"
self.auth.request(method: .post, url: url, params: param, success: { (response: ResendListModelContainer) in
if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
failure(error)
}else {
let model = response.data
success(model ?? [])
}
}) { (error) in }) { (error) in
print(error.localizedDescription)
failure(error)
} }
} }
} }

Loading…
Cancel
Save