feat(distribution): 站内信与通知体系多租户独立分支隔离

- 新增 000071 数据库迁移:notifications 表支持 distribution_site_id 并自动回填历史分销订单通知
- 通知自动归属:在事务内根据订单或申诉自动关联当前分销站点 ID
- 隔离查询与已读控制:列表、未读统计与批量已读均严格按站点隔离,防止主站与分站交叉泄漏
- 前台界面联动:消息中心通知 Tab 及移动端/PC端站内信页面展示分站专属标识与精准过滤
This commit is contained in:
yml2213
2026-09-07 19:10:02 +08:00
parent e024319860
commit 4461e7929e
11 changed files with 472 additions and 86 deletions
+5 -4
View File
@@ -8,10 +8,11 @@ type Notification struct {
Type string `gorm:"size:32;not null" json:"type"`
Title string `gorm:"size:128;not null" json:"title"`
Content string `json:"content"`
BizType string `gorm:"size:32;not null;default:''" json:"biz_type"`
BizID *uint64 `json:"biz_id"`
ReadAt *time.Time `json:"read_at"`
CreatedAt time.Time `json:"created_at"`
BizType string `gorm:"size:32;not null;default:''" json:"biz_type"`
BizID *uint64 `json:"biz_id"`
DistributionSiteID *uint64 `gorm:"index" json:"distribution_site_id"`
ReadAt *time.Time `json:"read_at"`
CreatedAt time.Time `json:"created_at"`
}
func (Notification) TableName() string {