Browse Source

增加id查询用户信息方法

master v0.4.0
guzeng 2 years ago
parent
commit
6748dc30aa
2 changed files with 36 additions and 0 deletions
  1. +30
    -0
      user.pb.go
  2. +6
    -0
      user.proto

+ 30
- 0
user.pb.go View File

@ -11,6 +11,7 @@ It is generated from these files:
It has these top-level messages: It has these top-level messages:
UserRequest UserRequest
UserInfoByUsername UserInfoByUsername
UserInfoById
UserInfoByUsercode UserInfoByUsercode
UserResponse UserResponse
LoginRequest LoginRequest
@ -84,6 +85,31 @@ func (m *UserInfoByUsername) GetUsername() string {
return "" 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查询用户信息请求结构 // 使用usercode查询用户信息请求结构
type UserInfoByUsercode struct { type UserInfoByUsercode struct {
Dbname *string `protobuf:"bytes,1,opt,name=dbname" json:"dbname,omitempty"` Dbname *string `protobuf:"bytes,1,opt,name=dbname" json:"dbname,omitempty"`
@ -453,6 +479,7 @@ type UserService interface {
BindThird(in *Request, out *Response) error BindThird(in *Request, out *Response) error
GetThird(in *Request, out *Response) error GetThird(in *Request, out *Response) error
GetBusiness(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 // 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 { func (c *UserServiceClient) GetBusiness(in *Request, out *Response) error {
return c.Call("UserService.GetBusiness", in, out) 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. // DialUserService connects to an UserService at the specified network address.
func DialUserService(network, addr string) (*UserServiceClient, *rpc.Client, error) { func DialUserService(network, addr string) (*UserServiceClient, *rpc.Client, error) {


+ 6
- 0
user.proto View File

@ -11,6 +11,11 @@ message UserInfoByUsername {
string dbname = 1; string dbname = 1;
string username = 2; string username = 2;
} }
// 使userid查询用户信息请求结构
message UserInfoById {
string dbname = 1;
string userid = 2;
}
// 使usercode查询用户信息请求结构 // 使usercode查询用户信息请求结构
message UserInfoByUsercode { message UserInfoByUsercode {
@ -84,4 +89,5 @@ service UserService {
rpc bindThird (Request) returns (Response); // rpc bindThird (Request) returns (Response); //
rpc getThird(Request) returns (Response); // rpc getThird(Request) returns (Response); //
rpc getBusiness(Request) returns (Response); // rpc getBusiness(Request) returns (Response); //
rpc getById(Request) returns (Response); //
} }

Loading…
Cancel
Save