feat:增加博客卡片内容

This commit is contained in:
2025-11-14 23:22:01 +08:00
parent 94849be69c
commit 3b167508dd
18 changed files with 815 additions and 339 deletions

37
lib/models/common.dart Normal file
View File

@@ -0,0 +1,37 @@
import 'package:json_annotation/json_annotation.dart';
part 'common.g.dart';
@JsonSerializable(genericArgumentFactories: true)
class PageResult<T> {
@JsonKey(name: 'records')
final List<T> records;
@JsonKey(name: 'total')
final int total;
@JsonKey(name: 'size')
final int size;
@JsonKey(name: 'current')
final int current;
@JsonKey(name: 'pages')
final int pages;
const PageResult({
required this.records,
required this.total,
required this.size,
required this.current,
required this.pages,
});
factory PageResult.fromJson(
Map<String, dynamic> json,
T Function(Object? json) fromJsonT,
) => _$PageResultFromJson(json, fromJsonT);
Map<String, dynamic> toJson(Object? Function(T value) toJsonT) =>
_$PageResultToJson(this, toJsonT);
}