Files
imphnen-backend-service/imphnen-hackathon/src/chat/domain/service.rs
T

19 lines
531 B
Rust
Raw Normal View History

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