diff options
-rw-r--r-- | map/booking_api.cpp | 84 | ||||
-rw-r--r-- | map/booking_api.hpp | 42 |
2 files changed, 119 insertions, 7 deletions
diff --git a/map/booking_api.cpp b/map/booking_api.cpp index 4985f7ab8d..1e3aef6e73 100644 --- a/map/booking_api.cpp +++ b/map/booking_api.cpp @@ -157,30 +157,102 @@ void BookingApi::GetHotelInfo(string const & hotelId, string const & /* lang */, }; info.m_reviews = { - { + HotelReview::CriticReview( "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", "Little bit noise from outside", "Anonymous1", "http://storage2.static.itmages.ru/i/16/0915/h_1473945375_5332083_b44af613bd.jpg", 9.2, system_clock::now() - }, - { + ), + HotelReview::CriticReview( "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", "Little bit noise from outside", "Anonymous2", "http://storage2.static.itmages.ru/i/16/0915/h_1473945375_7504873_be0fe246e3.jpg", 9.2, system_clock::now() - }, - { + ), + HotelReview::CriticReview( "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", "Little bit noise from outside", "Anonymous2", "http://storage1.static.itmages.ru/i/16/0915/h_1473945374_9397526_996bbca0d7.jpg", 9.2, system_clock::now() - } + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous1", + "http://storage2.static.itmages.ru/i/16/0915/h_1473945375_5332083_b44af613bd.jpg", + 9.2, + system_clock::now() + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous2", + "http://storage2.static.itmages.ru/i/16/0915/h_1473945375_7504873_be0fe246e3.jpg", + 9.2, + system_clock::now() + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous2", + "http://storage1.static.itmages.ru/i/16/0915/h_1473945374_9397526_996bbca0d7.jpg", + 9.2, + system_clock::now() + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous1", + "http://storage2.static.itmages.ru/i/16/0915/h_1473945375_5332083_b44af613bd.jpg", + 9.2, + system_clock::now() + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous2", + "http://storage2.static.itmages.ru/i/16/0915/h_1473945375_7504873_be0fe246e3.jpg", + 9.2, + system_clock::now() + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous2", + "http://storage1.static.itmages.ru/i/16/0915/h_1473945374_9397526_996bbca0d7.jpg", + 9.2, + system_clock::now() + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous1", + "http://storage2.static.itmages.ru/i/16/0915/h_1473945375_5332083_b44af613bd.jpg", + 9.2, + system_clock::now() + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous2", + "http://storage2.static.itmages.ru/i/16/0915/h_1473945375_7504873_be0fe246e3.jpg", + 9.2, + system_clock::now() + ), + HotelReview::CriticReview( + "Interesting place among SoHo, Little Italy and China town. Modern design. Great view from roof. Near subway. Free refreshment every afternoon. The staff was very friendly.", + "Little bit noise from outside", + "Anonymous2", + "http://storage1.static.itmages.ru/i/16/0915/h_1473945374_9397526_996bbca0d7.jpg", + 9.2, + system_clock::now() + ) }; fn(info); diff --git a/map/booking_api.hpp b/map/booking_api.hpp index bec7c4f1ba..db9b9c41c4 100644 --- a/map/booking_api.hpp +++ b/map/booking_api.hpp @@ -29,12 +29,14 @@ public: // But C++14 does. HotelReview(string const & reviewPositive, string const & reviewNegative, + string const & reviewNeutral, string const & author, string const & authorPictUrl, float const rating, time_point<system_clock> const date) : m_reviewPositive(reviewPositive) , m_reviewNegative(reviewNegative) + , m_reviewNeutral(reviewNeutral) , m_author(author) , m_authorPictUrl(authorPictUrl) , m_rating(rating) @@ -42,11 +44,49 @@ public: { } + + static HotelReview CriticReview(string const & reviewPositive, + string const & reviewNegative, + string const & author, + string const & authorPictUrl, + float const rating, + time_point<system_clock> const date) + { + return { + reviewPositive, + reviewNegative, + "", + author, + authorPictUrl, + rating, + date + }; + } + + static HotelReview NeutralReview(string const & reviewNeutral, + string const & author, + string const & authorPictUrl, + float const rating, + time_point<system_clock> const date) + { + return { + "", + "", + reviewNeutral, + author, + authorPictUrl, + rating, + date + }; + } + static auto constexpr kInvalidRating = numeric_limits<float>::max(); - /// Review text. + /// Review text. There can be either one or both positive/negative review or + /// a neutral one. string m_reviewPositive; string m_reviewNegative; + string m_reviewNeutral; /// Review author name. string m_author; /// Url to a author's picture. |