feat: support text ping pong

This commit is contained in:
withchao
2024-11-04 11:36:20 +08:00
parent ee04c156b5
commit b49a8dd99d
2 changed files with 38 additions and 3 deletions
+11
View File
@@ -16,6 +16,7 @@ package msggateway
import (
"context"
"encoding/json"
"sync"
"github.com/go-playground/validator/v10"
@@ -31,6 +32,16 @@ import (
"github.com/openimsdk/tools/utils/jsonutil"
)
const (
TextPing = "ping"
TextPong = "pong"
)
type TextMessage struct {
Type string `json:"type"`
Body json.RawMessage `json:"body"`
}
type Req struct {
ReqIdentifier int32 `json:"reqIdentifier" validate:"required"`
Token string `json:"token"`