BaResponData({spCode, spDesc, this.attribute, this.data});
@override冰封之心
String toString() {
return 'BaRespData{code: $respCode, message: $respDesc, data: $attribute}'; }
}
class ResponData extends BaResponData {
@override
bool get success => respCode != null || data != null;
ResponData.fromJson(Map<String, dynamic> json) {
if (json['respCode'] != null && json['respCode'] is String) {
json['respCode'] = int.par(json['respCode']);
}
老人与海主要内容
respCode = json['respCode'] ?? json['code'];
respDesc = json['respDesc'] ?? json['message'] ?? json['msg'];
attribute = json['attribute'] ?? json["data"];
if (attribute != null) {
if (attribute is Map && ainsKey("data")) {
data = attribute['data'];
} el {
data = attribute;
打开微信时需要密码怎么设置}
} el {
data = json;
}
}
}
class ResponError extends BaResponData {
ResponError.fromJson(Map<String, dynamic> json) {
respDesc = json["respDesc"];
respCode = json["respCode"];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = {};
三倍工资
data["respDesc"] = respDesc;
次弟花开data["respCode"] = respCode;
return data;
兔子猫
}
@override
// TODO: implement success
bool get success => fal;
}
class ResponException implements Exception {
int? errCode;
鳄雀鳝图片String? errMsg;
ResponException({Code});
int? get errorCode => errCode;
//statusCode==200时候返回的data中存在的respCode
String? get errorMessage {
String msg = errMsg ?? "";
switch (errCode) {
default:
}
return msg;
}
@override
String toString() {
访问googlereturn 'RequestException{errorCode: $errorCode, errorMessage: $errorMessage}'; }
}