writes down some ideas

This commit is contained in:
2019-06-21 21:49:57 +02:00
parent 3d612f33d7
commit 23adaa3e79
3 changed files with 54 additions and 2 deletions

View File

@@ -30,7 +30,24 @@ mod player {
}
}
// struct DbApi<'q>(&'q DbConnection);
// ::new() -> DbApi<'q> (Db finds a connection by itself, usefull for cli)
// ::with_conn(conn) -> DbApi<'q> (uses a user-defined connection)
// .fetch_players()
// .with_player(player_id) -> AsPlayer<'q>
// .loot() -> List of items owned (Vec<Item>)
// .claim(item_id) -> Success status (bool)
// .unclaim(item_id) -> Success status (bool)
// .sell(item_id) -> Success status (bool, earned)
// fn db_call(f: fn(DbApi) -> ApiResponse) { ... }
// ApiResponse needs to be Serialize
// endpoint example
// fn endpoint_name(params...) -> impl ... {
// let param_1 = { ... };
// db_call(move |api| api.with_player(param_1).loot())
// }
pub fn players_list(
pool: web::Data<Pool>