提交 5aa4ad33 authored 作者: yueweilu's avatar yueweilu

学习报告接口

上级 b3d86fd9
......@@ -125,5 +125,20 @@ abstract class LibraryAPI {
return BookDetailModel.fromJson(result.data);
}
/// 6、学习报告
///
static Future <ReportModel> report({
required String bookId
}) async {
final result = await HttpService.to.post(
'/v1/members/Information/myStudyReport',
params: {
'book_id':bookId
},
);
if (result.data is! Map) return ReportModel();
return ReportModel.fromJson(result.data);
}
}
\ No newline at end of file
......@@ -349,6 +349,7 @@ class BookDetailModel {
}
/// 删选模型
class FilterModel {
FilterModel({
this.id,
......@@ -362,4 +363,102 @@ class FilterModel {
}
/// 学习报告模型
class ReportModel {
ReportModel({
this.bookName,
this.authors,
this.img,
this.progress,
this.readSecond,
this.maxSecond,
this.lastChapter,
this.commentPostNums,
this.commentReplyNums,
this.lineNums,
this.colorNums,
this.noteNums,
this.questionAllNums,
this.questionAccuracy,});
ReportModel.fromJson(dynamic json) {
bookName = json['book_name'];
authors = json['authors'];
img = json['img'];
progress = json['progress'];
readSecond = json['read_second'];
maxSecond = json['max_second'];
lastChapter = json['last_chapter'];
commentPostNums = json['comment_post_nums'];
commentReplyNums = json['comment_reply_nums'];
lineNums = json['line_nums'];
colorNums = json['color_nums'];
noteNums = json['note_nums'];
questionAllNums = json['question_all_nums'];
questionAccuracy = json['question_accuracy'];
}
String? bookName;
String? authors;
String? img;
String? progress;
String? readSecond;
num? maxSecond;
String? lastChapter;
num? commentPostNums;
num? commentReplyNums;
num? lineNums;
num? colorNums;
num? noteNums;
num? questionAllNums;
String? questionAccuracy;
ReportModel copyWith({ String? bookName,
String? authors,
String? img,
String? progress,
String? readSecond,
num? maxSecond,
String? lastChapter,
num? commentPostNums,
num? commentReplyNums,
num? lineNums,
num? colorNums,
num? noteNums,
num? questionAllNums,
String? questionAccuracy,
}) => ReportModel( bookName: bookName ?? this.bookName,
authors: authors ?? this.authors,
img: img ?? this.img,
progress: progress ?? this.progress,
readSecond: readSecond ?? this.readSecond,
maxSecond: maxSecond ?? this.maxSecond,
lastChapter: lastChapter ?? this.lastChapter,
commentPostNums: commentPostNums ?? this.commentPostNums,
commentReplyNums: commentReplyNums ?? this.commentReplyNums,
lineNums: lineNums ?? this.lineNums,
colorNums: colorNums ?? this.colorNums,
noteNums: noteNums ?? this.noteNums,
questionAllNums: questionAllNums ?? this.questionAllNums,
questionAccuracy: questionAccuracy ?? this.questionAccuracy,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['book_name'] = bookName;
map['authors'] = authors;
map['img'] = img;
map['progress'] = progress;
map['read_second'] = readSecond;
map['max_second'] = maxSecond;
map['last_chapter'] = lastChapter;
map['comment_post_nums'] = commentPostNums;
map['comment_reply_nums'] = commentReplyNums;
map['line_nums'] = lineNums;
map['color_nums'] = colorNums;
map['note_nums'] = noteNums;
map['question_all_nums'] = questionAllNums;
map['question_accuracy'] = questionAccuracy;
return map;
}
}
......@@ -10,6 +10,8 @@ class BuildCard extends StatelessWidget {
Container(
child: Image.asset(
'assets/images/report_bg.png',
width: double.infinity,
fit: BoxFit.contain,
),
),
Positioned(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论