🎉 init

This commit is contained in:
JMARyA 2025-04-28 18:44:09 +02:00
commit 812c4adb15
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
16 changed files with 4631 additions and 0 deletions

22
src/server_core/model.rs Normal file
View file

@ -0,0 +1,22 @@
use crate::api;
use crate::generate_token;
use owl::prelude::*;
#[model]
pub struct Machine {
pub id: Id,
pub hostname: String,
pub token: String,
pub next_token: Option<String>,
}
impl Machine {
pub fn from_join_param(join: api::JoinParams) -> Self {
Self {
id: Id::String(join.machine_id),
hostname: join.hostname.trim().to_string(),
token: generate_token(),
next_token: None,
}
}
}