refactor: remove http server ref (#3327)

This commit is contained in:
Nathan.fooo 2023-09-04 15:50:38 +08:00 committed by GitHub
parent af0ae2e375
commit a821740469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 32 deletions

View File

@ -1512,7 +1512,6 @@ dependencies = [
"flowy-codegen",
"flowy-derive",
"flowy-sqlite",
"http-error-code",
"lib-dispatch",
"protobuf",
"r2d2",
@ -2157,16 +2156,6 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "http-error-code"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Server?branch=refactor/appflowy_server#1ccd296de8530760d92652dbd9f38f27178059b6"
dependencies = [
"serde",
"serde_repr",
"thiserror",
]
[[package]]
name = "httparse"
version = "1.8.0"

View File

@ -17,7 +17,6 @@ serde_json = {version = "1.0", optional = true}
serde_repr = { version = "0.1" }
serde = "1.0"
reqwest = { version = "0.11.14", optional = true, features = ["native-tls-vendored"] }
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 }
@ -31,7 +30,6 @@ impl_from_dispatch_error = ["lib-dispatch"]
impl_from_serde = ["serde_json"]
impl_from_reqwest = ["reqwest"]
impl_from_sqlite = ["flowy-sqlite", "r2d2"]
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"]

View File

@ -1,16 +0,0 @@
use crate::code::ErrorCode;
use http_error_code::ErrorCode as ServerErrorCode;
impl std::convert::From<ServerErrorCode> for ErrorCode {
fn from(code: ServerErrorCode) -> Self {
match code {
ServerErrorCode::UserUnauthorized => ErrorCode::UserUnauthorized,
ServerErrorCode::PasswordNotMatch => ErrorCode::PasswordNotMatch,
ServerErrorCode::RecordNotFound => ErrorCode::RecordNotFound,
ServerErrorCode::ConnectRefused
| ServerErrorCode::ConnectTimeout
| ServerErrorCode::ConnectClose => ErrorCode::HttpError,
_ => ErrorCode::Internal,
}
}
}

View File

@ -13,9 +13,6 @@ pub mod reqwest;
#[cfg(feature = "impl_from_sqlite")]
pub mod database;
#[cfg(feature = "impl_from_appflowy_cloud")]
pub mod http_server;
#[cfg(feature = "impl_from_collab")]
pub mod collab;