import 'package:huixiang/data/author.dart'; import 'package:huixiang/generated/json/base/json_field.dart'; import 'package:huixiang/generated/json/course.g.dart'; import 'dart:convert'; export 'package:huixiang/generated/json/course.g.dart'; @JsonSerializable() class Course { String? id = ''; String? createTime = ''; String? createUser = ''; String? updateTime = ''; String? updateUser = ''; String? categoryId = ''; String? subject = ''; List? tags = []; String? coverImg = ''; Author? author; String? introduce = ''; int? viewers = 0; int? likes = 0; bool? state = false; int? isDelete = 0; Course(); factory Course.fromJson(Map json) => $CourseFromJson(json); Map toJson() => $CourseToJson(this); @override String toString() { return jsonEncode(this); } }