Browse Source

手机号

wfz 3 years ago
parent
commit
51263cbc2e

File diff suppressed because it is too large
+ 412 - 306
api/account/account.pb.go


+ 10 - 0
api/account/account.proto

@@ -62,6 +62,16 @@ service Account {
   rpc UserSubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
   // 用户取关
   rpc UserUnsubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
+  // 获取用户手机号哦
+  rpc GetUserPhoneByCode (GetUserPhoneByCodeRequest) returns (GetUserPhoneByCodeReply){};
+}
+
+message GetUserPhoneByCodeRequest{
+  string code = 1;
+}
+
+message GetUserPhoneByCodeReply{
+  string phone = 2;
 }
 
 message ReduceSubscribeMessageRequest{

+ 38 - 0
api/account/account_grpc.pb.go

@@ -43,6 +43,8 @@ type AccountClient interface {
 	UserSubscribe(ctx context.Context, in *OpenIDAndAppIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 用户取关
 	UserUnsubscribe(ctx context.Context, in *OpenIDAndAppIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+	// 获取用户手机号哦
+	GetUserPhoneByCode(ctx context.Context, in *GetUserPhoneByCodeRequest, opts ...grpc.CallOption) (*GetUserPhoneByCodeReply, error)
 }
 
 type accountClient struct {
@@ -170,6 +172,15 @@ func (c *accountClient) UserUnsubscribe(ctx context.Context, in *OpenIDAndAppIDR
 	return out, nil
 }
 
+func (c *accountClient) GetUserPhoneByCode(ctx context.Context, in *GetUserPhoneByCodeRequest, opts ...grpc.CallOption) (*GetUserPhoneByCodeReply, error) {
+	out := new(GetUserPhoneByCodeReply)
+	err := c.cc.Invoke(ctx, "/api.account.Account/GetUserPhoneByCode", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // AccountServer is the server API for Account service.
 // All implementations must embed UnimplementedAccountServer
 // for forward compatibility
@@ -197,6 +208,8 @@ type AccountServer interface {
 	UserSubscribe(context.Context, *OpenIDAndAppIDRequest) (*emptypb.Empty, error)
 	// 用户取关
 	UserUnsubscribe(context.Context, *OpenIDAndAppIDRequest) (*emptypb.Empty, error)
+	// 获取用户手机号哦
+	GetUserPhoneByCode(context.Context, *GetUserPhoneByCodeRequest) (*GetUserPhoneByCodeReply, error)
 	mustEmbedUnimplementedAccountServer()
 }
 
@@ -243,6 +256,9 @@ func (UnimplementedAccountServer) UserSubscribe(context.Context, *OpenIDAndAppID
 func (UnimplementedAccountServer) UserUnsubscribe(context.Context, *OpenIDAndAppIDRequest) (*emptypb.Empty, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method UserUnsubscribe not implemented")
 }
+func (UnimplementedAccountServer) GetUserPhoneByCode(context.Context, *GetUserPhoneByCodeRequest) (*GetUserPhoneByCodeReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetUserPhoneByCode not implemented")
+}
 func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {}
 
 // UnsafeAccountServer may be embedded to opt out of forward compatibility for this service.
@@ -490,6 +506,24 @@ func _Account_UserUnsubscribe_Handler(srv interface{}, ctx context.Context, dec
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Account_GetUserPhoneByCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(GetUserPhoneByCodeRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(AccountServer).GetUserPhoneByCode(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.account.Account/GetUserPhoneByCode",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(AccountServer).GetUserPhoneByCode(ctx, req.(*GetUserPhoneByCodeRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Account_ServiceDesc is the grpc.ServiceDesc for Account service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -549,6 +583,10 @@ var Account_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "UserUnsubscribe",
 			Handler:    _Account_UserUnsubscribe_Handler,
 		},
+		{
+			MethodName: "GetUserPhoneByCode",
+			Handler:    _Account_GetUserPhoneByCode_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "account.proto",

+ 1 - 0
errors/common.go

@@ -36,4 +36,5 @@ var (
 	ErrorPictureFail           = codes.Error(10029, "发布失败,图片内容涉嫌违规,请修改~")
 	ErrorSubscribeNotEnough    = codes.Error(10030, "订阅消息可发送次数不足")
 	ErrorLockFail              = codes.Error(10031, "不能重复处理")
+	ErrorUserCodePhone         = codes.Error(10032, "请重新授权用户手机号")
 )

+ 1 - 1
js/api/account/account_http_pb.ts

@@ -1,6 +1,6 @@
 // @ts-ignore
 import request from '@/libs/request';
-import {DebugLoginRequest,TokenReply,AuthorizationRequest,AuthorizationMiniProgramRequest,MiniProgramTokenReply,GetGetGzhConfigReply,OpenIDAndAppIDRequest,IdentityInfo,GetIdentifyByAccountIDRequest,GetIdentifyByAccountIDReply,FindIdentifyByAccountIDAndIsSubscribeRequest,FindIdentifyByAccountIDAndIsSubscribeReply} from "./account_pb";
+import {DebugLoginRequest,TokenReply,AuthorizationRequest,AuthorizationMiniProgramRequest,MiniProgramTokenReply,GetGetGzhConfigReply,OpenIDAndAppIDRequest,IdentityInfo,GetIdentifyByAccountIDRequest,GetIdentifyByAccountIDReply,FindIdentifyByAccountIDAndIsSubscribeRequest,FindIdentifyByAccountIDAndIsSubscribeReply,GetUserPhoneByCodeRequest,GetUserPhoneByCodeReply} from "./account_pb";
 import {GetLoginConfigReply} from "../common/common_pb";
 
 const AccountService = {

+ 6 - 0
js/api/account/account_pb.ts

@@ -1,3 +1,9 @@
+export interface GetUserPhoneByCodeRequest{
+    code?:string;
+}
+export interface GetUserPhoneByCodeReply{
+    phone?:string;
+}
 export interface ReduceSubscribeMessageRequest{
     subscribeId?:string;
     userId?:string;

Some files were not shown because too many files changed in this diff