重构代码结构与认证体系,集成异步任务消费者

This commit is contained in:
2025-11-17 18:38:10 +08:00
parent a97c970166
commit a245229bc2
70 changed files with 2000 additions and 2334 deletions

18
web/events/channel.go Normal file
View File

@@ -0,0 +1,18 @@
package events
import (
"encoding/json"
"github.com/hibiken/asynq"
"log/slog"
)
const RemoveChannel = "channel:remove"
func NewRemoveChannel(ids []int32) *asynq.Task {
bytes, err := json.Marshal(ids)
if err != nil {
slog.Error("序列化删除通道任务失败", "error", err)
return nil
}
return asynq.NewTask(RemoveChannel, bytes)
}