mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat File storage (#3306)
* refactor: file upload * refactor: support upload plan * test: add tests
This commit is contained in:
@ -20,6 +20,7 @@ reqwest = { version = "0.11.14", optional = true, features = ["native-tls-vendor
|
||||
http-error-code = { git = "https://github.com/AppFlowy-IO/AppFlowy-Server", branch = "refactor/appflowy_server", optional = true }
|
||||
flowy-sqlite = { path = "../flowy-sqlite", optional = true}
|
||||
r2d2 = { version = "0.8", optional = true}
|
||||
url = { version = "2.2", optional = true }
|
||||
collab-database = { version = "0.1.0", optional = true }
|
||||
collab-document = { version = "0.1.0", optional = true }
|
||||
tokio-postgres = { version = "0.7.8", optional = true }
|
||||
@ -34,6 +35,7 @@ impl_from_appflowy_cloud = ["http-error-code"]
|
||||
impl_from_collab = ["collab-database", "collab-document", "impl_from_reqwest"]
|
||||
impl_from_postgres = ["tokio-postgres"]
|
||||
impl_from_tokio= ["tokio"]
|
||||
impl_from_url= ["url"]
|
||||
dart = ["flowy-codegen/dart"]
|
||||
ts = ["flowy-codegen/ts"]
|
||||
|
||||
|
@ -232,6 +232,12 @@ pub enum ErrorCode {
|
||||
|
||||
#[error("It appears that the workspace data has not been fully synchronized")]
|
||||
WorkspaceDataNotSync = 76,
|
||||
|
||||
#[error("Excess storage limited")]
|
||||
ExcessStorageLimited = 77,
|
||||
|
||||
#[error("Parse url failed")]
|
||||
InvalidURL = 78,
|
||||
}
|
||||
|
||||
impl ErrorCode {
|
||||
|
@ -24,3 +24,6 @@ mod postgres;
|
||||
|
||||
#[cfg(feature = "impl_from_tokio")]
|
||||
mod tokio;
|
||||
|
||||
#[cfg(feature = "impl_from_url")]
|
||||
mod url;
|
||||
|
7
frontend/rust-lib/flowy-error/src/impl_from/url.rs
Normal file
7
frontend/rust-lib/flowy-error/src/impl_from/url.rs
Normal file
@ -0,0 +1,7 @@
|
||||
use crate::{ErrorCode, FlowyError};
|
||||
|
||||
impl std::convert::From<url::ParseError> for FlowyError {
|
||||
fn from(error: url::ParseError) -> Self {
|
||||
FlowyError::new(ErrorCode::InvalidURL, "").with_context(error)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user