20260626221809

This commit is contained in:
oneao committed 2026-06-26 22:18:09 +08:00
1 parent 5983d29128
commit a45accd2de
12 files changed
+306 -92

No files matched your search

+4 -3
View File
@@ -2,6 +2,7 @@ package ws
import (
"allapp-go/internal/httpx"
"allapp-go/internal/middleware"
"allapp-go/pkg/db"
"allapp-go/pkg/jwtx"
"allapp-go/pkg/uniqueid"
@@ -195,7 +196,7 @@ func (c *Client) readPump() {
// handleSend 处理发送消息
func (c *Client) handleSend(msg clientSendMsg) {
ctx := context.Background()
ctx := context.WithValue(context.Background(), middleware.CtxUserIDKey, c.userID)
dbClient := db.New()
msgID := uniqueid.NextId()
@@ -293,7 +294,7 @@ func (c *Client) handleSend(msg clientSendMsg) {
// handleRecall 处理撤回(发送者 2 分钟内)
func (c *Client) handleRecall(msg clientSendMsg) {
ctx := context.Background()
ctx := context.WithValue(context.Background(), middleware.CtxUserIDKey, c.userID)
dbClient := db.New()
rows, err := dbClient.LoadData(ctx, "b_chat",
@@ -337,7 +338,7 @@ func (c *Client) handleDelete(msg clientSendMsg) {
return
}
ctx := context.Background()
ctx := context.WithValue(context.Background(), middleware.CtxUserIDKey, c.userID)
dbClient := db.New()
if err := dbClient.Update(ctx, "b_chat", "id", map[string]any{