Files
easygoadmin-wiki/EasyGoAdmin_GoFrame_EleVue/zh/modules/content.md
T
2026-10-20 21:19:44 +08:00

52 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 6.8 公告与链接管理
:::tip 概述
内容域还有两个租户级模块:通知公告(goframe_notice)与友情链接(goframe_link)。公告带状态开关,友链无状态列——两者均为标准 CRUD 的典型代表。
:::
## 通知公告(goframe_notice,/api/notice)
```text
七件套 + PUT /api/notice/status(sys:notice:status)
sys:notice:{page|list|detail|add|update|delete|batchDelete|status}
```
| 特征 | 说明 |
|------|------|
| status | 1-正常 2-禁用(注释枚举,字典驱动 {field}Text) |
| 租户级 | 各租户独立公告 |
| 文件字段 | 支持附件(FileFields 模式) |
| 富文本 | 内容字段可按 ContentFields 声明(如启用富文本编辑) |
## 友情链接(goframe_link,/api/link)
```text
七件套(无 status 接口)
sys:link:{page|list|detail|add|update|delete|batchDelete}
```
| 特征 | 说明 |
|------|------|
| 无 status 列 | 表结构无状态字段,不声明 Status 接口 |
| 租户级 | 各租户独立友链 |
| URL 字段 | website/site/url 等列不作模糊筛选列(生成器 isUrlField 判定) |
## 标准 CRUD 模式的教学价值
两个模块都是"最小差异"的标准形态——新模块开发可直接对照:
```text
差异只体现在:
* SerializeMaps(status → notice_status)
* LikeFields/EqFields 筛选声明
* FileFields/ContentFields(如有文件/富文本列)
* 有无 Status 接口(看表有无 status 列)
其余七件套结构与 example 模块完全一致(见第 3 章)。
```
## 管理建议
+ 公告状态用于"草稿/下架"语义(禁用后前端不展示)
+ 友链删除无守卫(软删可恢复);批量删除支持勾选操作
+ 两者均为租户级——平台统一公告场景需在租户维度分别维护(或扩展平台共享行 tenant_id=0,需业务确认)