feat: add some ipc provider method

This commit is contained in:
Lin Onetwo
2023-01-05 18:38:05 +08:00
parent 1cd17ea31b
commit 646fcea816
15 changed files with 290 additions and 84 deletions

View File

@@ -3,13 +3,13 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct PutBlob {
pub workspace_id: u64,
pub workspace_id: String,
pub blob: Vec<u8>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct GetBlob {
pub workspace_id: u64,
pub workspace_id: String,
pub id: String,
}

View File

@@ -3,7 +3,29 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct CreateWorkspace {
pub id: i64,
// TODO: make all id string, on Octobase side, and rewrite all related tests
pub user_id: i32,
/**
* only set name, avatar is update in datacenter to yDoc directly
*/
pub name: String,
pub avatar: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct CreateWorkspaceResult {
pub id: String,
pub name: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct UpdateWorkspace {
pub id: i64,
pub public: bool,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
pub enum IWorkspaceParameters {
CreateWorkspace(CreateWorkspace),
UpdateWorkspace(UpdateWorkspace),
CreateWorkspaceResult(CreateWorkspaceResult),
}