mirror of
https://github.com/fluencelabs/fluid
synced 2025-06-21 00:56:29 +00:00
rust-workshop => backend-rust
This commit is contained in:
25
backend-rust/step1-json-api/src/model.rs
Normal file
25
backend-rust/step1-json-api/src/model.rs
Normal file
@ -0,0 +1,25 @@
|
||||
use crate::api::AppResult;
|
||||
use log;
|
||||
|
||||
pub fn create_scheme() -> AppResult<()> {
|
||||
Ok(log::info!("creating scheme"))
|
||||
}
|
||||
|
||||
pub fn add_post(msg: String, username: String) -> AppResult<()> {
|
||||
Ok(log::info!("add post {} {}", msg, username))
|
||||
}
|
||||
|
||||
pub fn get_all_posts() -> AppResult<String> {
|
||||
log::info!("get all posts");
|
||||
Ok("[]".to_string())
|
||||
}
|
||||
|
||||
pub fn get_posts_by_username(username: String) -> AppResult<String> {
|
||||
log::info!("get all posts by username {}", username);
|
||||
Ok("[]".to_string())
|
||||
}
|
||||
|
||||
pub fn get_posts_count() -> AppResult<i32> {
|
||||
log::info!("get posts count");
|
||||
Ok(0)
|
||||
}
|
Reference in New Issue
Block a user