feat: 实现端停用与删除的消息作废与群主转让级联

This commit is contained in:
Nixevol
2026-09-30 08:06:55 +08:00
parent 0efcfbb8b6
commit 23f0342769
8 changed files with 1143 additions and 16 deletions
+5
View File
@@ -7,6 +7,7 @@ import (
"sync"
"time"
"git.asio.asia/nixevol/NixMsg/internal/app/identity"
"git.asio.asia/nixevol/NixMsg/internal/auth"
"git.asio.asia/nixevol/NixMsg/internal/store"
)
@@ -38,6 +39,8 @@ type Deps struct {
SecureCookies bool
// KickEndpoint 踢下线钩子(只断开连接);nil 时踢线为 no-op。
KickEndpoint EndpointKickFunc
// Identity 端停用/启用/删除级联(I5);nil 时回退为仅改 enabled/删行。
Identity identity.Service
}
// Handler 是可挂载的管理接口(路由前缀 /api/admin/)。
@@ -51,6 +54,7 @@ type Handler struct {
ttl time.Duration
forceSec bool
kick EndpointKickFunc
identity identity.Service
mux *http.ServeMux
@@ -80,6 +84,7 @@ func New(d Deps) *Handler {
ttl: ttl,
forceSec: d.SecureCookies,
kick: d.KickEndpoint,
identity: d.Identity,
mux: http.NewServeMux(),
lastUsed: make(map[string]time.Time),
}