You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
759 B
32 lines
759 B
use axum::{Json, extract::Path};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::USER;
|
|
|
|
// {
|
|
// "@context": "https://www.w3.org/ns/activitystreams",
|
|
// "type": "Person",
|
|
// "name": "Sally Smith",
|
|
// "id": "https://testhost.com/users/test"
|
|
// }
|
|
|
|
#[derive(Serialize)]
|
|
pub struct UsersResponse {
|
|
#[serde(rename = "@context")]
|
|
context: String,
|
|
r#type: String,
|
|
name: String,
|
|
id: String,
|
|
}
|
|
|
|
pub async fn users_get(Path(user): Path<String>) -> Json<UsersResponse> {
|
|
assert_eq!(user, USER);
|
|
|
|
Json(UsersResponse {
|
|
context: "https://www.w3.org/ns/activitystreams".to_string(),
|
|
r#type: "Person".to_string(),
|
|
name: "Sally Smith".to_string(),
|
|
id: "https://testhost.com/users/test".to_string(),
|
|
})
|
|
}
|