25 lines
570 B
Rust
25 lines
570 B
Rust
use crate::endpoints::Endpoint;
|
|
use http::Method;
|
|
use magnetar_sdk_macros::Endpoint;
|
|
use serde::{Deserialize, Serialize};
|
|
use ts_rs::{Dependency, TS};
|
|
|
|
use crate::types::user::PackUserProfileFull;
|
|
|
|
#[derive(Serialize, Deserialize, TS)]
|
|
#[ts(export)]
|
|
pub struct UserByIdReq {
|
|
id: String,
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
detail: Option<String>,
|
|
}
|
|
|
|
#[derive(Endpoint, Deserialize)]
|
|
#[endpoint(
|
|
endpoint = "/users/:user_id",
|
|
method = Method::GET,
|
|
request = UserByIdReq,
|
|
response = PackUserProfileFull
|
|
)]
|
|
pub struct GetUserById;
|