feat: strongly type and remaining routes

This commit is contained in:
Paul Makles
2022-03-20 18:14:24 +00:00
parent aee6c751c6
commit b4d825b9a1
4 changed files with 57 additions and 24 deletions

View File

@@ -1,11 +1,11 @@
use revolt_quark::{models::User, Ref, Result};
use rocket::serde::json::Value;
use rocket::serde::json::Json;
use serde::{Deserialize, Serialize};
/// # Token Response
#[derive(Serialize, Deserialize)]
struct CreateVoiceUserResponse {
/// # Voice Server Token Response
#[derive(Serialize, Deserialize, JsonSchema)]
pub struct CreateVoiceUserResponse {
/// Token for authenticating with the voice server
token: String,
}
@@ -15,6 +15,6 @@ struct CreateVoiceUserResponse {
/// Asks the voice server for a token to join the call.
#[openapi(tag = "Voice")]
#[post("/<_target>/join_call")]
pub async fn req(_user: User, _target: Ref) -> Result<Value> {
pub async fn req(_user: User, _target: Ref) -> Result<Json<CreateVoiceUserResponse>> {
unimplemented!()
}