42 lines
785 B
Dart
42 lines
785 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'base_api_models.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class ServiceBase<T> {
|
|
String? msg;
|
|
int? code;
|
|
dynamic data;
|
|
|
|
ServiceBase({
|
|
this.msg,
|
|
this.code,
|
|
this.data,
|
|
});
|
|
|
|
factory ServiceBase.fromJson(Map<String, dynamic> json) =>
|
|
_$ServiceBaseFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$ServiceBaseToJson(this);
|
|
}
|
|
|
|
@JsonSerializable()
|
|
class ServicePageBase {
|
|
int current;
|
|
int pages;
|
|
int size;
|
|
int total;
|
|
|
|
ServicePageBase({
|
|
this.current = 1,
|
|
this.pages = 1,
|
|
this.size = 10,
|
|
this.total = 0,
|
|
});
|
|
|
|
factory ServicePageBase.fromJson(Map<String, dynamic> json) =>
|
|
_$ServicePageBaseFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$ServicePageBaseToJson(this);
|
|
}
|