123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // IHPanelService.swift
- // Inhealth
- //
- // Created by weclouds on 2020/7/28.
- // Copyright © 2020 weclouds. All rights reserved.
- //
- import UIKit
- class IHPanelService: NSObject {
- //单例
- static let share = IHPanelService()
-
- let username = AppShare.username
- let client_key = AppShare.client_key
- let os = AppShare.os
- let token = AppShare.token
- let version = AppShare.version
-
- //获取窗帘的数据
- func getSchoolPanelModel(id: String, complete:@escaping( _ panelModel_info : PanelModel_info?) -> Void) {
- net_school_get_panel_mode(username: self.username, client_key: self.client_key, os: self.os, version: self.version, token: self.token, id: id, success: { (json) -> (Void) in
-
- let panelModeInfo = PanelModel_info.fromJSON(json)
- complete(panelModeInfo)
-
- }) { () -> (Void) in
-
- }
- }
-
-
- //设置窗帘的数据
- func setSchoolPanelModel(id: String, key1: String, key2: String, key3: String, key4: String, key5: String, key6: String,compelete:@escaping (_ respone: String?, _ code : String?) -> Void) {
- IHWebSocketManager.shareInstance().schoolDeviceOpation(isSchool: true) { (isSuccess, responeStr,code) in
- if isSuccess == 2 {
- log.debug("websocket面板返回的数据")
- compelete(responeStr, code)
-
- }else{
- net_school_set_panel_mode(username: self.username, client_key: self.client_key, os: self.os, version: self.version, token: self.token, id: id, key1: key1, key2: key2, key3: key3, key4: key4, key5: key5, key6: key6, clientId: responeStr, success: { (json) -> (Void) in
-
- }) { () -> (Void) in
-
- }
- }
- }
-
- }
- }
|