整形
This commit is contained in:
@@ -10,7 +10,8 @@ void Create::id(const std::string& _id) {
|
||||
bodyParam_.insert_or_assign("id", _id);
|
||||
}
|
||||
|
||||
void Create::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth){
|
||||
postInterface::process(_oauth, [](const std::string& _srv){std::cout << _srv << std::endl;});
|
||||
void Create::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
|
||||
postInterface::process(_oauth,
|
||||
[](const std::string& _srv) { std::cout << _srv << std::endl; });
|
||||
}
|
||||
} // namespace CocoaTweet::API::Favorites
|
||||
|
||||
@@ -10,7 +10,8 @@ void Destroy::id(const std::string& _id) {
|
||||
bodyParam_.insert_or_assign("id", _id);
|
||||
}
|
||||
|
||||
void Destroy::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth){
|
||||
postInterface::process(_oauth, [](const std::string& _srv){std::cout << _srv << std::endl;});
|
||||
void Destroy::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
|
||||
postInterface::process(_oauth,
|
||||
[](const std::string& _srv) { std::cout << _srv << std::endl; });
|
||||
}
|
||||
} // namespace CocoaTweet::API::Favorites
|
||||
|
||||
@@ -23,7 +23,7 @@ void postInterface::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth,
|
||||
auto oauth = _oauth.lock();
|
||||
auto oauthParam = oauth->oauthParam();
|
||||
auto sigingParam = oauthParam;
|
||||
if(contentType_ == "application/x-www-form-urlencoded"){
|
||||
if (contentType_ == "application/x-www-form-urlencoded") {
|
||||
for (const auto [k, v] : bodyParam_) {
|
||||
sigingParam.insert_or_assign(k, v);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
namespace CocoaTweet::API::Interface {
|
||||
class postInterface {
|
||||
public:
|
||||
|
||||
protected:
|
||||
std::weak_ptr<CocoaTweet::OAuth::OAuth1> oauth_;
|
||||
std::map<std::string, std::string> bodyParam_;
|
||||
|
||||
@@ -7,8 +7,9 @@ void Destroy::id(const std::string _id) {
|
||||
url_ = "https://api.twitter.com/1.1/statuses/destroy/" + _id + ".json";
|
||||
}
|
||||
|
||||
void Destroy::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth){
|
||||
postInterface::process(_oauth, [](const std::string& _srv){std::cout << _srv << std::endl;});
|
||||
void Destroy::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
|
||||
postInterface::process(_oauth,
|
||||
[](const std::string& _srv) { std::cout << _srv << std::endl; });
|
||||
}
|
||||
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
|
||||
@@ -10,8 +10,9 @@ void Update::status(const std::string _status) {
|
||||
bodyParam_.insert_or_assign("status", status_);
|
||||
}
|
||||
|
||||
void Update::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth){
|
||||
postInterface::process(_oauth, [](const std::string& _srv){std::cout << _srv << std::endl;});
|
||||
void Update::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
|
||||
postInterface::process(_oauth,
|
||||
[](const std::string& _srv) { std::cout << _srv << std::endl; });
|
||||
}
|
||||
|
||||
} // namespace CocoaTweet::API::Statuses
|
||||
|
||||
Reference in New Issue
Block a user