add basic guild create + message create endpoints
This commit is contained in:
parent
5b23095520
commit
e57bff00c2
27 changed files with 367 additions and 36 deletions
|
@ -5,7 +5,10 @@ use eyre::ContextCompat;
|
|||
use foxchat::{
|
||||
fed,
|
||||
http::ApiError,
|
||||
model::{http::guild::CreateGuildParams, Guild},
|
||||
model::{
|
||||
http::{channel::CreateMessageParams, guild::CreateGuildParams},
|
||||
Guild, Message,
|
||||
},
|
||||
};
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use tracing::debug;
|
||||
|
@ -15,7 +18,12 @@ use crate::{app_state::AppState, fed::ProxyServerHeader};
|
|||
use super::auth::AuthUser;
|
||||
|
||||
pub fn router() -> Router {
|
||||
Router::new().route("/guilds", post(proxy_post::<CreateGuildParams, Guild>))
|
||||
Router::new()
|
||||
.route("/guilds", post(proxy_post::<CreateGuildParams, Guild>))
|
||||
.route(
|
||||
"/channels/:id/messages",
|
||||
post(proxy_post::<CreateMessageParams, Message>),
|
||||
)
|
||||
}
|
||||
|
||||
async fn proxy_get<R: Serialize + DeserializeOwned>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue