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.

61 lines
1.6 KiB

6 years ago
6 years ago
6 years ago
6 years ago
  1. //
  2. // MessageComposeInteractor.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 02/10/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class MessageComposeInteractor {
  10. // MARK: Properties
  11. weak var output: MessageComposeInteractorOutput?
  12. private let service: MessageComposeServiceType
  13. // MARK: Initialization
  14. init(service: MessageComposeServiceType) {
  15. self.service = service
  16. }
  17. // MARK: Converting entities
  18. }
  19. // MARK: MessageCompose interactor input interface
  20. extension MessageComposeInteractor: MessageComposeInteractorInput {
  21. func cancel(control: String, transId: String, subject: String, body: String) {
  22. let param = [
  23. "controlNo" : control,
  24. "tranId" : transId,
  25. "body": body,
  26. "subject": subject,
  27. "UserId": Utility.getMyUserName()
  28. ]
  29. self.service.cancelTransactionRequest(param: param, success: { (message) in
  30. self.output?.show(model: message)
  31. }) { (error) in
  32. self.output?.show(error: error)
  33. }
  34. }
  35. func edit(control: String, transId: String, subject: String, body: String) {
  36. let param = [
  37. "controlNo" : control,
  38. "tranId" : transId,
  39. "body": body,
  40. "subject": subject,
  41. "UserId": Utility.getMyUserName()
  42. ]
  43. self.service.editTransactionRequest(param: param, success: { (message) in
  44. self.output?.show(model: message)
  45. }) { (error) in
  46. self.output?.show(error: error)
  47. }
  48. }
  49. }