import 'package:huixiang/data/author.dart'; import 'package:json_annotation/json_annotation.dart'; part 'course.g.dart'; @JsonSerializable(explicitToJson: true) 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); }