All checks were successful
/ build-all-services (push) Successful in 9m57s
currently only routes for fetching deranks, they'll have to be manually inserted into the database at the moment until we add further routes
27 lines
854 B
Rust
27 lines
854 B
Rust
use serde::{Deserialize, Serialize};
|
|
use crate::nats::authservice::UserPrivateToken;
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct DerankEntry {
|
|
pub urlmatch: String,
|
|
pub and: Option<String>,
|
|
pub unless: Option<String>,
|
|
pub multiplier: f64,
|
|
pub comment: Option<String>,
|
|
}
|
|
|
|
/// # UserFetchActiveDeranksRequest
|
|
/// sent from frontend -> authsrvc to receive all applicable derank entries
|
|
/// expecting a AuthServiceResponse::UserFetchActiveDeranksResponse back
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct UserFetchActiveDeranksRequest {
|
|
pub token: UserPrivateToken,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub enum UserFetchActiveDeranksResponse {
|
|
Success(Vec<DerankEntry>),
|
|
InternalServerError,
|
|
/// sent if the token is invalid, and the account should be logged out
|
|
Logout,
|
|
}
|