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.

41 lines
821 B

  1. //
  2. // CouponBoxInteractor.swift
  3. // GME Remit
  4. //
  5. // Created by Jeongbae Kong on 03/12/2019.
  6. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class CouponBoxInteractor {
  10. // MARK: Properties
  11. weak var output: CouponBoxInteractorOutput?
  12. private let service: CouponBoxServiceType
  13. // MARK: Initialization
  14. init(service: CouponBoxServiceType) {
  15. self.service = service
  16. }
  17. }
  18. // MARK: CouponBox interactor input interface
  19. extension CouponBoxInteractor: CouponBoxInteractorInput {
  20. func fetchCouponBox() {
  21. service.fetchCouponBox(
  22. success: {
  23. self.output?.setModel(with: $0)
  24. },
  25. failure: {[weak self] in
  26. guard let `self` = self else {
  27. return
  28. }
  29. self.output?.setError(with: $0)
  30. }
  31. )
  32. }
  33. }