AppFlowy/frontend/rust-lib/flowy-grid/src/event_handler.rs

56 lines
1.5 KiB
Rust
Raw Normal View History

2022-03-04 14:09:16 +00:00
use crate::manager::GridManager;
2022-03-02 14:43:04 +00:00
use flowy_error::FlowyError;
2022-03-03 14:17:07 +00:00
use flowy_grid_data_model::entities::{
2022-03-04 00:22:49 +00:00
CreateGridPayload, Grid, GridId, RepeatedField, RepeatedFieldOrder, RepeatedRow, RepeatedRowOrder,
2022-03-03 14:17:07 +00:00
};
use lib_dispatch::prelude::{AppData, Data, DataResult};
2022-03-02 14:43:04 +00:00
use std::sync::Arc;
#[tracing::instrument(skip(data, controller), err)]
pub(crate) async fn create_grid_handler(
data: Data<CreateGridPayload>,
controller: AppData<Arc<GridManager>>,
) -> DataResult<Grid, FlowyError> {
todo!()
}
#[tracing::instrument(skip(data, controller), err)]
pub(crate) async fn open_grid_handler(
data: Data<GridId>,
controller: AppData<Arc<GridManager>>,
) -> DataResult<Grid, FlowyError> {
2022-03-03 14:17:07 +00:00
let _params: GridId = data.into_inner();
todo!()
}
#[tracing::instrument(skip(data, controller), err)]
pub(crate) async fn get_rows_handler(
data: Data<RepeatedRowOrder>,
controller: AppData<Arc<GridManager>>,
2022-03-04 00:22:49 +00:00
) -> DataResult<RepeatedRow, FlowyError> {
2022-03-03 14:17:07 +00:00
let row_orders: RepeatedRowOrder = data.into_inner();
todo!()
}
#[tracing::instrument(skip(data, controller), err)]
pub(crate) async fn get_fields_handler(
data: Data<RepeatedFieldOrder>,
controller: AppData<Arc<GridManager>>,
2022-03-04 00:22:49 +00:00
) -> DataResult<RepeatedField, FlowyError> {
2022-03-03 14:17:07 +00:00
let field_orders: RepeatedFieldOrder = data.into_inner();
todo!()
}
#[tracing::instrument(skip(data, controller), err)]
pub(crate) async fn create_row_handler(
data: Data<GridId>,
controller: AppData<Arc<GridManager>>,
2022-03-04 00:22:49 +00:00
) -> Result<(), FlowyError> {
2022-03-03 14:17:07 +00:00
let id: GridId = data.into_inner();
2022-03-02 14:43:04 +00:00
2022-03-04 00:22:49 +00:00
Ok(())
2022-03-02 14:43:04 +00:00
}