feat: user check update reate

This commit is contained in:
zzw
2026-09-16 10:36:59 +08:00
parent 8457b46fe4
commit f94b610aa3
32 changed files with 1591 additions and 543 deletions
+9 -9
View File
@@ -12,42 +12,42 @@ import (
const saleClientCode = "sale_beauty"
func ensureSaleIdentity(ctx context.Context, userSvcName, mobile, password string) (*userpb.EnsureBizIdentityData, error) {
func ensureSaleIdentity(ctx context.Context, userSvcName, mobile, password string) (*userpb.InternalCreateData, error) {
cli, err := rpcclient.Get(userSvcName)
if err != nil {
return nil, err
}
return userpb.NewUserClient(cli.Conn()).EnsureBizIdentity(ctx, &userpb.EnsureBizIdentityReq{
return userpb.NewUserClient(cli.Conn()).InternalCreate(ctx, &userpb.InternalCreateReq{
Mobile: mobile,
ClientCode: saleClientCode,
CredentialType: "password",
ClientCode: []string{saleClientCode},
CredentialType: []string{"password"},
Secret: password,
})
}
func updateSaleUserMobile(ctx context.Context, userSvcName string, userId int64, mobile string) (*userpb.UpdateMobileData, error) {
func updateSaleUserMobile(ctx context.Context, userSvcName string, userId int64, mobile string) (*userpb.InternalUpdateMobileData, error) {
cli, err := rpcclient.Get(userSvcName)
if err != nil {
return nil, err
}
return userpb.NewUserClient(cli.Conn()).UpdateMobile(ctx, &userpb.UpdateMobileReq{
return userpb.NewUserClient(cli.Conn()).InternalUpdateMobile(ctx, &userpb.InternalUpdateMobileReq{
UserId: userId,
Mobile: mobile,
})
}
func revokeSaleUserClient(ctx context.Context, userSvcName string, userId int64) (*userpb.RevokeBizClientData, error) {
func revokeSaleUserClient(ctx context.Context, userSvcName string, userId int64) (*userpb.InternalRevokeBizClientData, error) {
cli, err := rpcclient.Get(userSvcName)
if err != nil {
return nil, err
}
return userpb.NewUserClient(cli.Conn()).RevokeBizClient(ctx, &userpb.RevokeBizClientReq{
return userpb.NewUserClient(cli.Conn()).InternalRevokeBizClient(ctx, &userpb.InternalRevokeBizClientReq{
UserId: userId,
ClientCode: saleClientCode,
})
}
func reopenSaleUserClient(ctx context.Context, userSvcName, mobile string) (*userpb.EnsureBizIdentityData, error) {
func reopenSaleUserClient(ctx context.Context, userSvcName, mobile string) (*userpb.InternalCreateData, error) {
return ensureSaleIdentity(ctx, userSvcName, mobile, utils.StringEmpty)
}