favorites関連でTweetオブジェクトを返すように

This commit is contained in:
keita
2021-03-05 11:30:08 +09:00
parent 75b2599b6b
commit 9aa3fe1c9a
6 changed files with 25 additions and 12 deletions
+7 -2
View File
@@ -1,4 +1,5 @@
#include <cocoatweet/api/favorite/create.h>
#include <cocoatweet/api/model/tweet.h>
namespace CocoaTweet::API::Favorites {
Create::Create() {
@@ -10,8 +11,12 @@ void Create::id(const std::string& _id) {
bodyParam_.insert_or_assign("id", _id);
}
void Create::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
HttpPost::process(_oauth, [](const unsigned int _, const std::string& _srv) {
CocoaTweet::API::Model::Tweet Create::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
CocoaTweet::API::Model::Tweet tweet;
HttpPost::process(_oauth, [&tweet](const unsigned int _responseCode, const std::string& _rcv) {
tweet = CocoaTweet::API::Model::Tweet(_responseCode, _rcv);
});
return tweet;
}
} // namespace CocoaTweet::API::Favorites