- Added all seven issued service trees without omissions. - Preserved the supplied runtime configuration, binaries, and assets.
100 lines
2.1 KiB
Rust
Executable File
100 lines
2.1 KiB
Rust
Executable File
use chrono::NaiveDateTime;
|
|
use serde::{Deserialize, Serialize};
|
|
use uuid::Uuid;
|
|
|
|
use crate::models::Role;
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct AuthRequest {
|
|
pub username: String,
|
|
pub password: String,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct AuthResponse {
|
|
pub token: String,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct CheckAuthRequest {
|
|
pub token: String,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct MeResponse {
|
|
pub username: String,
|
|
pub workspace_id: Option<Uuid>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct NewAuthPolicy {
|
|
pub name: String,
|
|
pub content: String,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct ChangePasswordRequest {
|
|
pub current_password: String,
|
|
pub new_password: String,
|
|
}
|
|
|
|
#[derive(Deserialize, Serialize)]
|
|
pub struct NewFile {
|
|
name: String,
|
|
content: String,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
|
|
pub struct FileResponse {
|
|
pub id: Uuid,
|
|
pub name: String,
|
|
pub size: i64,
|
|
pub is_public: bool,
|
|
pub owner: String,
|
|
pub created_at: NaiveDateTime,
|
|
#[serde(default)]
|
|
pub shared: bool,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct WorkspaceParticipantResponse {
|
|
pub id: Uuid,
|
|
pub username: String,
|
|
pub role: Role,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct MyWorkspaceResponse {
|
|
pub id: Uuid,
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
pub participants: Vec<WorkspaceParticipantResponse>,
|
|
|
|
pub auth_policy: Option<String>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct NewWorkspace {
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct WorkspaceResponse {
|
|
pub id: Uuid,
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
pub struct AddUserRequest {
|
|
pub username: String,
|
|
}
|
|
|
|
#[derive(Deserialize, Serialize)]
|
|
pub struct NewSession {
|
|
pub user_id: Uuid,
|
|
pub cookie: String,
|
|
pub expires_at: NaiveDateTime,
|
|
}
|