changed file section

This commit is contained in:
yoncodes
2025-10-29 14:13:47 -04:00
parent 1badd8cb4f
commit 397c34bec1
1568 changed files with 3068 additions and 3575 deletions

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::IdCardPresetDeleteRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::id::id_card_preset_delete;
use sqlx::SqlitePool;
#[put("IdCardPresetDelete")]
async fn id_card_preset_delete_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<IdCardPresetDeleteRequest>("IdCardPresetDelete", &body).map_err(|e| {
tracing::warn!("Failed to parse IdCardPresetDelete: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = id_card_preset_delete::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::IdCardPresetInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::id::id_card_preset_info;
use sqlx::SqlitePool;
#[put("IdCardPresetInfo")]
async fn id_card_preset_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<IdCardPresetInfoRequest>("IdCardPresetInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse IdCardPresetInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = id_card_preset_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::IdCardPresetSaveRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::id::id_card_preset_save;
use sqlx::SqlitePool;
#[put("IdCardPresetSave")]
async fn id_card_preset_save_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<IdCardPresetSaveRequest>("IdCardPresetSave", &body).map_err(|e| {
tracing::warn!("Failed to parse IdCardPresetSave: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = id_card_preset_save::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::IdCardRecoveryRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::id::id_card_recovery;
use sqlx::SqlitePool;
#[put("IdCardRecovery")]
async fn id_card_recovery_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<IdCardRecoveryRequest>("IdCardRecovery", &body).map_err(|e| {
tracing::warn!("Failed to parse IdCardRecovery: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = id_card_recovery::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::IdCardSaveRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::id::id_card_save;
use sqlx::SqlitePool;
#[put("IdCardSave")]
async fn id_card_save_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<IdCardSaveRequest>("IdCardSave", &body).map_err(|e| {
tracing::warn!("Failed to parse IdCardSave: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = id_card_save::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::IdCardShopBuyRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::id::id_card_shop_buy;
use sqlx::SqlitePool;
#[put("IdCardShopBuy")]
async fn id_card_shop_buy_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<IdCardShopBuyRequest>("IdCardShopBuy", &body).map_err(|e| {
tracing::warn!("Failed to parse IdCardShopBuy: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = id_card_shop_buy::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::IdCardShopInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::id::id_card_shop_info;
use sqlx::SqlitePool;
#[put("IdCardShopInfo")]
async fn id_card_shop_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<IdCardShopInfoRequest>("IdCardShopInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse IdCardShopInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = id_card_shop_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,7 @@
pub mod id_card_preset_delete;
pub mod id_card_preset_info;
pub mod id_card_preset_save;
pub mod id_card_recovery;
pub mod id_card_save;
pub mod id_card_shop_buy;
pub mod id_card_shop_info;