mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-16 12:51:03 +00:00

* fix: support filtering results by workspace * feat: add search button to sidebar * fix: reduce view/recent view fetching across application * feat: add channel to search listener * feat: clean + localization * chore: remove redundant code * fix: disable search * chore: trigger ci * chore: disable search in backend * test: disable search tests for now * feat: temp disable reliance on folder search * fix: add debounce to inline actions * chore: complete future if disposed * fix: clean code * chore: disable unused bloc with feature flag * fix: recent views lazy read * chore: revert podilfe change * chore: update logs * chore: update client api and collab * chore: fix tst * chore: fix test & update collab commit * chore: update collab commit * test: fix unit tests * chore: update rust toolchain 1.77 * chore: use opt-level 1 * fix: code review * chore: clippy --------- Co-authored-by: nathan <nathan@appflowy.io> Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
80 lines
1.7 KiB
Rust
80 lines
1.7 KiB
Rust
use std::fmt;
|
|
use std::fmt::Display;
|
|
|
|
use chrono::{DateTime, Utc};
|
|
use serde::Deserialize;
|
|
use serde_json::Value;
|
|
use uuid::Uuid;
|
|
|
|
use crate::util::deserialize_null_or_default;
|
|
|
|
pub enum GetUserProfileParams {
|
|
Uid(i64),
|
|
Uuid(Uuid),
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
#[derive(Debug, Deserialize, Clone)]
|
|
pub(crate) struct UserProfileResponse {
|
|
pub uid: i64,
|
|
#[serde(deserialize_with = "deserialize_null_or_default")]
|
|
pub name: String,
|
|
|
|
#[serde(deserialize_with = "deserialize_null_or_default")]
|
|
pub email: String,
|
|
|
|
#[serde(deserialize_with = "deserialize_null_or_default")]
|
|
pub latest_workspace_id: String,
|
|
|
|
#[serde(deserialize_with = "deserialize_null_or_default")]
|
|
pub encryption_sign: String,
|
|
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Deserialize, Clone)]
|
|
pub(crate) struct UidResponse {
|
|
#[allow(dead_code)]
|
|
pub uid: i64,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct RealtimeEvent {
|
|
pub schema: String,
|
|
pub table: String,
|
|
#[serde(rename = "eventType")]
|
|
pub event_type: String,
|
|
pub new: Value,
|
|
}
|
|
impl Display for RealtimeEvent {
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
write!(
|
|
f,
|
|
"schema: {}, table: {}, event_type: {}",
|
|
self.schema, self.table, self.event_type
|
|
)
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct RealtimeCollabUpdateEvent {
|
|
pub oid: String,
|
|
pub uid: i64,
|
|
pub key: i64,
|
|
pub did: String,
|
|
pub value: String,
|
|
#[serde(default)]
|
|
pub encrypt: i32,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct RealtimeUserEvent {
|
|
pub uid: i64,
|
|
#[serde(deserialize_with = "deserialize_null_or_default")]
|
|
pub name: String,
|
|
#[serde(deserialize_with = "deserialize_null_or_default")]
|
|
pub email: String,
|
|
#[serde(deserialize_with = "deserialize_null_or_default")]
|
|
pub encryption_sign: String,
|
|
}
|