Initial commit
This commit is contained in:
commit
980a85d41b
15 changed files with 3969 additions and 0 deletions
73
src/queries.rs
Normal file
73
src/queries.rs
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct AdminLoginQuery {
|
||||
pub psw: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct AdminEditCommentQuery {
|
||||
pub author: String,
|
||||
pub comment_id: String,
|
||||
pub email: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct AdminRmCommentQuery {
|
||||
pub comment_id: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct NewCommentQuery {
|
||||
pub author: String,
|
||||
pub email: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct EditCommentQuery {
|
||||
pub author: String,
|
||||
pub comment_id: String,
|
||||
pub email: String,
|
||||
pub text: String,
|
||||
pub token: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct RmCommentQuery {
|
||||
pub comment_id: String,
|
||||
pub token: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(tag = "a")]
|
||||
pub enum CommentQuery {
|
||||
#[serde(rename = "new_comment")]
|
||||
NewComment(NewCommentQuery),
|
||||
#[serde(rename = "edit_comment")]
|
||||
EditComment(EditCommentQuery),
|
||||
#[serde(rename = "rm_comment")]
|
||||
RmComment(RmCommentQuery),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(tag = "a")]
|
||||
pub enum AdminQuery {
|
||||
#[serde(rename = "login")]
|
||||
Login(AdminLoginQuery),
|
||||
#[serde(rename = "edit_comment")]
|
||||
EditComment(AdminEditCommentQuery),
|
||||
#[serde(rename = "rm_comment")]
|
||||
RmComment(AdminRmCommentQuery),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct ApproveQuery {
|
||||
pub approve: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct RemoveQuery {
|
||||
pub remove: String,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue