newsfeed_detail_entity.dart 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/newsfeed_detail_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/newsfeed_detail_entity.g.dart';
  5. @JsonSerializable()
  6. class NewsfeedDetailEntity {
  7. int? id;
  8. String? content;
  9. List<String>? resources;
  10. int? clicks;
  11. int? share;
  12. @JSONField(name: "created_at")
  13. String? createdAt;
  14. @JSONField(name: "likes_count")
  15. int? likesCount;
  16. @JSONField(name: "comments_count")
  17. int? commentsCount;
  18. bool? liked;
  19. NewsfeedDetailAccount? account;
  20. List<NewsfeedDetailComments>? comments;
  21. NewsfeedDetailEntity();
  22. factory NewsfeedDetailEntity.fromJson(Map<String, dynamic> json) => $NewsfeedDetailEntityFromJson(json);
  23. Map<String, dynamic> toJson() => $NewsfeedDetailEntityToJson(this);
  24. @override
  25. String toString() {
  26. return jsonEncode(this);
  27. }
  28. }
  29. @JsonSerializable()
  30. class NewsfeedDetailAccount {
  31. int? id;
  32. String? name;
  33. String? avatar;
  34. bool? followed;
  35. NewsfeedDetailAccount();
  36. factory NewsfeedDetailAccount.fromJson(Map<String, dynamic> json) => $NewsfeedDetailAccountFromJson(json);
  37. Map<String, dynamic> toJson() => $NewsfeedDetailAccountToJson(this);
  38. @override
  39. String toString() {
  40. return jsonEncode(this);
  41. }
  42. }
  43. @JsonSerializable()
  44. class NewsfeedDetailComments {
  45. int? id;
  46. String? content;
  47. @JSONField(name: "created_at")
  48. String? createdAt;
  49. NewsfeedDetailCommentsAccount? account;
  50. @JSONField(name: "to_account")
  51. NewsfeedDetailCommentsToAccount? toAccount;
  52. NewsfeedDetailComments();
  53. factory NewsfeedDetailComments.fromJson(Map<String, dynamic> json) => $NewsfeedDetailCommentsFromJson(json);
  54. Map<String, dynamic> toJson() => $NewsfeedDetailCommentsToJson(this);
  55. @override
  56. String toString() {
  57. return jsonEncode(this);
  58. }
  59. }
  60. @JsonSerializable()
  61. class NewsfeedDetailCommentsAccount {
  62. int? id;
  63. String? name;
  64. String? avatar;
  65. NewsfeedDetailCommentsAccount();
  66. factory NewsfeedDetailCommentsAccount.fromJson(Map<String, dynamic> json) => $NewsfeedDetailCommentsAccountFromJson(json);
  67. Map<String, dynamic> toJson() => $NewsfeedDetailCommentsAccountToJson(this);
  68. @override
  69. String toString() {
  70. return jsonEncode(this);
  71. }
  72. }
  73. @JsonSerializable()
  74. class NewsfeedDetailCommentsToAccount {
  75. int? id;
  76. String? name;
  77. String? avatar;
  78. NewsfeedDetailCommentsToAccount();
  79. factory NewsfeedDetailCommentsToAccount.fromJson(Map<String, dynamic> json) => $NewsfeedDetailCommentsToAccountFromJson(json);
  80. Map<String, dynamic> toJson() => $NewsfeedDetailCommentsToAccountToJson(this);
  81. @override
  82. String toString() {
  83. return jsonEncode(this);
  84. }
  85. }