This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support media api, do some refactor and add API as unimplemented.
- Loading branch information
Showing
5 changed files
with
174 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//! Endpoints for content. | ||
use iron::{Chain, Handler, IronError, IronResult, Request, Response}; | ||
|
||
use error::ApiError; | ||
use middleware::{AccessTokenAuth, MiddlewareChain}; | ||
|
||
/// The `/upload` endpoint. | ||
pub struct Upload; | ||
|
||
middleware_chain!(Upload, [AccessTokenAuth]); | ||
|
||
impl Handler for Upload { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} | ||
|
||
/// The `/download/:server_name/:media_id` endpoint. | ||
pub struct Download; | ||
|
||
middleware_chain!(Download, [AccessTokenAuth]); | ||
|
||
impl Handler for Download { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} | ||
|
||
/// The `/download/:server_name/:media_id/:file_name` endpoint. | ||
pub struct DownloadFile; | ||
|
||
middleware_chain!(DownloadFile, [AccessTokenAuth]); | ||
|
||
impl Handler for DownloadFile { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Endpoints for content. | ||
use iron::{Chain, Handler, IronError, IronResult, Request, Response}; | ||
|
||
use error::ApiError; | ||
use middleware::{AccessTokenAuth, MiddlewareChain}; | ||
|
||
/// The `/preview_url` endpoint. | ||
pub struct PreviewUrl; | ||
|
||
middleware_chain!(PreviewUrl, [AccessTokenAuth]); | ||
|
||
impl Handler for PreviewUrl { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Endpoints for content. | ||
use iron::{Chain, Handler, IronError, IronResult, Request, Response}; | ||
|
||
use error::ApiError; | ||
use middleware::{AccessTokenAuth, MiddlewareChain}; | ||
|
||
/// The `/thumbnail/:server_name/:media_id` endpoint. | ||
pub struct Thumbnail; | ||
|
||
middleware_chain!(Thumbnail, [AccessTokenAuth]); | ||
|
||
impl Handler for Thumbnail { | ||
fn handle(&self, _: &mut Request) -> IronResult<Response> { | ||
Err(IronError::from(ApiError::unimplemented(None))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters