Converted the Api to a Restful api.

This commit is contained in:
2026-01-22 22:51:03 +01:00
parent 79ba1e1b44
commit ea9ad80336
34 changed files with 1779 additions and 1497 deletions

View File

@@ -8,8 +8,8 @@ use actix_web::middleware::Logger;
use actix_web::web;
use actix_web::App;
use actix_web::HttpServer;
use gamenight_database::*;
use request::{gamenights, login, register, *};
use gamenight_database::{get_connection_pool, run_migration, GetConnection};
use request::*;
use tracing_actix_web::TracingLogger;
#[actix_web::main]
@@ -37,30 +37,30 @@ async fn main() -> std::io::Result<()> {
.wrap(Logger::default())
.wrap(TracingLogger::default())
.app_data(web::Data::new(pool.clone()))
.service(login)
.service(refresh)
.service(register)
.service(gamenights)
.service(gamenight_post)
.service(gamenight_get)
.service(get_user)
.service(get_users)
.service(get_user_unauthenticated)
.service(post_join_gamenight)
.service(post_leave_gamenight)
.service(get_get_participants)
.service(get_games)
.service(get_game)
.service(post_game)
.service(post_rename_game)
.service(post_own_game)
.service(post_disown_game)
.service(get_owned_games)
.service(delete_game)
.service(get_locations)
.service(post_location)
.service(post_location_authorize)
.service(get_authorized_location_user_ids)
.service(token::post_token)
.service(token::post_refresh_token)
.service(users::get_users)
.service(users::post_users)
.service(user::get_user)
.service(user_owned_games::get_user_owned_games)
.service(gamenights::get_gamenights)
.service(gamenights::post_gamenights)
.service(gamenight::get_gamenight)
.service(gamenight_participants::get_gamenight_participants)
.service(gamenight_participants::post_gamenight_participants)
.service(gamenight_participant::delete_gamenight_participant)
.service(games::get_games)
.service(games::post_games)
.service(game::get_game)
.service(game::delete_game)
.service(game::put_game)
.service(game_owners::post_game_owners)
.service(game_owner::delete_game_owner)
.service(locations::get_locations)
.service(locations::post_locations)
.service(location_authorized_users::get_location_authorized_users)
.service(location_authorized_users::post_location_authorized_users)
.service(location_authorized_user::delete_location_authorized_user)
})
.bind(("::1", 8080))?
.run()