gitdataai/lib/channel/event/star.rs
2026-05-30 01:38:40 +08:00

48 lines
1.1 KiB
Rust

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::event::{RoomInfo, UserInfo};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageStarredService {
pub room: RoomInfo,
pub message_id: Uuid,
pub message_seq: i64,
pub starred_by: UserInfo,
pub starred_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageUnstarredService {
pub room: RoomInfo,
pub message_id: Uuid,
pub unstarred_by: UserInfo,
pub unstarred_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StarredMessageEntry {
pub message_id: Uuid,
pub room: RoomInfo,
pub seq: i64,
pub content: String,
pub content_type: String,
pub sender: UserInfo,
pub starred_at: DateTime<Utc>,
pub sent_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageStarClient {
pub room: Uuid,
pub message_id: Uuid,
pub star: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StarredListClient {
pub room: Option<Uuid>,
pub limit: Option<u64>,
pub offset: Option<u64>,
}