Merge branch 'master' of https://gitee.com/oneao/workspace
This commit is contained in:
commit
51622a4b1a
12 files changed
+306
-92
No files matched your search
@@ -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{
|
||||
|
||||
Reference in new issue
Block a user