newsfeed_comment_publish_entity.g.dart 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
  3. NewsfeedCommentPublishEntity $NewsfeedCommentPublishEntityFromJson(
  4. Map<String, dynamic> json) {
  5. final NewsfeedCommentPublishEntity newsfeedCommentPublishEntity = NewsfeedCommentPublishEntity();
  6. final int? id = jsonConvert.convert<int>(json['id']);
  7. if (id != null) {
  8. newsfeedCommentPublishEntity.id = id;
  9. }
  10. final String? content = jsonConvert.convert<String>(json['content']);
  11. if (content != null) {
  12. newsfeedCommentPublishEntity.content = content;
  13. }
  14. final int? toUserId = jsonConvert.convert<int>(json['to_user_id']);
  15. if (toUserId != null) {
  16. newsfeedCommentPublishEntity.toUserId = toUserId;
  17. }
  18. return newsfeedCommentPublishEntity;
  19. }
  20. Map<String, dynamic> $NewsfeedCommentPublishEntityToJson(
  21. NewsfeedCommentPublishEntity entity) {
  22. final Map<String, dynamic> data = <String, dynamic>{};
  23. data['id'] = entity.id;
  24. data['content'] = entity.content;
  25. data['to_user_id'] = entity.toUserId;
  26. return data;
  27. }
  28. extension NewsfeedCommentPublishEntityExtension on NewsfeedCommentPublishEntity {
  29. NewsfeedCommentPublishEntity copyWith({
  30. int? id,
  31. String? content,
  32. int? toUserId,
  33. }) {
  34. return NewsfeedCommentPublishEntity()
  35. ..id = id ?? this.id
  36. ..content = content ?? this.content
  37. ..toUserId = toUserId ?? this.toUserId;
  38. }
  39. }