init: ShowenV2 项目骨架 — 数字生命窗口平台
- core/ 跨平台内核骨架 (Plugin trait, Message, ServiceManager, Config) - plugins/ 空桩 (video, http, ble, screen, wifi) - PROGRESS.md 进度跟踪, TEAM.md 团队档案 - cargo check 零 warning 通过 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
39
src/plugins/http/mod.rs
Normal file
39
src/plugins/http/mod.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
//! HttpPlugin — Web UI + REST API
|
||||
//!
|
||||
//! 基于 warp 的 HTTP 服务,提供播放控制、配置管理、视频管理等 API。
|
||||
|
||||
use crate::core::message::Message;
|
||||
use crate::core::plugin::{Plugin, PluginContext, PluginInfo, Platform};
|
||||
use anyhow::Result;
|
||||
|
||||
pub struct HttpPlugin {
|
||||
ctx: Option<PluginContext>,
|
||||
}
|
||||
|
||||
impl HttpPlugin {
|
||||
pub fn new() -> Self {
|
||||
Self { ctx: None }
|
||||
}
|
||||
}
|
||||
|
||||
impl Plugin for HttpPlugin {
|
||||
fn id(&self) -> &'static str { "http" }
|
||||
|
||||
fn info(&self) -> PluginInfo {
|
||||
PluginInfo {
|
||||
name: "HTTP API",
|
||||
version: "0.2.0",
|
||||
description: "Web UI + REST API (warp)",
|
||||
platform: Platform::Any,
|
||||
}
|
||||
}
|
||||
|
||||
fn init(&mut self, ctx: PluginContext) -> Result<()> {
|
||||
self.ctx = Some(ctx);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn start(&mut self) -> Result<()> { Ok(()) }
|
||||
fn handle_message(&mut self, _msg: Message) -> Result<()> { Ok(()) }
|
||||
fn stop(&mut self) -> Result<()> { Ok(()) }
|
||||
}
|
||||
Reference in New Issue
Block a user