newsfeed_comment_publish_entity.g.dart 1.4 KB

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