-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(assets): full rewrite all api endpoints (#28)
- Loading branch information
Showing
14 changed files
with
291 additions
and
154 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,5 @@ | ||
--- | ||
"algohub-server": patch:refactor | ||
--- | ||
|
||
Full rewrite all api endpoints of assets. |
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
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 |
---|---|---|
@@ -1,11 +1,27 @@ | ||
use std::path::PathBuf; | ||
|
||
use rocket::fs::TempFile; | ||
use serde::{Deserialize, Serialize}; | ||
use surrealdb::sql::Thing; | ||
|
||
use super::{Credentials, UserRecordId}; | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct Asset { | ||
pub id: Option<Thing>, | ||
pub name: String, | ||
pub owner: Thing, | ||
pub path: PathBuf, | ||
} | ||
|
||
#[derive(FromForm)] | ||
pub struct CreateAsset<'a> { | ||
pub auth: Credentials<'a>, | ||
pub owner: UserRecordId, | ||
pub file: TempFile<'a>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct UserContent { | ||
pub id: String, | ||
} |
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
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
Oops, something went wrong.