1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 16:35:17 +00:00

Can create text posts

This commit is contained in:
2020-07-07 19:14:16 +02:00
parent 6b9c9079c8
commit c82e9d6e69
6 changed files with 143 additions and 5 deletions

View File

@ -34,4 +34,5 @@ pub mod post_api;
pub mod movie_api;
pub mod survey_choice_api;
pub mod survey_api;
pub mod comment_api;
pub mod comment_api;
pub mod res_create_post;

View File

@ -0,0 +1,21 @@
//! # 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,
}
}
}