Last active
March 1, 2020 11:49
-
-
Save dunnock/179d68d4a67deb1b721a2586085c5356 to your computer and use it in GitHub Desktop.
actix-node-benchmark: actix::get_tasks handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[get("/tasks")] | |
pub async fn get_tasks( | |
query: Query<GetTasksQuery>, db_pool: Data<Pool> | |
) -> Result<HttpResponse, BenchError> { | |
let tasks = db::get_tasks(db_pool.into_inner(), query.into_inner()).await?; | |
Ok(HttpResponse::Ok().json(tasks)) | |
} | |
#[derive(Deserialize)] | |
pub struct GetTasksQuery { | |
pub summary: Option<String>, | |
pub assignee_name: Option<String>, | |
pub limit: Option<u32>, | |
pub full: Option<bool> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment