From 6748dc30aaefa566bb865594796a73bcb5ddbfe1 Mon Sep 17 00:00:00 2001 From: guzeng Date: Tue, 17 Aug 2021 23:33:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0id=E6=9F=A5=E8=AF=A2=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- user.pb.go | 30 ++++++++++++++++++++++++++++++ user.proto | 6 ++++++ 2 files changed, 36 insertions(+) diff --git a/user.pb.go b/user.pb.go index 2db43eb..18d20a9 100644 --- a/user.pb.go +++ b/user.pb.go @@ -11,6 +11,7 @@ It is generated from these files: It has these top-level messages: UserRequest UserInfoByUsername + UserInfoById UserInfoByUsercode UserResponse LoginRequest @@ -84,6 +85,31 @@ func (m *UserInfoByUsername) GetUsername() string { return "" } +// 使用userid查询用户信息请求结构 +type UserInfoById struct { + Dbname *string `protobuf:"bytes,1,opt,name=dbname" json:"dbname,omitempty"` + Userid *string `protobuf:"bytes,2,opt,name=userid" json:"userid,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *UserInfoById) Reset() { *m = UserInfoById{} } +func (m *UserInfoById) String() string { return proto.CompactTextString(m) } +func (*UserInfoById) ProtoMessage() {} + +func (m *UserInfoById) GetDbname() string { + if m != nil && m.Dbname != nil { + return *m.Dbname + } + return "" +} + +func (m *UserInfoById) GetUserid() string { + if m != nil && m.Userid != nil { + return *m.Userid + } + return "" +} + // 使用usercode查询用户信息请求结构 type UserInfoByUsercode struct { Dbname *string `protobuf:"bytes,1,opt,name=dbname" json:"dbname,omitempty"` @@ -453,6 +479,7 @@ type UserService interface { BindThird(in *Request, out *Response) error GetThird(in *Request, out *Response) error GetBusiness(in *Request, out *Response) error + GetById(in *Request, out *Response) error } // AcceptUserServiceClient accepts connections on the listener and serves requests @@ -545,6 +572,9 @@ func (c *UserServiceClient) GetThird(in *Request, out *Response) error { func (c *UserServiceClient) GetBusiness(in *Request, out *Response) error { return c.Call("UserService.GetBusiness", in, out) } +func (c *UserServiceClient) GetById(in *Request, out *Response) error { + return c.Call("UserService.GetById", in, out) +} // DialUserService connects to an UserService at the specified network address. func DialUserService(network, addr string) (*UserServiceClient, *rpc.Client, error) { diff --git a/user.proto b/user.proto index 905707b..50773aa 100644 --- a/user.proto +++ b/user.proto @@ -11,6 +11,11 @@ message UserInfoByUsername { string dbname = 1; string username = 2; } +// 使用userid查询用户信息请求结构 +message UserInfoById { + string dbname = 1; + string userid = 2; +} // 使用usercode查询用户信息请求结构 message UserInfoByUsercode { @@ -84,4 +89,5 @@ service UserService { rpc bindThird (Request) returns (Response); // 绑定第三方账号 rpc getThird(Request) returns (Response); // 查询第三方账号 rpc getBusiness(Request) returns (Response); // 查询商户 + rpc getById(Request) returns (Response); // 查询用户 } \ No newline at end of file