feat: 公告系统 — Phase 2 完成

- Model/Repo/Service/Controller 全栈实现
- CRUD + ListActive(生效时间范围过滤)
- 管理后台独立页面 /admin/announcements(列表+弹窗CRUD)
- 前台首页 Hero 下方公告栏(info/success/warning/error 四色)
- Moderator+ 权限可管理公告
This commit is contained in:
2026-06-22 00:00:21 +08:00
parent 2d1dd5d401
commit fc57ed17d4
15 changed files with 837 additions and 8 deletions

View File

@ -368,6 +368,61 @@
flex-shrink: 0;
}
/* --- Announcement Bar --- */
.announcement-bar {
max-width: 900px;
margin: 0 auto;
padding: 0 16px;
display: flex;
flex-direction: column;
gap: 6px;
margin-bottom: 1.5rem;
}
.announcement-item {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 16px;
border-radius: 8px;
font-size: 14px;
border-left: 4px solid;
}
.announcement-title {
font-weight: 650;
white-space: nowrap;
}
.announcement-content {
color: #374151;
flex: 1;
}
.announcement-info {
background: #dbeafe;
border-color: #3b82f6;
}
.announcement-info .announcement-title { color: #1d4ed8; }
.announcement-success {
background: #dcfce7;
border-color: #22c55e;
}
.announcement-success .announcement-title { color: #15803d; }
.announcement-warning {
background: #fef3c7;
border-color: #f59e0b;
}
.announcement-warning .announcement-title { color: #b45309; }
.announcement-error {
background: #fee2e2;
border-color: #ef4444;
}
.announcement-error .announcement-title { color: #dc2626; }
/* ---------- Responsive ---------- */
@media (max-width: 960px) {
.home-grid {