feat: 完善后端脚手架基础能力
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package ws
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
EventWelcome = "welcome"
|
||||
EventMessage = "message"
|
||||
EventPresence = "presence"
|
||||
EventError = "error"
|
||||
)
|
||||
|
||||
type IncomingMessage struct {
|
||||
Type string `json:"type" binding:"required" example:"message"`
|
||||
Data string `json:"data" binding:"required" example:"hello"`
|
||||
}
|
||||
|
||||
type OutgoingMessage struct {
|
||||
Type string `json:"type"`
|
||||
Room string `json:"room,omitempty"`
|
||||
ClientID string `json:"client_id,omitempty"`
|
||||
Data string `json:"data,omitempty"`
|
||||
Online int `json:"online,omitempty"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
}
|
||||
Reference in New Issue
Block a user