29 lines
993 B
Dart
29 lines
993 B
Dart
/*
|
|
* @Author: wangyang 1147192855@qq.com
|
|
* @Date: 2022-07-18 17:44:15
|
|
* @LastEditors: wangyang 1147192855@qq.com
|
|
* @LastEditTime: 2022-07-19 16:19:15
|
|
* @FilePath: \marking_app\lib\common\model\common\base_page.dart
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'base_page_data.g.dart';
|
|
|
|
@JsonSerializable(genericArgumentFactories: true, fieldRename: FieldRename.snake)
|
|
class BasePageData<T> extends Object {
|
|
@JsonKey(name: 'items')
|
|
List<T> items;
|
|
|
|
@JsonKey(name: 'totalCount')
|
|
int total;
|
|
|
|
BasePageData(
|
|
this.items,
|
|
this.total,
|
|
);
|
|
|
|
factory BasePageData.fromJson(Map<String, dynamic> json, T Function(dynamic json) fromJsonT) => _$BasePageDataFromJson(json, fromJsonT);
|
|
Map<String, dynamic> toJson(Object Function(T value) toJsonT) => _$BasePageDataToJson(this, toJsonT);
|
|
}
|