mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
rename backend dir
This commit is contained in:
parent
1d9d776e3a
commit
d4b020b64f
@ -14,15 +14,13 @@ use crate::{
|
||||
},
|
||||
context::AppContext,
|
||||
service::{
|
||||
doc_service::router as doc,
|
||||
user_service::router as user,
|
||||
workspace_service::{
|
||||
app::router as app,
|
||||
view::router as view,
|
||||
workspace::router as workspace,
|
||||
},
|
||||
ws_service,
|
||||
ws_service::WSServer,
|
||||
app::router as app,
|
||||
doc::router as doc,
|
||||
user::router as user,
|
||||
view::router as view,
|
||||
workspace::router as workspace,
|
||||
ws,
|
||||
ws::WSServer,
|
||||
},
|
||||
};
|
||||
|
||||
@ -82,7 +80,7 @@ async fn period_check(_pool: Data<PgPool>) {
|
||||
}
|
||||
}
|
||||
|
||||
fn ws_scope() -> Scope { web::scope("/ws").service(ws_service::router::establish_ws_connection) }
|
||||
fn ws_scope() -> Scope { web::scope("/ws").service(ws::router::establish_ws_connection) }
|
||||
|
||||
fn user_scope() -> Scope {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::service::ws_service::WSServer;
|
||||
use crate::service::ws::WSServer;
|
||||
use actix::Addr;
|
||||
|
||||
use sqlx::PgPool;
|
||||
|
@ -74,7 +74,7 @@ impl Token {
|
||||
}
|
||||
}
|
||||
|
||||
use crate::service::user_service::EXPIRED_DURATION_DAYS;
|
||||
use crate::service::user::EXPIRED_DURATION_DAYS;
|
||||
use actix_web::{dev::Payload, FromRequest, HttpRequest};
|
||||
use flowy_net::config::HEADER_TOKEN;
|
||||
use futures::future::{ready, Ready};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::service::user_service::{LoggedUser, AUTHORIZED_USERS};
|
||||
use crate::service::user::{LoggedUser, AUTHORIZED_USERS};
|
||||
use actix_service::{Service, Transform};
|
||||
use actix_web::{
|
||||
dev::{ServiceRequest, ServiceResponse},
|
||||
|
@ -17,10 +17,7 @@ use flowy_workspace::{
|
||||
|
||||
use crate::{
|
||||
entities::workspace::{AppTable, APP_TABLE},
|
||||
service::{
|
||||
user_service::LoggedUser,
|
||||
workspace_service::{app::sql_builder::*, view::read_views_belong_to_id},
|
||||
},
|
||||
service::{app::sql_builder::*, user::LoggedUser, view::read_views_belong_to_id},
|
||||
sqlx_ext::{map_sqlx_error, SqlBuilder},
|
||||
};
|
||||
|
@ -13,9 +13,9 @@ use flowy_workspace::protobuf::{
|
||||
};
|
||||
|
||||
use crate::service::{
|
||||
user_service::LoggedUser,
|
||||
app::app::{create_app, delete_app, read_app, update_app},
|
||||
user::LoggedUser,
|
||||
util::parse_from_payload,
|
||||
workspace_service::app::app::{create_app, delete_app, read_app, update_app},
|
||||
};
|
||||
|
||||
pub async fn create_handler(
|
@ -8,7 +8,7 @@ use flowy_document::protobuf::{QueryDocParams, UpdateDocParams};
|
||||
use flowy_net::errors::ServerError;
|
||||
|
||||
use crate::service::{
|
||||
doc_service::{read_doc, update_doc},
|
||||
doc::{read_doc, update_doc},
|
||||
util::parse_from_payload,
|
||||
};
|
||||
|
@ -1,6 +1,8 @@
|
||||
pub mod doc_service;
|
||||
pub mod app;
|
||||
pub mod doc;
|
||||
pub(crate) mod log;
|
||||
pub mod user_service;
|
||||
pub mod user;
|
||||
pub(crate) mod util;
|
||||
pub mod workspace_service;
|
||||
pub mod ws_service;
|
||||
pub mod view;
|
||||
pub mod workspace;
|
||||
pub mod ws;
|
||||
|
@ -20,14 +20,12 @@ use flowy_user::{
|
||||
|
||||
use crate::{
|
||||
entities::{token::Token, user::UserTable},
|
||||
service::{
|
||||
user_service::{hash_password, verify_password, LoggedUser},
|
||||
workspace_service::user_default::create_default_workspace,
|
||||
},
|
||||
service::user::{hash_password, verify_password, LoggedUser},
|
||||
sqlx_ext::{map_sqlx_error, DBTransaction, SqlBuilder},
|
||||
};
|
||||
|
||||
use super::AUTHORIZED_USERS;
|
||||
use crate::service::user::user_default::create_default_workspace;
|
||||
|
||||
pub async fn sign_in(pool: &PgPool, params: SignInParams) -> Result<SignInResponse, ServerError> {
|
||||
let email =
|
@ -1,8 +1,9 @@
|
||||
mod auth;
|
||||
mod logged_user;
|
||||
pub mod router;
|
||||
mod utils;
|
||||
|
||||
pub use auth::*;
|
||||
pub use logged_user::*;
|
||||
pub use utils::*;
|
||||
|
||||
mod auth;
|
||||
mod logged_user;
|
||||
pub mod router;
|
||||
pub mod user_default;
|
||||
mod utils;
|
@ -12,14 +12,7 @@ use flowy_user::protobuf::{SignInParams, SignUpParams, UpdateUserParams};
|
||||
use crate::{
|
||||
entities::token::Token,
|
||||
service::{
|
||||
user_service::{
|
||||
get_user_profile,
|
||||
register_user,
|
||||
set_user_profile,
|
||||
sign_in,
|
||||
sign_out,
|
||||
LoggedUser,
|
||||
},
|
||||
user::{get_user_profile, register_user, set_user_profile, sign_in, sign_out, LoggedUser},
|
||||
util::parse_from_payload,
|
||||
},
|
||||
};
|
@ -1,15 +1,17 @@
|
||||
use flowy_net::errors::ServerError;
|
||||
use flowy_workspace::protobuf::{App, CreateViewParams, View, ViewType, Workspace};
|
||||
use flowy_workspace::{
|
||||
entities::view::default_delta,
|
||||
protobuf::{App, CreateViewParams, View, ViewType, Workspace},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
service::workspace_service::{
|
||||
service::{
|
||||
app::sql_builder::NewAppSqlBuilder as AppBuilder,
|
||||
view::create_view_with_transaction,
|
||||
workspace::sql_builder::NewWorkspaceBuilder as WorkspaceBuilder,
|
||||
},
|
||||
sqlx_ext::{map_sqlx_error, DBTransaction},
|
||||
};
|
||||
use flowy_workspace::entities::view::default_delta;
|
||||
|
||||
pub async fn create_default_workspace(
|
||||
transaction: &mut DBTransaction<'_>,
|
@ -14,7 +14,7 @@ use flowy_workspace::protobuf::{
|
||||
|
||||
use crate::service::{
|
||||
util::parse_from_payload,
|
||||
workspace_service::view::{create_view, delete_view, read_view, update_view},
|
||||
view::{create_view, delete_view, read_view, update_view},
|
||||
};
|
||||
|
||||
pub async fn create_handler(
|
@ -2,6 +2,7 @@ use anyhow::Context;
|
||||
use chrono::Utc;
|
||||
use sqlx::{postgres::PgArguments, PgPool, Postgres};
|
||||
|
||||
use flowy_document::protobuf::CreateDocParams;
|
||||
use flowy_net::{
|
||||
errors::{invalid_params, ServerError},
|
||||
response::FlowyResponse,
|
||||
@ -17,12 +18,11 @@ use flowy_workspace::{
|
||||
use crate::{
|
||||
entities::workspace::{ViewTable, VIEW_TABLE},
|
||||
service::{
|
||||
doc_service::{create_doc, delete_doc},
|
||||
workspace_service::view::sql_builder::*,
|
||||
doc::{create_doc, delete_doc},
|
||||
view::sql_builder::*,
|
||||
},
|
||||
sqlx_ext::{map_sqlx_error, DBTransaction, SqlBuilder},
|
||||
};
|
||||
use flowy_document::protobuf::CreateDocParams;
|
||||
|
||||
pub(crate) async fn create_view(
|
||||
pool: &PgPool,
|
@ -13,14 +13,9 @@ use flowy_workspace::protobuf::{
|
||||
};
|
||||
|
||||
use crate::service::{
|
||||
user_service::LoggedUser,
|
||||
user::LoggedUser,
|
||||
util::parse_from_payload,
|
||||
workspace_service::workspace::{
|
||||
create_workspace,
|
||||
delete_workspace,
|
||||
read_workspaces,
|
||||
update_workspace,
|
||||
},
|
||||
workspace::{create_workspace, delete_workspace, read_workspaces, update_workspace},
|
||||
};
|
||||
|
||||
pub async fn create_handler(
|
@ -12,10 +12,7 @@ use flowy_workspace::{
|
||||
|
||||
use crate::{
|
||||
entities::workspace::{AppTable, WorkspaceTable, WORKSPACE_TABLE},
|
||||
service::{
|
||||
user_service::LoggedUser,
|
||||
workspace_service::{view::read_views_belong_to_id, workspace::sql_builder::*},
|
||||
},
|
||||
service::{user::LoggedUser, view::read_views_belong_to_id, workspace::sql_builder::*},
|
||||
sqlx_ext::*,
|
||||
};
|
||||
|
@ -1,4 +0,0 @@
|
||||
pub mod app;
|
||||
pub mod user_default;
|
||||
pub mod view;
|
||||
pub mod workspace;
|
@ -1,3 +0,0 @@
|
||||
mod user_default;
|
||||
|
||||
pub use user_default::*;
|
@ -1,4 +1,4 @@
|
||||
use crate::service::ws_service::ClientMessage;
|
||||
use crate::service::ws::ClientMessage;
|
||||
use actix::{Message, Recipient};
|
||||
use flowy_net::errors::ServerError;
|
||||
use serde::{Deserialize, Serialize};
|
@ -1,4 +1,4 @@
|
||||
use crate::service::ws_service::entities::SessionId;
|
||||
use crate::service::ws::entities::SessionId;
|
||||
use actix::Message;
|
||||
use bytes::Bytes;
|
||||
use std::fmt::Formatter;
|
@ -1,7 +1,7 @@
|
||||
use crate::service::ws_service::{WSClient, WSServer};
|
||||
use crate::service::ws::{WSClient, WSServer};
|
||||
use actix::Addr;
|
||||
|
||||
use crate::service::user_service::LoggedUser;
|
||||
use crate::service::user::LoggedUser;
|
||||
use actix_web::{
|
||||
get,
|
||||
web::{Data, Path, Payload},
|
@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
config::{HEARTBEAT_INTERVAL, PING_TIMEOUT},
|
||||
service::ws_service::{
|
||||
service::ws::{
|
||||
entities::{Connect, Disconnect, SessionId},
|
||||
ClientMessage,
|
||||
MessageData,
|
@ -1,4 +1,4 @@
|
||||
use crate::service::ws_service::{
|
||||
use crate::service::ws::{
|
||||
entities::{Connect, Disconnect, Session, SessionId},
|
||||
ClientMessage,
|
||||
MessageData,
|
Loading…
Reference in New Issue
Block a user