dogy_backend_api/service/assistant/
models.rs1use serde::{Deserialize, Serialize};
2use sqlx::prelude::{FromRow, Type};
3use uuid::Uuid;
4
5#[derive(Deserialize)]
6pub struct Thread {
7 pub title: String,
8}
9
10#[derive(Debug, Serialize, FromRow, Type)]
11pub struct DbThread {
12 pub thread_id: Uuid,
13 pub thread_title: String,
14}
15
16#[allow(dead_code)]
17#[derive(Debug, Serialize)]
18pub enum MessageType {
19 User,
20 Bot,
21}
22
23#[derive(Debug, Serialize)]
24#[serde(rename_all = "camelCase")]
25pub struct Message {
26 pub id: Uuid,
27 pub is_bot_message: bool,
28 pub text: String,
29 pub title: MessageType, }
31
32#[derive(Serialize)]
33#[serde(rename_all = "camelCase")]
34pub struct ThreadResponse {
35 pub thread_id: Uuid,
36 pub user_id: String,
37 pub title: String,
38 pub messages: Vec<Message>,
39}
40
41#[derive(Serialize)]
42pub struct AllThreadResponse {
43 pub threads: Vec<ThreadResponse>,
44}