Merge pull request 'main' (#461) from main into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/461
This commit is contained in:
chenhao 2024-05-21 18:27:41 +08:00
commit d5f5e3f25b
1 changed files with 23 additions and 0 deletions

View File

@ -662,6 +662,15 @@ func (s *Service) utilCancelAccountByMids(ctx *gin.Context, midList []int64) err
PhoneHash: goproto.String(phoneHash), PhoneHash: goproto.String(phoneHash),
}, },
}) })
if qmgo.IsDup(err) {
err = _DefaultLogin.OpUpdate(ctx, &loginproto.OpUpdateReq{
Login: &dbstruct.Login{
Id: login.Id,
Password: goproto.String(cfg.Password),
PhoneHash: goproto.String(phoneHash + qmgo.NewObjectID().Hex()),
},
})
}
if err != nil { if err != nil {
logger.Error("_DefaultLogin OpUpdate fail, err: %v", err) logger.Error("_DefaultLogin OpUpdate fail, err: %v", err)
return err return err
@ -685,6 +694,20 @@ func (s *Service) utilCancelAccountByMids(ctx *gin.Context, midList []int64) err
Status: goproto.Int64(consts.AccountStatus_Cancelled), Status: goproto.Int64(consts.AccountStatus_Cancelled),
}, },
}) })
if qmgo.IsDup(err) {
err = _DefaultAccount.OpUpdate(ctx, &accountproto.OpUpdateReq{
Account: &dbstruct.Account{
Mid: account.Mid,
Name: goproto.String(cfg.Name),
PhoneHash: goproto.String(phoneHash + qmgo.NewObjectID().Hex()),
MobilePhone: goproto.String(cfg.MobilePhone),
Avatar: &dbstruct.MediaComponent{
ImageIds: &imageIds,
},
Status: goproto.Int64(consts.AccountStatus_Cancelled),
},
})
}
if err != nil { if err != nil {
logger.Error("_DefaultAccount OpUpdate fail, err: %v", err) logger.Error("_DefaultAccount OpUpdate fail, err: %v", err)
return err return err