pod 'HHPGNetWork'
PGSpiManager.config.setConfig(baseUrls: ["https://api.apiopen.top"],
result_key: PGSpiRegKey(code: "code",
msg: "message",
data: "data1",
success: 200))
_ = PGSpi(Common.getAllRegion).rxSend().mapSpiObjects(to: AppInfo.self).subscribe(onSuccess: { (value) in
print(value.count)
print(value[0].toJSONString())
}) { (error) in
print(error.localizedDescription)
}.disposed(by: disposeBag)
PGSpi(Common.getAllRegion).send { (response) in
switch response.result {
case .success(let value):
do {
let repos = try value.mapJSON()
} catch(let error) {
print(error.localizedDescription)
}
case .failure(let error):
print(error.handle().message)
}
}
本项目基于 MIT 协议,请自由地享受和参与开源。