notifications 通知表
| 字段名 | 字段类型 | 字段注释 | 默认值 | 可空 | 备注 |
|---|---|---|---|---|---|
| id | bigint UNSIGNED | 主键 ID | NO | 自动递增 | |
| nmid | varchar(32) | 对外公开 ID | NO | 唯一值 | |
| type | tinyint UNSIGNED | 通知类型 | NO | ||
| user_id | bigint UNSIGNED | 用户 ID | NO | 关联字段 users->id,这条通知属于谁 | |
| content | json | 通知内容 | YES | 多语言 涉及到帖子或评论时,可存储摘要内容 | |
| is_markdown | tinyint UNSIGNED | 内容是否为 MD 格式 | 0 | NO | 0.否 / 1.是 |
| is_mention | tinyint UNSIGNED | 是否为提及通知 | 0 | NO | 0.否 / 1.是 别人内容里提及了我,然后互动通知的我 |
| is_access_app | varchar(64) | 是否访问应用页 | 0 | NO | 将输出 app_fskey 的访问地址 |
| app_fskey | varchar(64) | 关联应用 | YES | 关联字段 apps->fskey 由哪个插件生成的通知消息 | |
| action_user_id | bigint UNSIGNED | 触发的用户 ID | YES | 关联字段 users->id | |
| action_is_anonymous | tinyint UNSIGNED | 是否匿名触发 | 0 | NO | 0.否 / 1.是 |
| action_type | smallint UNSIGNED | 触发行为类型 | YES | 1.赞 2.踩 3.关注 4.屏蔽 5.发表 6.编辑 7.删除 8.置顶 9.设精 10.管理 | |
| action_target | tinyint UNSIGNED | 触发目标 | YES | 内容类型编号 | |
| action_id | bigint UNSIGNED | 触发目标 ID | YES | 这条通知来源由哪个内容 | |
| action_content_id | bigint UNSIGNED | 帖子或评论 ID | YES | 关联字段 posts->id 或者 comments->id | |
| is_read | tinyint UNSIGNED | 阅读状态 | 0 | NO | 0.未读 / 1.已读 |
| created_at | timestamp | 创建时间 | useCurrent | NO | 比如 MySQL 默认值为 CURRENT_TIMESTAMP |
| updated_at | timestamp | 更新时间 | YES | ||
| deleted_at | timestamp | 删除时间 | YES |
通知类型介绍
1系统通知2推荐内容3赞4踩5关注6屏蔽7提及(艾特)8评论(回复)9引用(转发)
系统消息解读
type=1代表系统给你发了一条content消息内容is_access_plugin是否访问插件页action_user_id是否有触发用户action_target + action_id是否有触发来源内容
推荐消息解读
type=2代表系统给你推荐了内容content推荐语is_access_plugin是否访问插件页action_user_id是否有触发用户action_target + action_id推荐的内容
互动消息解读
type=3代表action_user_id赞了你的action_target + action_idtype=4代表action_user_id踩了你的action_target + action_idtype=5代表action_user_id关注了你的action_target + action_idtype=6代表action_user_id屏蔽了你的action_target + action_idtype=7代表action_user_id在action_target + action_id中提及了你content提及内容的摘要
type=8代表action_user_id评论了你的action_target + action_id内容content评论内容的摘要action_content_id他的评论 ID
type=9代表action_user_id引用了你的action_target=4 + action_id帖子content他的内容摘要action_post_id他的帖子 ID