2026-04-02 15:15:00 +07:00
|
|
|
use super::entity::*;
|
2026-04-02 22:29:08 +07:00
|
|
|
use async_trait::async_trait;
|
|
|
|
|
use imphnen_utils::errors::AppError;
|
|
|
|
|
use uuid::Uuid;
|
2026-04-02 15:15:00 +07:00
|
|
|
|
|
|
|
|
#[async_trait]
|
|
|
|
|
pub trait ChatService: Send + Sync {
|
2026-04-02 22:29:08 +07:00
|
|
|
async fn get_team_messages(
|
|
|
|
|
&self,
|
|
|
|
|
team_id: Uuid,
|
|
|
|
|
user_id: Uuid,
|
|
|
|
|
) -> Result<Vec<MessageWithUser>, AppError>;
|
2026-04-02 15:15:00 +07:00
|
|
|
|
2026-04-02 22:29:08 +07:00
|
|
|
async fn send_message(
|
|
|
|
|
&self,
|
|
|
|
|
team_id: Uuid,
|
|
|
|
|
user_id: Uuid,
|
|
|
|
|
input: SendMessageInput,
|
|
|
|
|
) -> Result<MessageWithUser, AppError>;
|
2026-04-02 15:15:00 +07:00
|
|
|
|
2026-04-02 22:29:08 +07:00
|
|
|
async fn delete_message(
|
|
|
|
|
&self,
|
|
|
|
|
message_id: Uuid,
|
|
|
|
|
user_id: Uuid,
|
|
|
|
|
) -> Result<(), AppError>;
|
2026-04-02 15:15:00 +07:00
|
|
|
}
|