proto

package
v0.0.0-...-b2bc55b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2020 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_account_proto protoreflect.FileDescriptor

Functions

func NewAccountEndpoints

func NewAccountEndpoints() []*api.Endpoint

func RegisterAccountHandler

func RegisterAccountHandler(s server.Server, hdlr AccountHandler, opts ...server.HandlerOption) error

Types

type AccountHandler

type AccountHandler interface {
	//  用户注册
	SignUp(context.Context, *SignUpRequest, *SignUpResponse) error
	//  用户登录
	SignIn(context.Context, *SignInRequest, *SignInResponse) error
	//  创建用户(后台使用)
	CreateUser(context.Context, *CreateUserRequest, *CreateUserResponse) error
	//  获取用户信息
	UserInfo(context.Context, *UserInfoRequest, *UserInfoResponse) error
	//  检查用户是否可以被注册
	RegistrationCheck(context.Context, *RegistrationCheckRequest, *RegistrationCheckResponse) error
	//  检查用户密码
	UserPasswordCheck(context.Context, *UserPasswordCheckRequest, *UserPasswordCheckResponse) error
}

type AccountService

type AccountService interface {
	//  用户注册
	SignUp(ctx context.Context, in *SignUpRequest, opts ...client.CallOption) (*SignUpResponse, error)
	//  用户登录
	SignIn(ctx context.Context, in *SignInRequest, opts ...client.CallOption) (*SignInResponse, error)
	//  创建用户(后台使用)
	CreateUser(ctx context.Context, in *CreateUserRequest, opts ...client.CallOption) (*CreateUserResponse, error)
	//  获取用户信息
	UserInfo(ctx context.Context, in *UserInfoRequest, opts ...client.CallOption) (*UserInfoResponse, error)
	//  检查用户是否可以被注册
	RegistrationCheck(ctx context.Context, in *RegistrationCheckRequest, opts ...client.CallOption) (*RegistrationCheckResponse, error)
	//  检查用户密码
	UserPasswordCheck(ctx context.Context, in *UserPasswordCheckRequest, opts ...client.CallOption) (*UserPasswordCheckResponse, error)
}

func NewAccountService

func NewAccountService(name string, c client.Client) AccountService

type CreateUserRequest

type CreateUserRequest struct {
	Name     string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // 原密码sha1
	Mail     string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`
	Phone    string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	Gender   int32  `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"`
	// contains filtered or unexported fields
}

创建用户(后台使用)

func (*CreateUserRequest) Descriptor deprecated

