mirror of
https://github.com/Jackzmc/storage.git
synced 2025-05-08 19:33:22 +00:00
Initial 2
This commit is contained in:
commit
98d0065f55
53 changed files with 5857 additions and 0 deletions
28
server/src/library.rs
Normal file
28
server/src/library.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
use std::collections::HashMap;
|
||||
use crate::{models, DB};
|
||||
use crate::objs::repo::{Repo};
|
||||
use crate::storage::StorageBackend;
|
||||
use crate::user::User;
|
||||
|
||||
pub struct Library {
|
||||
pub repo: Repo,
|
||||
pub name: String,
|
||||
pub owner: User,
|
||||
// permissions:
|
||||
}
|
||||
|
||||
// pub async fn get_library(pool: &DB, library_id: &str) -> Result<Option<Library>, anyhow::Error> {
|
||||
// let library = models::library::get_library(pool, library_id)?;
|
||||
// let Some(library) = library else {
|
||||
// return Ok(None)
|
||||
// };
|
||||
// let repo = get_repo(pool, &library.repo_id).await?
|
||||
// .ok_or(anyhow::Error::msg("Repository not found."))?;
|
||||
// let owner = get_owner(pool, &library.owner_id).await?
|
||||
// .ok_or(anyhow::Error::msg("Owner not found."))?;
|
||||
// Ok(Some(Library {
|
||||
// repo: repo,
|
||||
// name: library.name,
|
||||
// owner: (),
|
||||
// }))
|
||||
// }
|
Loading…
Add table
Add a link
Reference in a new issue