用户接口远程调用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

724 lines
21 KiB

// Code generated by protoc-gen-go.
// source: user.proto
// DO NOT EDIT!
/*
Package userrpc is a generated protocol buffer package.
It is generated from these files:
user.proto
It has these top-level messages:
UserRequest
UserInfoByUsername
UserInfoById
UserInfoByUsercode
UserResponse
LoginRequest
LoginResponse
Request
Response
*/
package userrpc
import proto "github.com/chai2010/protorpc/proto"
import math "math"
import "io"
import "log"
import "net"
import "net/rpc"
import "time"
import protorpc "github.com/chai2010/protorpc"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = math.Inf
// 使用token查询用户信息请求结构
type UserRequest struct {
Dbname *string `protobuf:"bytes,1,opt,name=dbname" json:"dbname,omitempty"`
Token *string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *UserRequest) Reset() { *m = UserRequest{} }
func (m *UserRequest) String() string { return proto.CompactTextString(m) }
func (*UserRequest) ProtoMessage() {}
func (m *UserRequest) GetDbname() string {
if m != nil && m.Dbname != nil {
return *m.Dbname
}
return ""
}
func (m *UserRequest) GetToken() string {
if m != nil && m.Token != nil {
return *m.Token
}
return ""
}
// 使用username查询用户信息请求结构
type UserInfoByUsername struct {
Dbname *string `protobuf:"bytes,1,opt,name=dbname" json:"dbname,omitempty"`
Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *UserInfoByUsername) Reset() { *m = UserInfoByUsername{} }
func (m *UserInfoByUsername) String() string { return proto.CompactTextString(m) }
func (*UserInfoByUsername) ProtoMessage() {}
func (m *UserInfoByUsername) GetDbname() string {
if m != nil && m.Dbname != nil {
return *m.Dbname
}
return ""
}
func (m *UserInfoByUsername) GetUsername() string {
if m != nil && m.Username != nil {
return *m.Username
}
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"`
Usercode *string `protobuf:"bytes,2,opt,name=usercode" json:"usercode,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *UserInfoByUsercode) Reset() { *m = UserInfoByUsercode{} }
func (m *UserInfoByUsercode) String() string { return proto.CompactTextString(m) }
func (*UserInfoByUsercode) ProtoMessage() {}
func (m *UserInfoByUsercode) GetDbname() string {
if m != nil && m.Dbname != nil {
return *m.Dbname
}
return ""
}
func (m *UserInfoByUsercode) GetUsercode() string {
if m != nil && m.Usercode != nil {
return *m.Usercode
}
return ""
}
// 使用token查询用户信息响应结构
type UserResponse struct {
UserId *string `protobuf:"bytes,1,opt,name=user_id" json:"user_id,omitempty"`
Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
Nickname *string `protobuf:"bytes,3,opt,name=nickname" json:"nickname,omitempty"`
Mobile *string `protobuf:"bytes,4,opt,name=mobile" json:"mobile,omitempty"`
Email *string `protobuf:"bytes,5,opt,name=email" json:"email,omitempty"`
Status *string `protobuf:"bytes,6,opt,name=status" json:"status,omitempty"`
BusinessId *string `protobuf:"bytes,7,opt,name=business_id" json:"business_id,omitempty"`
StoreId *string `protobuf:"bytes,8,opt,name=store_id" json:"store_id,omitempty"`
FansTo *string `protobuf:"bytes,9,opt,name=fans_to" json:"fans_to,omitempty"`
IsVip *string `protobuf:"bytes,10,opt,name=is_vip" json:"is_vip,omitempty"`
Usercode *string `protobuf:"bytes,11,opt,name=usercode" json:"usercode,omitempty"`
GroupId *string `protobuf:"bytes,12,opt,name=group_id" json:"group_id,omitempty"`
Type *string `protobuf:"bytes,13,opt,name=type" json:"type,omitempty"`
ThirdId *string `protobuf:"bytes,14,opt,name=third_id" json:"third_id,omitempty"`
Platform *string `protobuf:"bytes,15,opt,name=platform" json:"platform,omitempty"`
LockFans *string `protobuf:"bytes,16,opt,name=lock_fans" json:"lock_fans,omitempty"`
CompanyId *string `protobuf:"bytes,17,opt,name=company_id" json:"company_id,omitempty"`
DepartmentId *string `protobuf:"bytes,18,opt,name=department_id" json:"department_id,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *UserResponse) Reset() { *m = UserResponse{} }
func (m *UserResponse) String() string { return proto.CompactTextString(m) }
func (*UserResponse) ProtoMessage() {}
func (m *UserResponse) GetUserId() string {
if m != nil && m.UserId != nil {
return *m.UserId
}
return ""
}
func (m *UserResponse) GetUsername() string {
if m != nil && m.Username != nil {
return *m.Username
}
return ""
}
func (m *UserResponse) GetNickname() string {
if m != nil && m.Nickname != nil {
return *m.Nickname
}
return ""
}
func (m *UserResponse) GetMobile() string {
if m != nil && m.Mobile != nil {
return *m.Mobile
}
return ""
}
func (m *UserResponse) GetEmail() string {
if m != nil && m.Email != nil {
return *m.Email
}
return ""
}
func (m *UserResponse) GetStatus() string {
if m != nil && m.Status != nil {
return *m.Status
}
return ""
}
func (m *UserResponse) GetBusinessId() string {
if m != nil && m.BusinessId != nil {
return *m.BusinessId
}
return ""
}
func (m *UserResponse) GetStoreId() string {
if m != nil && m.StoreId != nil {
return *m.StoreId
}
return ""
}
func (m *UserResponse) GetFansTo() string {
if m != nil && m.FansTo != nil {
return *m.FansTo
}
return ""
}
func (m *UserResponse) GetIsVip() string {
if m != nil && m.IsVip != nil {
return *m.IsVip
}
return ""
}
func (m *UserResponse) GetUsercode() string {
if m != nil && m.Usercode != nil {
return *m.Usercode
}
return ""
}
func (m *UserResponse) GetGroupId() string {
if m != nil && m.GroupId != nil {
return *m.GroupId
}
return ""
}
func (m *UserResponse) GetType() string {
if m != nil && m.Type != nil {
return *m.Type
}
return ""
}
func (m *UserResponse) GetThirdId() string {
if m != nil && m.ThirdId != nil {
return *m.ThirdId
}
return ""
}
func (m *UserResponse) GetPlatform() string {
if m != nil && m.Platform != nil {
return *m.Platform
}
return ""
}
func (m *UserResponse) GetLockFans() string {
if m != nil && m.LockFans != nil {
return *m.LockFans
}
return ""
}
func (m *UserResponse) GetCompanyId() string {
if m != nil && m.CompanyId != nil {
return *m.CompanyId
}
return ""
}
func (m *UserResponse) GetDepartmentId() string {
if m != nil && m.DepartmentId != nil {
return *m.DepartmentId
}
return ""
}
// 用户登录请求结构
type LoginRequest struct {
Dbname *string `protobuf:"bytes,1,opt,name=dbname" json:"dbname,omitempty"`
Account *string `protobuf:"bytes,2,opt,name=account" json:"account,omitempty"`
Password *string `protobuf:"bytes,3,opt,name=password" json:"password,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *LoginRequest) Reset() { *m = LoginRequest{} }
func (m *LoginRequest) String() string { return proto.CompactTextString(m) }
func (*LoginRequest) ProtoMessage() {}
func (m *LoginRequest) GetDbname() string {
if m != nil && m.Dbname != nil {
return *m.Dbname
}
return ""
}
func (m *LoginRequest) GetAccount() string {
if m != nil && m.Account != nil {
return *m.Account
}
return ""
}
func (m *LoginRequest) GetPassword() string {
if m != nil && m.Password != nil {
return *m.Password
}
return ""
}
// 使用token查询用户信息响应结构
type LoginResponse struct {
UserId *string `protobuf:"bytes,1,opt,name=user_id" json:"user_id,omitempty"`
Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
Nickname *string `protobuf:"bytes,3,opt,name=nickname" json:"nickname,omitempty"`
Mobile *string `protobuf:"bytes,4,opt,name=mobile" json:"mobile,omitempty"`
Email *string `protobuf:"bytes,5,opt,name=email" json:"email,omitempty"`
Status *string `protobuf:"bytes,6,opt,name=status" json:"status,omitempty"`
BusinessId *string `protobuf:"bytes,7,opt,name=business_id" json:"business_id,omitempty"`
StoreId *string `protobuf:"bytes,8,opt,name=store_id" json:"store_id,omitempty"`
FansTo *string `protobuf:"bytes,9,opt,name=fans_to" json:"fans_to,omitempty"`
IsVip *string `protobuf:"bytes,10,opt,name=is_vip" json:"is_vip,omitempty"`
Token *string `protobuf:"bytes,11,opt,name=token" json:"token,omitempty"`
Usercode *string `protobuf:"bytes,12,opt,name=usercode" json:"usercode,omitempty"`
GroupId *string `protobuf:"bytes,13,opt,name=group_id" json:"group_id,omitempty"`
Type *string `protobuf:"bytes,14,opt,name=type" json:"type,omitempty"`
ThirdId *string `protobuf:"bytes,15,opt,name=third_id" json:"third_id,omitempty"`
Platform *string `protobuf:"bytes,16,opt,name=platform" json:"platform,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *LoginResponse) Reset() { *m = LoginResponse{} }
func (m *LoginResponse) String() string { return proto.CompactTextString(m) }
func (*LoginResponse) ProtoMessage() {}
func (m *LoginResponse) GetUserId() string {
if m != nil && m.UserId != nil {
return *m.UserId
}
return ""
}
func (m *LoginResponse) GetUsername() string {
if m != nil && m.Username != nil {
return *m.Username
}
return ""
}
func (m *LoginResponse) GetNickname() string {
if m != nil && m.Nickname != nil {
return *m.Nickname
}
return ""
}
func (m *LoginResponse) GetMobile() string {
if m != nil && m.Mobile != nil {
return *m.Mobile
}
return ""
}
func (m *LoginResponse) GetEmail() string {
if m != nil && m.Email != nil {
return *m.Email
}
return ""
}
func (m *LoginResponse) GetStatus() string {
if m != nil && m.Status != nil {
return *m.Status
}
return ""
}
func (m *LoginResponse) GetBusinessId() string {
if m != nil && m.BusinessId != nil {
return *m.BusinessId
}
return ""
}
func (m *LoginResponse) GetStoreId() string {
if m != nil && m.StoreId != nil {
return *m.StoreId
}
return ""
}
func (m *LoginResponse) GetFansTo() string {
if m != nil && m.FansTo != nil {
return *m.FansTo
}
return ""
}
func (m *LoginResponse) GetIsVip() string {
if m != nil && m.IsVip != nil {
return *m.IsVip
}
return ""
}
func (m *LoginResponse) GetToken() string {
if m != nil && m.Token != nil {
return *m.Token
}
return ""
}
func (m *LoginResponse) GetUsercode() string {
if m != nil && m.Usercode != nil {
return *m.Usercode
}
return ""
}
func (m *LoginResponse) GetGroupId() string {
if m != nil && m.GroupId != nil {
return *m.GroupId
}
return ""
}
func (m *LoginResponse) GetType() string {
if m != nil && m.Type != nil {
return *m.Type
}
return ""
}
func (m *LoginResponse) GetThirdId() string {
if m != nil && m.ThirdId != nil {
return *m.ThirdId
}
return ""
}
func (m *LoginResponse) GetPlatform() string {
if m != nil && m.Platform != nil {
return *m.Platform
}
return ""
}
// 信息请求结构
type Request struct {
Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
Time *string `protobuf:"bytes,2,opt,name=time" json:"time,omitempty"`
Sign *string `protobuf:"bytes,3,opt,name=sign" json:"sign,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Request) Reset() { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (m *Request) GetData() string {
if m != nil && m.Data != nil {
return *m.Data
}
return ""
}
func (m *Request) GetTime() string {
if m != nil && m.Time != nil {
return *m.Time
}
return ""
}
func (m *Request) GetSign() string {
if m != nil && m.Sign != nil {
return *m.Sign
}
return ""
}
// 信息响应结构
type Response struct {
Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
Time *string `protobuf:"bytes,2,opt,name=time" json:"time,omitempty"`
Sign *string `protobuf:"bytes,3,opt,name=sign" json:"sign,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Response) Reset() { *m = Response{} }
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (m *Response) GetData() string {
if m != nil && m.Data != nil {
return *m.Data
}
return ""
}
func (m *Response) GetTime() string {
if m != nil && m.Time != nil {
return *m.Time
}
return ""
}
func (m *Response) GetSign() string {
if m != nil && m.Sign != nil {
return *m.Sign
}
return ""
}
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
BindThird(in *Request, out *Response) error
GetThird(in *Request, out *Response) error
GetUserThird(in *Request, out *Response) error
GetBusiness(in *Request, out *Response) error
GetById(in *Request, out *Response) error
UpdateUserCache(in *Request, out *Response) error
GetBusinessInfo(in *Request, out *Response) error
GetAddressInfo(in *Request, out *Response) error
GetUserScore(in *Request, out *Response) error
GetUserRedEnvelope(in *Request, out *Response) error
AddUserScore(in *Request, out *Response) error
UpdateUserScore(in *Request, out *Response) error
AddUserScoreLog(in *Request, out *Response) error
AddUserUpgrade(in *Request, out *Response) error
UpdateUserUpgrade(in *Request, out *Response) error
AddUserUpgradeLog(in *Request, out *Response) error
AddUserRedEnvelope(in *Request, out *Response) error
UpdateUserRedEnvelope(in *Request, out *Response) error
AddUserRedEnvelopeLog(in *Request, out *Response) error
AddUserCoupon(in *Request, out *Response) error
UpdateUserCoupon(in *Request, out *Response) error
Fans(in *Request, out *Response) error
}
// AcceptUserServiceClient accepts connections on the listener and serves requests
// for each incoming connection. Accept blocks; the caller typically
// invokes it in a go statement.
func AcceptUserServiceClient(lis net.Listener, x UserService) {
srv := rpc.NewServer()
if err := srv.RegisterName("UserService", x); err != nil {
log.Fatal(err)
}
for {
conn, err := lis.Accept()
if err != nil {
log.Fatalf("lis.Accept(): %v\n", err)
}
go srv.ServeCodec(protorpc.NewServerCodec(conn))
}
}
// RegisterUserService publish the given UserService implementation on the server.
func RegisterUserService(srv *rpc.Server, x UserService) error {
if err := srv.RegisterName("UserService", x); err != nil {
return err
}
return nil
}
// NewUserServiceServer returns a new UserService Server.
func NewUserServiceServer(x UserService) *rpc.Server {
srv := rpc.NewServer()
if err := srv.RegisterName("UserService", x); err != nil {
log.Fatal(err)
}
return srv
}
// ListenAndServeUserService listen announces on the local network address laddr
// and serves the given UserService implementation.
func ListenAndServeUserService(network, addr string, x UserService) error {
lis, err := net.Listen(network, addr)
if err != nil {
return err
}
defer lis.Close()
srv := rpc.NewServer()
if err := srv.RegisterName("UserService", x); err != nil {
return err
}
for {
conn, err := lis.Accept()
if err != nil {
log.Fatalf("lis.Accept(): %v\n", err)
}
go srv.ServeCodec(protorpc.NewServerCodec(conn))
}
}
type UserServiceClient struct {
*rpc.Client
}
// NewUserServiceClient returns a UserService rpc.Client and stub to handle
// requests to the set of UserService at the other end of the connection.
func NewUserServiceClient(conn io.ReadWriteCloser) (*UserServiceClient, *rpc.Client) {
c := rpc.NewClientWithCodec(protorpc.NewClientCodec(conn))
return &UserServiceClient{c}, c
}
func (c *UserServiceClient) GetByToken(in *UserRequest, out *UserResponse) error {
return c.Call("UserService.GetByToken", in, out)
}
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)
}
func (c *UserServiceClient) BindThird(in *Request, out *Response) error {
return c.Call("UserService.BindThird", in, out)
}
func (c *UserServiceClient) GetThird(in *Request, out *Response) error {
return c.Call("UserService.GetThird", in, out)
}
func (c *UserServiceClient) GetUserThird(in *Request, out *Response) error {
return c.Call("UserService.GetUserThird", in, out)
}
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)
}
func (c *UserServiceClient) UpdateUserCache(in *Request, out *Response) error {
return c.Call("UserService.UpdateUserCache", in, out)
}
func (c *UserServiceClient) GetBusinessInfo(in *Request, out *Response) error {
return c.Call("UserService.GetBusinessInfo", in, out)
}
func (c *UserServiceClient) GetAddressInfo(in *Request, out *Response) error {
return c.Call("UserService.GetAddressInfo", in, out)
}
func (c *UserServiceClient) GetUserScore(in *Request, out *Response) error {
return c.Call("UserService.GetUserScore", in, out)
}
func (c *UserServiceClient) GetUserRedEnvelope(in *Request, out *Response) error {
return c.Call("UserService.GetUserRedEnvelope", in, out)
}
func (c *UserServiceClient) AddUserScore(in *Request, out *Response) error {
return c.Call("UserService.AddUserScore", in, out)
}
func (c *UserServiceClient) UpdateUserScore(in *Request, out *Response) error {
return c.Call("UserService.UpdateUserScore", in, out)
}
func (c *UserServiceClient) AddUserScoreLog(in *Request, out *Response) error {
return c.Call("UserService.AddUserScoreLog", in, out)
}
func (c *UserServiceClient) AddUserUpgrade(in *Request, out *Response) error {
return c.Call("UserService.AddUserUpgrade", in, out)
}
func (c *UserServiceClient) UpdateUserUpgrade(in *Request, out *Response) error {
return c.Call("UserService.UpdateUserUpgrade", in, out)
}
func (c *UserServiceClient) AddUserUpgradeLog(in *Request, out *Response) error {
return c.Call("UserService.AddUserUpgradeLog", in, out)
}
func (c *UserServiceClient) AddUserRedEnvelope(in *Request, out *Response) error {
return c.Call("UserService.AddUserRedEnvelope", in, out)
}
func (c *UserServiceClient) UpdateUserRedEnvelope(in *Request, out *Response) error {
return c.Call("UserService.UpdateUserRedEnvelope", in, out)
}
func (c *UserServiceClient) AddUserRedEnvelopeLog(in *Request, out *Response) error {
return c.Call("UserService.AddUserRedEnvelopeLog", in, out)
}
func (c *UserServiceClient) AddUserCoupon(in *Request, out *Response) error {
return c.Call("UserService.AddUserCoupon", in, out)
}
func (c *UserServiceClient) UpdateUserCoupon(in *Request, out *Response) error {
return c.Call("UserService.UpdateUserCoupon", in, out)
}
func (c *UserServiceClient) Fans(in *Request, out *Response) error {
return c.Call("UserService.Fans", in, out)
}
// DialUserService connects to an UserService at the specified network address.
func DialUserService(network, addr string) (*UserServiceClient, *rpc.Client, error) {
c, err := protorpc.Dial(network, addr)
if err != nil {
return nil, nil, err
}
return &UserServiceClient{c}, c, nil
}
// DialUserServiceTimeout connects to an UserService at the specified network address.
func DialUserServiceTimeout(network, addr string,
timeout time.Duration) (*UserServiceClient, *rpc.Client, error) {
c, err := protorpc.DialTimeout(network, addr, timeout)
if err != nil {
return nil, nil, err
}
return &UserServiceClient{c}, c, nil
}