浏览代码

refactor: remove http server ref (#3327)

Nathan.fooo 1 年之前
父节点
当前提交
a821740469

+ 0 - 11
frontend/rust-lib/Cargo.lock

@@ -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"

+ 0 - 2
frontend/rust-lib/flowy-error/Cargo.toml

@@ -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"]

+ 0 - 16
frontend/rust-lib/flowy-error/src/impl_from/http_server.rs

@@ -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,
-    }
-  }
-}

+ 0 - 3
frontend/rust-lib/flowy-error/src/impl_from/mod.rs

@@ -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;