File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1111User Database::serializeFromDto (const UserDto::ObjectWrapper& userDto){
1212 User user;
1313 if (userDto->id ){
14- user.id = userDto->id -> getValue () ;
14+ user.id = * userDto->id ;
1515 }
1616 user.firstName = userDto->firstName ;
1717 user.lastName = userDto->lastName ;
18- userDto->friends ->forEach ([&user](const oatpp::String& friendId){
19- user.friends .push_back (friendId);
20- });
18+
19+ for (auto & id : *userDto->friends ) {
20+ user.friends .push_back (id);
21+ }
2122 return user;
2223}
2324
@@ -28,7 +29,7 @@ UserDto::ObjectWrapper Database::deserializeToDto(const User& user){
2829 dto->lastName = user.lastName ;
2930 auto it = user.friends .begin ();
3031 while (it != user.friends .end ()) {
31- dto->friends ->pushBack (*it++);
32+ dto->friends ->push_back (*it++);
3233 }
3334 return dto;
3435}
@@ -70,7 +71,7 @@ oatpp::data::mapping::type::List<UserDto::ObjectWrapper>::ObjectWrapper Database
7071 auto result = oatpp::data::mapping::type::List<UserDto::ObjectWrapper>::createShared ();
7172 auto it = m_usersById.begin ();
7273 while (it != m_usersById.end ()) {
73- result->pushBack (deserializeToDto (it->second ));
74+ result->push_back (deserializeToDto (it->second ));
7475 it++;
7576 }
7677 return result;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class UserDto : public oatpp::data::mapping::type::Object {
2525 DTO_FIELD (Int32, id);
2626 DTO_FIELD (String, firstName, " first-name" );
2727 DTO_FIELD (String, lastName, " last-name" );
28- DTO_FIELD (List <String>::ObjectWrapper , friends) = List <String>::createShared( );
28+ DTO_FIELD (Vector <String>, friends) = Vector <String>({} );
2929
3030};
3131
You can’t perform that action at this time.
0 commit comments