Browse Source

增加getbyusername方法

master v0.1.1
guzeng 3 years ago
parent
commit
fe4f34b953
2 changed files with 10 additions and 0 deletions
  1. +8
    -0
      user.pb.go
  2. +2
    -0
      user.proto

+ 8
- 0
user.pb.go View File

@ -380,6 +380,8 @@ func init() {
type UserService interface {
GetByToken(in *UserRequest, out *UserResponse) error
Login(in *LoginRequest, out *LoginResponse) error
GetByUsername(in *UserInfoByUsername, out *UserResponse) error
GetByUsercode(in *UserInfoByUsercode, out *UserResponse) error
}
// AcceptUserServiceClient accepts connections on the listener and serves requests
@ -457,6 +459,12 @@ func (c *UserServiceClient) GetByToken(in *UserRequest, out *UserResponse) error
func (c *UserServiceClient) Login(in *LoginRequest, out *LoginResponse) error {
return c.Call("UserService.Login", in, out)
}
func (c *UserServiceClient) GetByUsername(in *UserInfoByUsername, out *UserResponse) error {
return c.Call("UserService.GetByUsername", in, out)
}
func (c *UserServiceClient) GetByUsercode(in *UserInfoByUsercode, out *UserResponse) error {
return c.Call("UserService.GetByUsercode", in, out)
}
// DialUserService connects to an UserService at the specified network address.
func DialUserService(network, addr string) (*UserServiceClient, *rpc.Client, error) {


+ 2
- 0
user.proto View File

@ -65,4 +65,6 @@ message LoginResponse {
service UserService {
rpc getByToken (UserRequest) returns (UserResponse); // 使token查询用户
rpc login (LoginRequest) returns (LoginResponse); //
rpc getByUsername (UserInfoByUsername) returns (UserResponse); // 使username查询用户
rpc getByUsercode (UserInfoByUsercode) returns (UserResponse); // 使usercode查询用户
}

Loading…
Cancel
Save