opt models

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-04 15:20:35 +08:00
parent f50b1d2beb
commit b960359a39
858 changed files with 11000 additions and 12588 deletions

View File

@@ -0,0 +1,44 @@
import 'package:PiliPlus/models/model_avatar.dart';
class Author {
int? mid;
String? name;
String? face;
int? level;
int? isSeniorMember;
Vip? vipInfo;
Pendant? pendant;
BaseOfficialVerify? official;
int? follower;
Author({
this.mid,
this.name,
this.face,
this.level,
this.isSeniorMember,
this.vipInfo,
this.pendant,
this.official,
this.follower,
});
factory Author.fromJson(Map<String, dynamic> json) => Author(
mid: json['mid'] as int?,
name: json['name'] as String?,
face: json['face'] as String?,
level: json['level'] as int?,
isSeniorMember: json['is_senior_member'] as int?,
vipInfo: json['vip_info'] == null
? null
: Vip.fromJson(json['vip_info'] as Map<String, dynamic>),
pendant: json['pendant'] == null
? null
: Pendant.fromJson(json['pendant'] as Map<String, dynamic>),
official: json['official'] == null
? null
: BaseOfficialVerify.fromJson(
json['official'] as Map<String, dynamic>),
follower: json['follower'] as int?,
);
}

View File

@@ -0,0 +1,22 @@
import 'package:PiliPlus/models_new/video/video_note_list/list.dart';
import 'package:PiliPlus/models_new/video/video_note_list/page.dart';
class VideoNoteData {
List<VideoNoteItemModel>? list;
Page? page;
bool? showPublicNote;
String? message;
VideoNoteData({this.list, this.page, this.showPublicNote, this.message});
factory VideoNoteData.fromJson(Map<String, dynamic> json) => VideoNoteData(
list: (json['list'] as List<dynamic>?)
?.map((e) => VideoNoteItemModel.fromJson(e as Map<String, dynamic>))
.toList(),
page: json['page'] == null
? null
: Page.fromJson(json['page'] as Map<String, dynamic>),
showPublicNote: json['show_public_note'] as bool?,
message: json['message'] as String?,
);
}

View File

@@ -0,0 +1,40 @@
import 'package:PiliPlus/models_new/video/video_note_list/author.dart';
class VideoNoteItemModel {
int? cvid;
String? title;
String? summary;
String? pubtime;
String? webUrl;
String? message;
Author? author;
int? likes;
bool? hasLike;
VideoNoteItemModel({
this.cvid,
this.title,
this.summary,
this.pubtime,
this.webUrl,
this.message,
this.author,
this.likes,
this.hasLike,
});
factory VideoNoteItemModel.fromJson(Map<String, dynamic> json) =>
VideoNoteItemModel(
cvid: json['cvid'] as int?,
title: json['title'] as String?,
summary: json['summary'] as String?,
pubtime: json['pubtime'] as String?,
webUrl: json['web_url'] as String?,
message: json['message'] as String?,
author: json['author'] == null
? null
: Author.fromJson(json['author'] as Map<String, dynamic>),
likes: json['likes'] as int?,
hasLike: json['has_like'] as bool?,
);
}

View File

@@ -0,0 +1,13 @@
class Page {
int? total;
int? size;
int? num;
Page({this.total, this.size, this.num});
factory Page.fromJson(Map<String, dynamic> json) => Page(
total: json['total'] as int?,
size: json['size'] as int?,
num: json['num'] as int?,
);
}