syntax="proto3"; package protos; option go_package = ".;protos"; /// login 服务器到客户端通信协议 json // 用户注册类型 enum RegType { REG_EMAIL = 0; REG_PHONE = 1; } // 请求图片验证码 message ReqVerifyImg { } message RespVerifyImg { string b64id = 1; string b64img = 2; } // 请求验证码 // 发送至邮箱(手机) message ReqVerifyCode { string username = 1; // email/phone string b64id = 2; string imgCode = 3; } message RespVerifyCode { int32 needVerify = 1; } // 注册 message ReqRegister { int32 regType = 1; // 注册类型 optional 定义在 RegType,这里用整型表示 string username = 2; // 注册使用手机或邮箱 string password = 3; // 验证码 string verifyCode = 4; int32 platform = 7; // 客户端平台 int32 pulish = 8; // 渠道 } message RespRegister { string username = 1; uint64 userId = 3; string token = 4; string url = 5; // 注册成功不需要再次登录的情况,相当与登录成功的跳转 } // 注销 message ReqDestroy { uint64 userId = 1; string token = 2; string verifyCode = 3; } message RespDestroy { } // 登录 message ReqLogin { string username = 1; // email/phone string password = 4; string b64id = 5; string imgCode = 6; string verifyCode = 7; } message RespLogin { uint64 userId = 1; string username = 3; string token = 5; string redirect = 6; }