add service
All checks were successful
Deploy Smart Search Backend Test / deploy (push) Successful in 1m24s
All checks were successful
Deploy Smart Search Backend Test / deploy (push) Successful in 1m24s
This commit is contained in:
@@ -437,6 +437,150 @@ func (x *LogoutResponse) GetSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
type RegisterRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
|
||||
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`
|
||||
InviteCode int64 `protobuf:"varint,5,opt,name=invite_code,json=inviteCode,proto3" json:"invite_code,omitempty"`
|
||||
Ip string `protobuf:"bytes,6,opt,name=ip,proto3" json:"ip,omitempty"`
|
||||
UserAgent string `protobuf:"bytes,7,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) Reset() {
|
||||
*x = RegisterRequest{}
|
||||
mi := &file_auth_auth_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegisterRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RegisterRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_auth_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RegisterRequest) Descriptor() ([]byte, []int) {
|
||||
return file_auth_auth_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) GetEmail() string {
|
||||
if x != nil {
|
||||
return x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) GetPhone() string {
|
||||
if x != nil {
|
||||
return x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) GetInviteCode() int64 {
|
||||
if x != nil {
|
||||
return x.InviteCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) GetIp() string {
|
||||
if x != nil {
|
||||
return x.Ip
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RegisterRequest) GetUserAgent() string {
|
||||
if x != nil {
|
||||
return x.UserAgent
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RegisterResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
|
||||
RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *RegisterResponse) Reset() {
|
||||
*x = RegisterResponse{}
|
||||
mi := &file_auth_auth_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *RegisterResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RegisterResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RegisterResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_auth_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RegisterResponse) Descriptor() ([]byte, []int) {
|
||||
return file_auth_auth_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *RegisterResponse) GetAccessToken() string {
|
||||
if x != nil {
|
||||
return x.AccessToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *RegisterResponse) GetRefreshToken() string {
|
||||
if x != nil {
|
||||
return x.RefreshToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_auth_auth_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_auth_auth_proto_rawDesc = "" +
|
||||
@@ -467,8 +611,22 @@ const file_auth_auth_proto_rawDesc = "" +
|
||||
"\rLogoutRequest\x12!\n" +
|
||||
"\faccess_token\x18\x01 \x01(\tR\vaccessToken\"*\n" +
|
||||
"\x0eLogoutResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess2\xe7\x01\n" +
|
||||
"\vAuthService\x120\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\"\xbd\x01\n" +
|
||||
"\x0fRegisterRequest\x12\x14\n" +
|
||||
"\x05email\x18\x01 \x01(\tR\x05email\x12\x1a\n" +
|
||||
"\bpassword\x18\x02 \x01(\tR\bpassword\x12\x12\n" +
|
||||
"\x04name\x18\x03 \x01(\tR\x04name\x12\x14\n" +
|
||||
"\x05phone\x18\x04 \x01(\tR\x05phone\x12\x1f\n" +
|
||||
"\vinvite_code\x18\x05 \x01(\x03R\n" +
|
||||
"inviteCode\x12\x0e\n" +
|
||||
"\x02ip\x18\x06 \x01(\tR\x02ip\x12\x1d\n" +
|
||||
"\n" +
|
||||
"user_agent\x18\a \x01(\tR\tuserAgent\"Z\n" +
|
||||
"\x10RegisterResponse\x12!\n" +
|
||||
"\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" +
|
||||
"\rrefresh_token\x18\x02 \x01(\tR\frefreshToken2\xa2\x02\n" +
|
||||
"\vAuthService\x129\n" +
|
||||
"\bRegister\x12\x15.auth.RegisterRequest\x1a\x16.auth.RegisterResponse\x120\n" +
|
||||
"\x05Login\x12\x12.auth.LoginRequest\x1a\x13.auth.LoginResponse\x126\n" +
|
||||
"\aRefresh\x12\x14.auth.RefreshRequest\x1a\x15.auth.RefreshResponse\x129\n" +
|
||||
"\bValidate\x12\x15.auth.ValidateRequest\x1a\x16.auth.ValidateResponse\x123\n" +
|
||||
@@ -486,7 +644,7 @@ func file_auth_auth_proto_rawDescGZIP() []byte {
|
||||
return file_auth_auth_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_auth_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_auth_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||
var file_auth_auth_proto_goTypes = []any{
|
||||
(*LoginRequest)(nil), // 0: auth.LoginRequest
|
||||
(*LoginResponse)(nil), // 1: auth.LoginResponse
|
||||
@@ -496,18 +654,22 @@ var file_auth_auth_proto_goTypes = []any{
|
||||
(*ValidateResponse)(nil), // 5: auth.ValidateResponse
|
||||
(*LogoutRequest)(nil), // 6: auth.LogoutRequest
|
||||
(*LogoutResponse)(nil), // 7: auth.LogoutResponse
|
||||
(*RegisterRequest)(nil), // 8: auth.RegisterRequest
|
||||
(*RegisterResponse)(nil), // 9: auth.RegisterResponse
|
||||
}
|
||||
var file_auth_auth_proto_depIdxs = []int32{
|
||||
0, // 0: auth.AuthService.Login:input_type -> auth.LoginRequest
|
||||
2, // 1: auth.AuthService.Refresh:input_type -> auth.RefreshRequest
|
||||
4, // 2: auth.AuthService.Validate:input_type -> auth.ValidateRequest
|
||||
6, // 3: auth.AuthService.Logout:input_type -> auth.LogoutRequest
|
||||
1, // 4: auth.AuthService.Login:output_type -> auth.LoginResponse
|
||||
3, // 5: auth.AuthService.Refresh:output_type -> auth.RefreshResponse
|
||||
5, // 6: auth.AuthService.Validate:output_type -> auth.ValidateResponse
|
||||
7, // 7: auth.AuthService.Logout:output_type -> auth.LogoutResponse
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
8, // 0: auth.AuthService.Register:input_type -> auth.RegisterRequest
|
||||
0, // 1: auth.AuthService.Login:input_type -> auth.LoginRequest
|
||||
2, // 2: auth.AuthService.Refresh:input_type -> auth.RefreshRequest
|
||||
4, // 3: auth.AuthService.Validate:input_type -> auth.ValidateRequest
|
||||
6, // 4: auth.AuthService.Logout:input_type -> auth.LogoutRequest
|
||||
9, // 5: auth.AuthService.Register:output_type -> auth.RegisterResponse
|
||||
1, // 6: auth.AuthService.Login:output_type -> auth.LoginResponse
|
||||
3, // 7: auth.AuthService.Refresh:output_type -> auth.RefreshResponse
|
||||
5, // 8: auth.AuthService.Validate:output_type -> auth.ValidateResponse
|
||||
7, // 9: auth.AuthService.Logout:output_type -> auth.LogoutResponse
|
||||
5, // [5:10] is the sub-list for method output_type
|
||||
0, // [0:5] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
@@ -524,7 +686,7 @@ func file_auth_auth_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_auth_auth_proto_rawDesc), len(file_auth_auth_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 8,
|
||||
NumMessages: 10,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AuthService_Register_FullMethodName = "/auth.AuthService/Register"
|
||||
AuthService_Login_FullMethodName = "/auth.AuthService/Login"
|
||||
AuthService_Refresh_FullMethodName = "/auth.AuthService/Refresh"
|
||||
AuthService_Validate_FullMethodName = "/auth.AuthService/Validate"
|
||||
@@ -29,6 +30,7 @@ const (
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type AuthServiceClient interface {
|
||||
Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
|
||||
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
|
||||
Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error)
|
||||
Validate(ctx context.Context, in *ValidateRequest, opts ...grpc.CallOption) (*ValidateResponse, error)
|
||||
@@ -43,6 +45,16 @@ func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
||||
return &authServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *authServiceClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RegisterResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_Register_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LoginResponse)
|
||||
@@ -87,6 +99,7 @@ func (c *authServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts
|
||||
// All implementations must embed UnimplementedAuthServiceServer
|
||||
// for forward compatibility.
|
||||
type AuthServiceServer interface {
|
||||
Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
|
||||
Login(context.Context, *LoginRequest) (*LoginResponse, error)
|
||||
Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error)
|
||||
Validate(context.Context, *ValidateRequest) (*ValidateResponse, error)
|
||||
@@ -101,6 +114,9 @@ type AuthServiceServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAuthServiceServer struct{}
|
||||
|
||||
func (UnimplementedAuthServiceServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
||||
}
|
||||
@@ -134,6 +150,24 @@ func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
||||
s.RegisterService(&AuthService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AuthService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegisterRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).Register(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_Register_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).Register(ctx, req.(*RegisterRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoginRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -213,6 +247,10 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "auth.AuthService",
|
||||
HandlerType: (*AuthServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Register",
|
||||
Handler: _AuthService_Register_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Login",
|
||||
Handler: _AuthService_Login_Handler,
|
||||
|
||||
Reference in New Issue
Block a user