1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-27 15:59:21 +00:00
comunicapiv3/src/api_data/res_create_post.rs

22 lines
432 B
Rust
Raw Normal View History

2020-07-07 17:14:16 +00:00
//! # Create a post result
//!
//! @author Pierre Hubert
use serde::Serialize;
#[derive(Serialize)]
#[allow(non_snake_case)]
pub struct ResCreatePost {
success: String,
postID: u64,
}
impl ResCreatePost {
/// Initialize a new structure
pub fn new(post_id: u64) -> ResCreatePost {
ResCreatePost {
success: "The post has been created!".to_string(),
postID: post_id,
}
}
}