IHPersonalCenterService.swift 983 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // IHPersonalCenterService.swift
  3. // Inhealth
  4. //
  5. // Created by weclouds on 2019/12/24.
  6. // Copyright © 2019 weclouds. All rights reserved.
  7. //
  8. import UIKit
  9. import SwiftyJSON
  10. class IHPersonalCenterService: NSObject {
  11. static let share = IHPersonalCenterService()
  12. func getRoomCount(requestSuccess:((String)->Void)?,requestFail:@escaping (()->Void)){
  13. let username = AppShare.username
  14. let token = AppShare.token
  15. let os = AppShare.os
  16. let version = AppShare.version
  17. let client_key = AppShare.client_key
  18. g_app_get_room_countHttpRequest(username, client_key: client_key, os: os, version: version, token: token, success: { (json) -> (Void) in
  19. let mRoomCountInfo = RoomCount_Info.fromJSON(json)
  20. let result = mRoomCountInfo?.result
  21. if let count = result?.count{
  22. requestSuccess!(count)
  23. }
  24. }) { () -> (Void) in
  25. requestFail()
  26. }
  27. }
  28. }