From 916fc97fe64ed908963c0aa87a61994d240ac452 Mon Sep 17 00:00:00 2001 From: gme_2 Date: Tue, 19 Mar 2019 09:32:45 +0900 Subject: [PATCH] added api --- .../Service/ResendServiceType.swift | 21 +++++++++++++++++++ .../View/ResendViewController.swift | 16 ++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift b/GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift index 27566470..3f577b0b 100644 --- a/GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift +++ b/GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift @@ -7,7 +7,28 @@ // import Foundation +import Alamofire protocol ResendServiceType: class { } + + +protocol FetchResendTransactionList: ApiServiceType { + func fetch() +} + + +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) + }) { (error) in + print(error.localizedDescription) + } + } +} + diff --git a/GMERemittance/Module/Resend/User Interface/View/ResendViewController.swift b/GMERemittance/Module/Resend/User Interface/View/ResendViewController.swift index e6e07088..b1a2b60b 100644 --- a/GMERemittance/Module/Resend/User Interface/View/ResendViewController.swift +++ b/GMERemittance/Module/Resend/User Interface/View/ResendViewController.swift @@ -33,6 +33,17 @@ class ResendViewController: UIViewController { self.setup() } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationItem.title = "Resend" + self.fetch() + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + self.navigationItem.title = "" + } // MARK: IBActions // MARK: Other Functions @@ -116,3 +127,8 @@ extension ResendViewController { } } + + +extension ResendViewController: FetchResendTransactionList { + +}