OrangeGuidanceTomestone/server/src/message.rs

49 lines
1.0 KiB
Rust
Raw Normal View History

2022-09-03 10:35:15 +00:00
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(Debug, Deserialize)]
pub struct Message {
pub territory: u32,
pub x: f32,
pub y: f32,
pub z: f32,
2022-09-04 21:04:44 +00:00
#[serde(default)]
pub yaw: f32,
2022-09-03 10:35:15 +00:00
pub pack_id: Uuid,
pub template_1: usize,
pub word_1_list: Option<usize>,
pub word_1_word: Option<usize>,
2022-09-03 13:55:36 +00:00
pub conjunction: Option<usize>,
2022-09-03 10:35:15 +00:00
pub template_2: Option<usize>,
pub word_2_list: Option<usize>,
pub word_2_word: Option<usize>,
}
#[derive(Debug, Serialize)]
pub struct RetrievedMessage {
pub id: String,
pub x: f64,
pub y: f64,
pub z: f64,
2022-09-04 21:04:44 +00:00
pub yaw: f64,
2022-09-03 10:35:15 +00:00
pub message: String,
pub positive_votes: i32,
pub negative_votes: i32,
2022-09-04 07:12:51 +00:00
pub user_vote: i64,
2022-09-03 10:35:15 +00:00
}
2022-09-04 04:32:56 +00:00
#[derive(Debug, Serialize)]
pub struct RetrievedMessageTerritory {
pub id: String,
2022-09-04 05:03:59 +00:00
pub territory: i64,
2022-09-04 04:32:56 +00:00
pub x: f64,
pub y: f64,
pub z: f64,
2022-09-04 21:04:44 +00:00
pub yaw: f64,
2022-09-04 04:32:56 +00:00
pub message: String,
pub positive_votes: i32,
pub negative_votes: i32,
2022-09-04 07:12:51 +00:00
pub user_vote: i64,
2022-09-04 04:32:56 +00:00
}