go-chat/message/message.go

29 lines
384 B
Go
Raw Normal View History

2021-04-22 06:12:35 +00:00
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
}