めんどくさくなったから一括でコミットするけど許してくれ

This commit is contained in:
keita
2021-02-23 16:37:15 +09:00
parent 5cebef5d9c
commit b4497728b1
18 changed files with 148 additions and 52 deletions
+6 -2
View File
@@ -1,4 +1,5 @@
#include "cocoatweet/api/status/destroy.h"
#include <cocoatweet/api/model/tweet.h>
#include <iostream>
namespace CocoaTweet::API::Statuses {
Destroy::Destroy() {}
@@ -8,8 +9,11 @@ void Destroy::id(const std::string _id) {
}
void Destroy::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
HttpPost::process(_oauth,
[](const std::string& _srv) { std::cout << _srv << std::endl; });
CocoaTweet::API::Model::Tweet tweet;
HttpPost::process(_oauth, [&tweet](const std::string& _srv) {
tweet = CocoaTweet::API::Model::Tweet::parse(100, _srv);
});
std::cout << "afw" << std::endl;
}
} // namespace CocoaTweet::API::Statuses
+11 -3
View File
@@ -2,15 +2,23 @@
#define COCOATWEET_API_STATUSES_DESTROY_H_
#include <memory>
#include "cocoatweet/api/interface/httpPost.h"
//#include "cocoatweet/oauth/oauth.h"
#include <cocoatweet/api/interface/httpPost.h>
namespace CocoaTweet::API::Statuses {
/// @brief class for using status/destroy:id endpoint
class Destroy : public CocoaTweet::API::Interface::HttpPost {
public:
/// @brief primary constructor
Destroy();
/// @brief set tweet id to destroy
/// @param[in] std::string _id : tweet id which should be destroy
/// @param[out] none
void id(const std::string _id);
/// @brief process request for endpoint
/// @param[in] std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth : pointer to oauth object
/// @param[out] none
void process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth);
};
} // namespace CocoaTweet::API::Statuses
+1 -2
View File
@@ -12,8 +12,7 @@ void Update::status(const std::string _status) {
}
void Update::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
HttpPost::process(_oauth,
[](const std::string& _srv) { std::cout << _srv << std::endl; });
HttpPost::process(_oauth, [](const std::string& _srv) { std::cout << _srv << std::endl; });
}
} // namespace CocoaTweet::API::Statuses