base_model.dart 496 B

12345678910111213141516171819202122
  1. class BaseModel {
  2. int id = 0;
  3. }
  4. class BaseEntity {
  5. int code = 0;
  6. String msg = "";
  7. BaseModel? data;
  8. BaseEntity({required this.code, required this.msg, this.data});
  9. BaseEntity.fromJson(Map<String, dynamic> json) {
  10. code = json['code'];
  11. msg = json['msg'];
  12. data = json['data'];
  13. }
  14. Map<String, dynamic> toJson() {
  15. final Map<String, dynamic> data = <String, dynamic>{};
  16. data['code'] = code;
  17. data['msg'] = msg;
  18. data['data'] = this.data;
  19. return data;
  20. }
  21. }