feat: Implement backend commands for plugin data management and enhance frontend synchronization with updated plugin interfaces
This commit is contained in:
1 parent
78f22f65f4
commit
83be780243
35 files changed
+5261
-2208
No files matched your search
@@ -0,0 +1,49 @@
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use super::repository::RepositorySource;
|
||||
|
||||
/// Represents a Minecraft plugin with detailed information
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
pub struct Plugin {
|
||||
pub name: String,
|
||||
pub version: String,
|
||||
pub latest_version: Option<String>,
|
||||
pub description: Option<String>,
|
||||
pub authors: Vec<String>,
|
||||
pub website: Option<String>,
|
||||
pub has_update: bool,
|
||||
pub api_version: Option<String>,
|
||||
pub main_class: Option<String>,
|
||||
pub depend: Option<Vec<String>>,
|
||||
pub soft_depend: Option<Vec<String>>,
|
||||
pub load_before: Option<Vec<String>>,
|
||||
pub commands: Option<serde_json::Value>,
|
||||
pub permissions: Option<serde_json::Value>,
|
||||
pub file_path: String,
|
||||
pub file_hash: String,
|
||||
pub changelog: Option<String>, // Changelog for the latest version
|
||||
// Fields for persistence
|
||||
pub repository_source: Option<RepositorySource>,
|
||||
pub repository_id: Option<String>,
|
||||
pub repository_url: Option<String>, // URL to the plugin page on the repository
|
||||
}
|
||||
|
||||
/// Raw metadata extracted from a plugin.yml file
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
pub struct PluginMeta {
|
||||
pub name: String,
|
||||
pub version: String,
|
||||
pub description: Option<String>,
|
||||
pub authors: Vec<String>,
|
||||
pub website: Option<String>,
|
||||
pub api_version: Option<String>,
|
||||
pub main_class: Option<String>,
|
||||
pub depend: Option<Vec<String>>,
|
||||
pub soft_depend: Option<Vec<String>>,
|
||||
pub load_before: Option<Vec<String>>,
|
||||
pub commands: Option<serde_json::Value>,
|
||||
pub permissions: Option<serde_json::Value>,
|
||||
pub file_path: String,
|
||||
pub file_size: u64,
|
||||
pub file_hash: String,
|
||||
}
|
||||
Reference in new issue
Block a user