server: Go 服务器(REST+WSS 网关+JWT+Argon2+配对+素材直链+任务状态机);修复并发下线 send-on-closed-channel、下发查询 SQL 优先级、配对码原子占用、上传体积上限、JWT 默认密钥告警

This commit is contained in:
Qiufeng
2026-08-20 20:38:21 +08:00
parent bf25d8beac
commit cc8845dcec
44 changed files with 4995 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
package handlers
import (
"gorm.io/gorm"
"everypublish/server/internal/models"
)
// Notify 写入站内通知(批量用户)
func Notify(db *gorm.DB, wsid uint64, userIDs []uint64, kind, title, content string) error {
if len(userIDs) == 0 {
return nil
}
rows := make([]models.Notification, 0, len(userIDs))
for _, uid := range userIDs {
rows = append(rows, models.Notification{
WorkspaceID: wsid,
UserID: uid,
Kind: kind,
Title: title,
Content: content,
})
}
return db.Create(&rows).Error
}