Skip to content

Commit 7945d60

Browse files
committed
feat: add announcement system with public bar, admin CRUD, and audit logging
1 parent 2a09b0f commit 7945d60

43 files changed

Lines changed: 1809 additions & 276 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/开发板管理租赁平台-功能需求.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
## 1. 角色与权限
88

99
- **匿名访客**:浏览公开资源、文档、条款。
10-
- **普通用户**:申请租赁、使用会话、上传镜像、串口调试。
10+
- **注册用户**:申请租赁、使用会话、上传镜像、串口调试。
1111
- **管理员**:管理库存、用户、角色、电源、TFTP、服务器配置。
1212
- **RBAC**`roles` / `permissions` / `user_roles` / `role_permissions`,权限按模块分组。
1313
- **账号开通**:支持自助注册 + 管理员开通两种途径;密码 ≥ 8 位;支持禁用、重置。
@@ -118,7 +118,7 @@
118118
## 12. 验收标准
119119

120120
1. 匿名访客可浏览资源、文档、条款。
121-
2. 普通用户可完成:登录 → 申请租赁 → 创建会话 → 上传镜像 → 连接串口 → 上下电 → 启动 → 释放 全链路。
121+
2. 注册用户可完成:登录 → 申请租赁 → 创建会话 → 上传镜像 → 连接串口 → 上下电 → 启动 → 释放 全链路。
122122
3. 管理员可完成:开通账号 → 配板/电源/启动 → 发布资源 → 监控租约 → 审计 全链路。
123123
4. 会话过期或释放后板回可用池、临时文件清理。
124124
5. 敏感操作有审计记录。

image.png

-251 KB
Binary file not shown.

ostool-server/src/api/dto.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ use crate::{
1010
dtb_store::DtbFile,
1111
session::Session,
1212
state::BoardLeaseState,
13-
storage::{AuditLog, DtbMetadata, IssueSession, Lease, Permission, Role, SessionRecord},
13+
storage::{
14+
Announcement, AuditLog, DtbMetadata, IssueSession, Lease, Permission, Role, SessionRecord,
15+
},
1416
tftp::{files::TftpFileRef, status::TftpStatus},
1517
};
1618

@@ -410,6 +412,25 @@ pub struct AdminIssueSessionUpdateRequest {
410412
pub resolution: Option<String>,
411413
}
412414

415+
#[derive(Debug, Clone, Serialize, Deserialize)]
416+
pub struct AnnouncementResponse {
417+
pub announcement: Announcement,
418+
}
419+
420+
#[derive(Debug, Clone, Serialize, Deserialize)]
421+
pub struct AnnouncementsResponse {
422+
pub announcements: Vec<AnnouncementResponse>,
423+
}
424+
425+
#[derive(Debug, Clone, Serialize, Deserialize)]
426+
pub struct AdminAnnouncementUpsertRequest {
427+
pub title: String,
428+
pub content: String,
429+
pub kind: String,
430+
pub status: String,
431+
pub pinned: bool,
432+
}
433+
413434
#[derive(Debug, Clone, Serialize, Deserialize)]
414435
pub struct SerialStatusResponse {
415436
pub available: bool,

0 commit comments

Comments
 (0)