use actix_web::{HttpResponse, Result, put, web};
use bd2::proto::proto_net::AttendanceInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::attendance;
use sqlx::SqlitePool;

#[put("AttendanceInfo")]
async fn attendance_info_handler(
    pool: web::Data<SqlitePool>,
    body: String,
    user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
    let uid = *user_id;
    let req = parse_packet::<AttendanceInfoRequest>("AttendanceInfo", &body).map_err(|e| {
        tracing::warn!("Failed to parse AttendanceInfo: {}", e);
        actix_web::error::ErrorBadRequest("Invalid packet")
    })?;
    //let response = attendance_info::handle(&pool, uid, req).await;
    let response = ""; // need to fix
    Ok(HttpResponse::Ok().json(response))
}
