access tokenが取得できるように
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user