Exemple #1
0
func (this *signUp) Handle(req *pb.Request, res *pb.Response, conn *Connection) error {
	fmt.Println("sign up..")
	sign := req.GetSign()
	SignIn(conn.Id, sign.GetEmail())
	res.Code = pb.Code_OK.Enum()
	return nil
}
Exemple #2
0
func Handle(request *pb.Request, response *pb.Response, conn *Connection) error {
	module := request.GetModule()
	handler, ok := handlers[module]
	if !ok {
		response = &pb.Response{Code: pb.Code_MODULE_NOT_EXIST.Enum()}
		Log.Alertf("%v request not exist module %v with %v", conn.Conn.RemoteAddr(), module, request)
		return nil
	}
	return handler.Handle(request, response, conn)
}