feat: openid login
This commit is contained in:
@@ -16,9 +16,8 @@ import (
|
||||
type (
|
||||
EnsureBizIdentityData = user.EnsureBizIdentityData
|
||||
EnsureBizIdentityReq = user.EnsureBizIdentityReq
|
||||
InfoReq = user.InfoReq
|
||||
LoginReq = user.LoginReq
|
||||
RegisterByUserReq = user.RegisterByUserReq
|
||||
RegisterReq = user.RegisterReq
|
||||
Response = user.Response
|
||||
RevokeBizClientData = user.RevokeBizClientData
|
||||
RevokeBizClientReq = user.RevokeBizClientReq
|
||||
@@ -31,18 +30,13 @@ type (
|
||||
UsersByIdsReq = user.UsersByIdsReq
|
||||
|
||||
User interface {
|
||||
Register(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*Response, error)
|
||||
RegisterByUser(ctx context.Context, in *RegisterByUserReq, opts ...grpc.CallOption) (*Response, error)
|
||||
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*Response, error)
|
||||
Info(ctx context.Context, in *InfoReq, opts ...grpc.CallOption) (*Response, error)
|
||||
UserItems(ctx context.Context, in *UserItemsReq, opts ...grpc.CallOption) (*Response, error)
|
||||
UserStatus(ctx context.Context, in *UserStatusReq, opts ...grpc.CallOption) (*Response, error)
|
||||
// 内部:业务创建销售/门店时调用
|
||||
EnsureBizIdentity(ctx context.Context, in *EnsureBizIdentityReq, opts ...grpc.CallOption) (*EnsureBizIdentityData, error)
|
||||
// 内部:批量查用户基础信息
|
||||
UsersByIds(ctx context.Context, in *UsersByIdsReq, opts ...grpc.CallOption) (*UsersByIdsData, error)
|
||||
// 内部:修改手机号
|
||||
UpdateMobile(ctx context.Context, in *UpdateMobileReq, opts ...grpc.CallOption) (*UpdateMobileData, error)
|
||||
// 内部:撤销业务端开通
|
||||
RevokeBizClient(ctx context.Context, in *RevokeBizClientReq, opts ...grpc.CallOption) (*RevokeBizClientData, error)
|
||||
}
|
||||
|
||||
@@ -57,21 +51,16 @@ func NewUser(cli zrpc.Client) User {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultUser) Register(ctx context.Context, in *RegisterReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.Register(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultUser) RegisterByUser(ctx context.Context, in *RegisterByUserReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.RegisterByUser(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultUser) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.Login(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultUser) Info(ctx context.Context, in *InfoReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.Info(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultUser) UserItems(ctx context.Context, in *UserItemsReq, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.UserItems(ctx, in, opts...)
|
||||
@@ -82,25 +71,21 @@ func (m *defaultUser) UserStatus(ctx context.Context, in *UserStatusReq, opts ..
|
||||
return client.UserStatus(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 内部:业务创建销售/门店时调用
|
||||
func (m *defaultUser) EnsureBizIdentity(ctx context.Context, in *EnsureBizIdentityReq, opts ...grpc.CallOption) (*EnsureBizIdentityData, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.EnsureBizIdentity(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 内部:批量查用户基础信息
|
||||
func (m *defaultUser) UsersByIds(ctx context.Context, in *UsersByIdsReq, opts ...grpc.CallOption) (*UsersByIdsData, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.UsersByIds(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 内部:修改手机号
|
||||
func (m *defaultUser) UpdateMobile(ctx context.Context, in *UpdateMobileReq, opts ...grpc.CallOption) (*UpdateMobileData, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.UpdateMobile(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 内部:撤销业务端开通
|
||||
func (m *defaultUser) RevokeBizClient(ctx context.Context, in *RevokeBizClientReq, opts ...grpc.CallOption) (*RevokeBizClientData, error) {
|
||||
client := user.NewUserClient(m.cli.Conn())
|
||||
return client.RevokeBizClient(ctx, in, opts...)
|
||||
|
||||
Reference in New Issue
Block a user