pinakes-server: split dto module into submodules
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I1e9421d79010813992feb2b26c44d6796a6a6964
This commit is contained in:
parent
e66a2231b7
commit
d77e5b9f2f
21 changed files with 1530 additions and 1443 deletions
37
crates/pinakes-server/src/dto/plugins.rs
Normal file
37
crates/pinakes-server/src/dto/plugins.rs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct PluginResponse {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub version: String,
|
||||
pub author: String,
|
||||
pub description: String,
|
||||
pub api_version: String,
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct InstallPluginRequest {
|
||||
pub source: String, // URL or file path
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct TogglePluginRequest {
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
impl PluginResponse {
|
||||
#[must_use]
|
||||
pub fn new(meta: pinakes_plugin_api::PluginMetadata, enabled: bool) -> Self {
|
||||
Self {
|
||||
id: meta.id,
|
||||
name: meta.name,
|
||||
version: meta.version,
|
||||
author: meta.author,
|
||||
description: meta.description,
|
||||
api_version: meta.api_version,
|
||||
enabled,
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue