46 lines
1.1 KiB
Rust
46 lines
1.1 KiB
Rust
use std::time::{SystemTime, UNIX_EPOCH};
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct UserLogoutApi {
|
|
pub user_id: u32,
|
|
pub region_id: u64,
|
|
pub place_id: u64,
|
|
/// empty on SDGB
|
|
pub access_code: &'static str,
|
|
/// keychip without dash, 11 bytes
|
|
pub client_id: String,
|
|
/// Unix timestamp
|
|
pub date_time: u64,
|
|
#[serde(rename = "type")]
|
|
pub type_: i64,
|
|
}
|
|
|
|
#[derive(Default, Debug, Clone, PartialEq, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct UserLogoutApiResp {
|
|
pub return_code: i64,
|
|
}
|
|
|
|
impl Default for UserLogoutApi {
|
|
fn default() -> Self {
|
|
let user_id = 0;
|
|
let date_time = SystemTime::now()
|
|
.duration_since(UNIX_EPOCH)
|
|
.map(|t| t.as_secs())
|
|
.unwrap_or_default();
|
|
|
|
Self {
|
|
user_id,
|
|
date_time,
|
|
region_id: 22,
|
|
place_id: 3490,
|
|
client_id: "A63E01C2805".into(),
|
|
type_: 1,
|
|
access_code: "",
|
|
}
|
|
}
|
|
}
|