Implement limit for Rust

This commit is contained in:
folex
2019-08-18 16:22:15 +03:00
parent 959143a5d7
commit ae9b018f04
10 changed files with 71 additions and 29 deletions

View File

@ -10,12 +10,12 @@ pub fn add_post(message: String, username: String) -> AppResult<()> {
Ok(log::info!("add post {} {}", message, username))
}
pub fn get_all_posts() -> AppResult<String> {
pub fn get_all_posts(offset: u32, count: u32) -> AppResult<String> {
log::info!("get all posts");
Ok("[]".to_string())
}
pub fn get_posts_by_username(username: String) -> AppResult<String> {
pub fn get_posts_by_username(username: String, offset: u32, count: u32) -> AppResult<String> {
log::info!("get all posts by username {}", username);
Ok("[]".to_string())
}