123456789101112131415161718192021222324252627 |
- class BaseModel {
- int id = 0;
- }
- class BaseEntity {
- ///状态码 0:成功 其他异常
- int code = 0;
- /// 提示信息
- String msg = "";
- /// 数据
- BaseModel? data;
- BaseEntity({required this.code, required this.msg, this.data});
- BaseEntity.fromJson(Map<String, dynamic> json) {
- code = json['code'];
- msg = json['msg'];
- data = json['data'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['code'] = code;
- data['msg'] = msg;
- data['data'] = this.data;
- return data;
- }
- }
|