@@ -16,18 +16,50 @@ class MaumLogResponse {
1616 }
1717}
1818
19+ class User {
20+ final String uuid;
21+ final String email;
22+ final String name;
23+ final bool isParent;
24+ final int profileImageId;
25+ final String createdAt;
26+ final String updatedAt;
27+
28+ User ({
29+ required this .uuid,
30+ required this .email,
31+ required this .name,
32+ required this .isParent,
33+ required this .profileImageId,
34+ required this .createdAt,
35+ required this .updatedAt,
36+ });
37+
38+ factory User .fromJson (Map <String , dynamic > json) {
39+ return User (
40+ uuid: json['uuid' ] ?? '' ,
41+ email: json['email' ] ?? '' ,
42+ name: json['name' ] ?? '' ,
43+ isParent: json['isParent' ] ?? false ,
44+ profileImageId: json['profileImageId' ] ?? 0 ,
45+ createdAt: json['createdAt' ] ?? '' ,
46+ updatedAt: json['updatedAt' ] ?? '' ,
47+ );
48+ }
49+ }
50+
1951class MaumLogDto {
2052 final String frontPresignedUrl;
2153 final String backPresignedUrl;
22- final String comment;
54+ final String ? comment;
2355 final String location;
2456 final List <String > emotions;
25- final String uploader;
57+ final User uploader;
2658
2759 MaumLogDto ({
2860 required this .frontPresignedUrl,
2961 required this .backPresignedUrl,
30- required this .comment,
62+ this .comment,
3163 required this .location,
3264 required this .emotions,
3365 required this .uploader,
@@ -38,10 +70,10 @@ class MaumLogDto {
3870 return MaumLogDto (
3971 frontPresignedUrl: json['frontPresignedUrl' ] ?? '' ,
4072 backPresignedUrl: json['backPresignedUrl' ] ?? '' ,
41- comment: json['comment' ] ?? '' ,
73+ comment: json['comment' ],
4274 location: json['location' ] ?? '' ,
4375 emotions: emotionsList.map ((e) => e.toString ()).toList (),
44- uploader: json['uploader' ] ?? '' ,
76+ uploader: User . fromJson ( json['uploader' ] ?? {}) ,
4577 );
4678 }
4779
0 commit comments