func (*CreateUserRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.

func (*CreateUserRequest) GetGender

func (x *CreateUserRequest) GetGender() int32

func (*CreateUserRequest) GetMail

func (x *CreateUserRequest) GetMail() string

func (*CreateUserRequest) GetName

func (x *CreateUserRequest) GetName() string

func (*CreateUserRequest) GetPassword

func (x *CreateUserRequest) GetPassword() string

func (*CreateUserRequest) GetPhone

func (x *CreateUserRequest) GetPhone() string

func (*CreateUserRequest) ProtoMessage

func (*CreateUserRequest) ProtoMessage()

func (*CreateUserRequest) ProtoReflect

func (x *CreateUserRequest) ProtoReflect() protoreflect.Message

func (*CreateUserRequest) Reset

func (x *CreateUserRequest) Reset()

func (*CreateUserRequest) String

func (x *CreateUserRequest) String() string

type CreateUserResponse

type CreateUserResponse struct {
	UserId int64  `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Name   string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Mail   string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`
	Phone  string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	Gender int32  `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"`
	Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUserResponse) Descriptor deprecated

func (*CreateUserResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.

func (*CreateUserResponse) GetAvatar

func (x *CreateUserResponse) GetAvatar() string

func (*CreateUserResponse) GetGender

func (x *CreateUserResponse) GetGender() int32

func (*CreateUserResponse) GetMail

func (x *CreateUserResponse) GetMail() string

func (*CreateUserResponse) GetName

func (x *CreateUserResponse) GetName() string

func (*CreateUserResponse) GetPhone

func (x *CreateUserResponse) GetPhone() string

func (*CreateUserResponse) GetUserId

func (x *CreateUserResponse) GetUserId() int64

func (*CreateUserResponse) ProtoMessage

func (*CreateUserResponse) ProtoMessage()

func (*CreateUserResponse) ProtoReflect

func (x *CreateUserResponse) ProtoReflect() protoreflect.Message

func (*CreateUserResponse) Reset

func (x *CreateUserResponse) Reset()

func (*CreateUserResponse) String

func (x *CreateUserResponse) String() string

type RegistrationCheckRequest

type RegistrationCheckRequest struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Mail  string `protobuf:"bytes,2,opt,name=mail,proto3" json:"mail,omitempty"`
	Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"`
	// contains filtered or unexported fields
}

检查用户是否可以被注册

func (*RegistrationCheckRequest) Descriptor deprecated

func (*RegistrationCheckRequest) Descriptor() ([]byte, []int)

Deprecated: Use RegistrationCheckRequest.ProtoReflect.Descriptor instead.

func (*RegistrationCheckRequest) GetMail

func (x *RegistrationCheckRequest) GetMail() string

func (*RegistrationCheckRequest) GetName

func (x *RegistrationCheckRequest) GetName() string

func (*RegistrationCheckRequest) GetPhone

func (x *RegistrationCheckRequest) GetPhone() string

func (*RegistrationCheckRequest) ProtoMessage

func (*RegistrationCheckRequest) ProtoMessage()

func (*RegistrationCheckRequest) ProtoReflect

func (x *RegistrationCheckRequest) ProtoReflect() protoreflect.Message

func (*RegistrationCheckRequest) Reset

func (x *RegistrationCheckRequest) Reset()

func (*RegistrationCheckRequest) String

func (x *RegistrationCheckRequest) String() string

type RegistrationCheckResponse

type RegistrationCheckResponse struct {
	// contains filtered or unexported fields
}

func (*RegistrationCheckResponse) Descriptor deprecated

func (*RegistrationCheckResponse) Descriptor() ([]byte, []int)

Deprecated: Use RegistrationCheckResponse.ProtoReflect.Descriptor instead.

func (*RegistrationCheckResponse) ProtoMessage

func (*RegistrationCheckResponse) ProtoMessage()

func (*RegistrationCheckResponse) ProtoReflect

func (*RegistrationCheckResponse) Reset

func (x *RegistrationCheckResponse) Reset()

func (*RegistrationCheckResponse) String

func (x *RegistrationCheckResponse) String() string

type SignInRequest

type SignInRequest struct {
	Account         string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	Password        string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`                  // 原始密码sha1后,使用公钥加密,再stdbase64。
	CryptoId        int64  `protobuf:"varint,3,opt,name=crypto_id,json=cryptoId,proto3" json:"crypto_id,omitempty"` //  加密密码的密钥对id
	CaptchaId       string `protobuf:"bytes,4,opt,name=captcha_id,json=captchaId,proto3" json:"captcha_id,omitempty"`
	CaptchaSolution string `protobuf:"bytes,5,opt,name=captcha_solution,json=captchaSolution,proto3" json:"captcha_solution,omitempty"`
	// contains filtered or unexported fields
}

用户登录

func (*SignInRequest) Descriptor deprecated

func (*SignInRequest) Descriptor() ([]byte, []int)

Deprecated: Use SignInRequest.ProtoReflect.Descriptor instead.

func (*SignInRequest) GetAccount

func (x *SignInRequest) GetAccount() string

func (*SignInRequest) GetCaptchaId

func (x *SignInRequest) GetCaptchaId() string

func (*SignInRequest) GetCaptchaSolution

func (x *SignInRequest) GetCaptchaSolution() string

func (*SignInRequest) GetCryptoId

func (x *SignInRequest) GetCryptoId() int64

func (*SignInRequest) GetPassword

func (x *SignInRequest) GetPassword() string

func (*SignInRequest) ProtoMessage

func (*SignInRequest) ProtoMessage()

func (*SignInRequest) ProtoReflect

func (x *SignInRequest) ProtoReflect() protoreflect.Message

func (*SignInRequest) Reset

func (x *SignInRequest) Reset()

func (*SignInRequest) String

func (x *SignInRequest) String() string

type SignInResponse

type SignInResponse struct {
	UserId int64  `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Name   string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Mail   string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`
	Phone  string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	Gender int32  `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"`
	Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"`
	// contains filtered or unexported fields
}

func (*SignInResponse) Descriptor deprecated

func (*SignInResponse) Descriptor() ([]byte, []int)

Deprecated: Use SignInResponse.ProtoReflect.Descriptor instead.

func (*SignInResponse) GetAvatar

func (x *SignInResponse) GetAvatar() string

func (*SignInResponse) GetGender

func (x *SignInResponse) GetGender() int32

func (*SignInResponse) GetMail

func (x *SignInResponse) GetMail() string

func (*SignInResponse) GetName

func (x *SignInResponse) GetName() string

func (*SignInResponse) GetPhone

func (x *SignInResponse) GetPhone() string

func (*SignInResponse) GetUserId

func (x *SignInResponse) GetUserId() int64

func (*SignInResponse) ProtoMessage

func (*SignInResponse) ProtoMessage()

func (*SignInResponse) ProtoReflect

func (x *SignInResponse) ProtoReflect() protoreflect.Message

func (*SignInResponse) Reset

func (x *SignInResponse) Reset()

func (*SignInResponse) String

func (x *SignInResponse) String() string

type SignUpRequest

type SignUpRequest struct {
	Name            string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Password        string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`                  // 原始密码sha1后,使用公钥加密,再stdbase64。
	CryptoId        int64  `protobuf:"varint,3,opt,name=crypto_id,json=cryptoId,proto3" json:"crypto_id,omitempty"` //  加密密码的密钥对id
	Mail            string `protobuf:"bytes,4,opt,name=mail,proto3" json:"mail,omitempty"`
	Phone           string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"`
	Gender          int32  `protobuf:"varint,6,opt,name=gender,proto3" json:"gender,omitempty"`
	CaptchaId       string `protobuf:"bytes,7,opt,name=captcha_id,json=captchaId,proto3" json:"captcha_id,omitempty"`
	CaptchaSolution string `protobuf:"bytes,8,opt,name=captcha_solution,json=captchaSolution,proto3" json:"captcha_solution,omitempty"`
	// contains filtered or unexported fields
}

用户注册

func (*SignUpRequest) Descriptor deprecated

func (*SignUpRequest) Descriptor() ([]byte, []int)

Deprecated: Use SignUpRequest.ProtoReflect.Descriptor instead.

func (*SignUpRequest) GetCaptchaId

func (x *SignUpRequest) GetCaptchaId() string

func (*SignUpRequest) GetCaptchaSolution

func (x *SignUpRequest) GetCaptchaSolution() string

func (*SignUpRequest) GetCryptoId

func (x *SignUpRequest) GetCryptoId() int64

func (*SignUpRequest) GetGender

func (x *SignUpRequest) GetGender() int32

func (*SignUpRequest) GetMail

func (x *SignUpRequest) GetMail() string

func (*SignUpRequest) GetName

func (x *SignUpRequest) GetName() string

func (*SignUpRequest) GetPassword

func (x *SignUpRequest) GetPassword() string

func (*SignUpRequest) GetPhone

func (x *SignUpRequest) GetPhone() string

func (*SignUpRequest) ProtoMessage

func (*SignUpRequest) ProtoMessage()

func (*SignUpRequest) ProtoReflect

func (x *SignUpRequest) ProtoReflect() protoreflect.Message

func (*SignUpRequest) Reset

func (x *SignUpRequest) Reset()

func (*SignUpRequest) String

func (x *SignUpRequest) String() string

type SignUpResponse

type SignUpResponse struct {
	UserId int64  `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Name   string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Mail   string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`
	Phone  string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	Gender int32  `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"`
	Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"`
	// contains filtered or unexported fields
}

func (*SignUpResponse) Descriptor deprecated

func (*SignUpResponse) Descriptor() ([]byte, []int)

Deprecated: Use SignUpResponse.ProtoReflect.Descriptor instead.

func (*SignUpResponse) GetAvatar

func (x *SignUpResponse) GetAvatar() string

func (*SignUpResponse) GetGender

func (x *SignUpResponse) GetGender() int32

func (*SignUpResponse) GetMail

func (x *SignUpResponse) GetMail() string

func (*SignUpResponse) GetName

func (x *SignUpResponse) GetName() string

func (*SignUpResponse) GetPhone

func (x *SignUpResponse) GetPhone() string

func (*SignUpResponse) GetUserId

func (x *SignUpResponse) GetUserId() int64

func (*SignUpResponse) ProtoMessage

func (*SignUpResponse) ProtoMessage()

func (*SignUpResponse) ProtoReflect

func (x *SignUpResponse) ProtoReflect() protoreflect.Message

func (*SignUpResponse) Reset

func (x *SignUpResponse) Reset()

func (*SignUpResponse) String

func (x *SignUpResponse) String() string

type UserInfoRequest

type UserInfoRequest struct {
	UserId int64  `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Name   string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Mail   string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`
	Phone  string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	// contains filtered or unexported fields
}

获取用户信息,填一项即可

func (*UserInfoRequest) Descriptor deprecated

func (*UserInfoRequest) Descriptor() ([]byte, []int)

Deprecated: Use UserInfoRequest.ProtoReflect.Descriptor instead.

func (*UserInfoRequest) GetMail

func (x *UserInfoRequest) GetMail() string

func (*UserInfoRequest) GetName

func (x *UserInfoRequest) GetName() string

func (*UserInfoRequest) GetPhone

func (x *UserInfoRequest) GetPhone() string

func (*UserInfoRequest) GetUserId

func (x *UserInfoRequest) GetUserId() int64

func (*UserInfoRequest) ProtoMessage

func (*UserInfoRequest) ProtoMessage()

func (*UserInfoRequest) ProtoReflect

func (x *UserInfoRequest) ProtoReflect() protoreflect.Message

func (*UserInfoRequest) Reset

func (x *UserInfoRequest) Reset()

func (*UserInfoRequest) String

func (x *UserInfoRequest) String() string

type UserInfoResponse

type UserInfoResponse struct {
	UserId int64  `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Name   string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Mail   string `protobuf:"bytes,3,opt,name=mail,proto3" json:"mail,omitempty"`
	Phone  string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
	Gender int32  `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"`
	Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"`
	// contains filtered or unexported fields
}

func (*UserInfoResponse) Descriptor deprecated

func (*UserInfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use UserInfoResponse.ProtoReflect.Descriptor instead.

func (*UserInfoResponse) GetAvatar

func (x *UserInfoResponse) GetAvatar() string

func (*UserInfoResponse) GetGender

func (x *UserInfoResponse) GetGender() int32

func (*UserInfoResponse) GetMail

func (x *UserInfoResponse) GetMail() string

func (*UserInfoResponse) GetName

func (x *UserInfoResponse) GetName() string

func (*UserInfoResponse) GetPhone

func (x *UserInfoResponse) GetPhone() string

func (*UserInfoResponse) GetUserId

func (x *UserInfoResponse) GetUserId() int64

func (*UserInfoResponse) ProtoMessage

func (*UserInfoResponse) ProtoMessage()

func (*UserInfoResponse) ProtoReflect

func (x *UserInfoResponse) ProtoReflect() protoreflect.Message

func (*UserInfoResponse) Reset

func (x *UserInfoResponse) Reset()

func (*UserInfoResponse) String

func (x *UserInfoResponse) String() string

type UserPasswordCheckRequest

type UserPasswordCheckRequest struct {
	UserId   int64  `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

检查用户密码

func (*UserPasswordCheckRequest) Descriptor deprecated

func (*UserPasswordCheckRequest) Descriptor() ([]byte, []int)

Deprecated: Use UserPasswordCheckRequest.ProtoReflect.Descriptor instead.

func (*UserPasswordCheckRequest) GetPassword

func (x *UserPasswordCheckRequest) GetPassword() string

func (*UserPasswordCheckRequest) GetUserId

func (x *UserPasswordCheckRequest) GetUserId() int64

func (*UserPasswordCheckRequest) ProtoMessage

func (*UserPasswordCheckRequest) ProtoMessage()

func (*UserPasswordCheckRequest) ProtoReflect

func (x *UserPasswordCheckRequest) ProtoReflect() protoreflect.Message

func (*UserPasswordCheckRequest) Reset

func (x *UserPasswordCheckRequest) Reset()

func (*UserPasswordCheckRequest) String

func (x *UserPasswordCheckRequest) String() string

type UserPasswordCheckResponse

type UserPasswordCheckResponse struct {
	// contains filtered or unexported fields
}

func (*UserPasswordCheckResponse) Descriptor deprecated

func (*UserPasswordCheckResponse) Descriptor() ([]byte, []int)

Deprecated: Use UserPasswordCheckResponse.ProtoReflect.Descriptor instead.

func (*UserPasswordCheckResponse) ProtoMessage

func (*UserPasswordCheckResponse) ProtoMessage()

func (*UserPasswordCheckResponse) ProtoReflect

func (*UserPasswordCheckResponse) Reset

func (x *UserPasswordCheckResponse) Reset()

func (*UserPasswordCheckResponse) String

func (x *UserPasswordCheckResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL