go-chat/message/message.go
2021-04-22 14:12:35 +08:00

29 lines
384 B
Go

package message
import (
"reflect"
)
var MsgType = map[string]reflect.Type{
"login_send": reflect.TypeOf(&LoginS{}).Elem(),
"login_response": reflect.TypeOf(&Correspond{}).Elem(),
}
type Message struct {
//Id int
Type string
Data interface{}
}
type LoginS struct {
Uid int
Pw string
Name string
}
type Correspond struct {
Code int
Msg string
Error string
}