feat: openid login
This commit is contained in:
@@ -31,6 +31,7 @@ const (
|
||||
Sale_Items_FullMethodName = "/sale.Sale/Items"
|
||||
Sale_Status_FullMethodName = "/sale.Sale/Status"
|
||||
Sale_InfoInternal_FullMethodName = "/sale.Sale/InfoInternal"
|
||||
Sale_InfoByUserId_FullMethodName = "/sale.Sale/InfoByUserId"
|
||||
Sale_NamesByIds_FullMethodName = "/sale.Sale/NamesByIds"
|
||||
)
|
||||
|
||||
@@ -53,7 +54,9 @@ type SaleClient interface {
|
||||
Status(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Response, error)
|
||||
// 销售详情
|
||||
InfoInternal(ctx context.Context, in *InfoReq, opts ...grpc.CallOption) (*InfoData, error)
|
||||
// 按 id 批量查销售 id+name(内部)
|
||||
// 按 user_id 查销售详情(内部)
|
||||
InfoByUserId(ctx context.Context, in *InfoByUserIdReq, opts ...grpc.CallOption) (*InfoData, error)
|
||||
// ids 批量查销售
|
||||
NamesByIds(ctx context.Context, in *NamesByIdsReq, opts ...grpc.CallOption) (*NamesByIdsData, error)
|
||||
}
|
||||
|
||||
@@ -185,6 +188,16 @@ func (c *saleClient) InfoInternal(ctx context.Context, in *InfoReq, opts ...grpc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *saleClient) InfoByUserId(ctx context.Context, in *InfoByUserIdReq, opts ...grpc.CallOption) (*InfoData, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(InfoData)
|
||||
err := c.cc.Invoke(ctx, Sale_InfoByUserId_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *saleClient) NamesByIds(ctx context.Context, in *NamesByIdsReq, opts ...grpc.CallOption) (*NamesByIdsData, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(NamesByIdsData)
|
||||
@@ -214,7 +227,9 @@ type SaleServer interface {
|
||||
Status(context.Context, *StatusReq) (*Response, error)
|
||||
// 销售详情
|
||||
InfoInternal(context.Context, *InfoReq) (*InfoData, error)
|
||||
// 按 id 批量查销售 id+name(内部)
|
||||
// 按 user_id 查销售详情(内部)
|
||||
InfoByUserId(context.Context, *InfoByUserIdReq) (*InfoData, error)
|
||||
// ids 批量查销售
|
||||
NamesByIds(context.Context, *NamesByIdsReq) (*NamesByIdsData, error)
|
||||
mustEmbedUnimplementedSaleServer()
|
||||
}
|
||||
@@ -262,6 +277,9 @@ func (UnimplementedSaleServer) Status(context.Context, *StatusReq) (*Response, e
|
||||
func (UnimplementedSaleServer) InfoInternal(context.Context, *InfoReq) (*InfoData, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InfoInternal not implemented")
|
||||
}
|
||||
func (UnimplementedSaleServer) InfoByUserId(context.Context, *InfoByUserIdReq) (*InfoData, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InfoByUserId not implemented")
|
||||
}
|
||||
func (UnimplementedSaleServer) NamesByIds(context.Context, *NamesByIdsReq) (*NamesByIdsData, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method NamesByIds not implemented")
|
||||
}
|
||||
@@ -502,6 +520,24 @@ func _Sale_InfoInternal_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Sale_InfoByUserId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InfoByUserIdReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SaleServer).InfoByUserId(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Sale_InfoByUserId_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SaleServer).InfoByUserId(ctx, req.(*InfoByUserIdReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Sale_NamesByIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NamesByIdsReq)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -575,6 +611,10 @@ var Sale_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "InfoInternal",
|
||||
Handler: _Sale_InfoInternal_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "InfoByUserId",
|
||||
Handler: _Sale_InfoByUserId_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NamesByIds",
|
||||
Handler: _Sale_NamesByIds_Handler,
|
||||
|
||||
Reference in New Issue
Block a user