You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
//
|
|
// RewardService.swift
|
|
// GME Remit
|
|
//
|
|
// Created by InKwon Devik Kim on 11/04/2019.
|
|
//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class RewardService: RewardServiceType {
|
|
|
|
// MARK: Properties
|
|
|
|
// MARK: Initialization
|
|
|
|
// MARK: Data management
|
|
|
|
// /api/v2/reward/productList
|
|
func fetchProductList(
|
|
success: @escaping ([RewardProduct]?) -> (),
|
|
failure: @escaping (Error) -> ()
|
|
) {
|
|
// let url = baseUrl + "/reward/productList"
|
|
// let url = "http://gmeuat.gmeremit.com:5018/api/v2/reward/productList"
|
|
let url = baseUrlWithoutVersion + "/v2/reward/productList"
|
|
|
|
auth.request(method: .post, url: url, params: nil, success: { (response: RewardProductContainer) in
|
|
if (response.errorCode ?? "") == "1" {
|
|
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.msg ?? ""])
|
|
failure(error)
|
|
}else {
|
|
let model = response.data
|
|
success(model)
|
|
}
|
|
}) { (error) in
|
|
failure(error)
|
|
}
|
|
}
|
|
}
|