access tokenが取得できるように

This commit is contained in:
keita
2022-04-23 04:55:43 +09:00
parent d43e04506b
commit 560fe707a6
75 changed files with 591 additions and 193 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
#include "cocoatweet/api/media/media.h"
namespace CocoaTweet::API::Medias {
Media::Media(std::shared_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
Media::Media(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
oauth_ = _oauth;
}
+3 -3
View File
@@ -2,7 +2,7 @@
#define COCOATWEET_API_MEDIA_MEDIA_H_
#include "cocoatweet/api/interface/groupInterface.h"
#include "cocoatweet/oauth/oauth.h"
#include "cocoatweet/authentication/authenticator.h"
#include <cocoatweet/api/model/mediaStore.h>
#include <cocoatweet/api/media/upload.h>
#include <vector>
@@ -16,8 +16,8 @@ public:
Media() = default;
/// @brief constructor which finally should to be called.
/// @param[in] std::shared_ptr<CocoaTweet::OAuth::OAuth1> : pointer to OAuth object
Media(std::shared_ptr<CocoaTweet::OAuth::OAuth1> _oauth);
/// @param[in] std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> : pointer to OAuth object
Media(std::shared_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
CocoaTweet::API::Model::MediaStore upload(const std::string& _file) const;
+1 -1
View File
@@ -19,7 +19,7 @@ void Upload::media(const std::string& _media) {
void Upload::mediaId(const std::string& _mediaId) {}
CocoaTweet::API::Model::MediaStore Upload::process(
std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth) {
std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth) {
auto extension = std::filesystem::path(media_).extension().string<char>();
if (mimeType.count(extension) == 0) {
throw new CocoaTweet::Exception::UnsupportedMediaTypeException(
+2 -2
View File
@@ -26,11 +26,11 @@ public:
void mediaId(const std::string& _mediaId);
/// @brief upload media
/// @param[in] std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth : pointer to OAuth object for
/// @param[in] std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth : pointer to OAuth object for
/// authenticate
/// @param[out] CocoaTweet::API::Model::MediaStore : media upload result. use id() for post
/// tweet.
CocoaTweet::API::Model::MediaStore process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth);
CocoaTweet::API::Model::MediaStore process(std::weak_ptr<CocoaTweet::Authentication::AuthenticatorBase> _oauth);
};
} // namespace CocoaTweet::API::Medias