Merge branch 'dev-lwl/unlock_opt' into test

This commit is contained in:
lwl0608 2024-10-10 09:17:12 +08:00
commit 52811bbc7a
4 changed files with 34 additions and 2 deletions

View File

@ -338,7 +338,7 @@ func isWithdrawAnyDiasEnable(mid int64) bool {
// 提现发送验证码
func WithdrawSendVerifycode(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*vasproto.WithdrawSendVerifycodeReq)
if isWithdrawFreeze(req.Mid) {
if service.DefaultService.IsWithdrawFreeze(ctx, req.Mid) {
ReplyErrorMsg(ctx, "当前提现功能已冻结")
return
}
@ -356,7 +356,7 @@ func WithdrawApply(ctx *gin.Context) {
//ReplyErrorMsg(ctx, "提现功能维护中请72小时后再试")
//return
req := ctx.MustGet("client_req").(*vasproto.WithdrawApplyReq)
if isWithdrawFreeze(req.Mid) {
if service.DefaultService.IsWithdrawFreeze(ctx, req.Mid) {
ReplyErrorMsg(ctx, "当前提现功能已冻结")
return
}

View File

@ -334,3 +334,20 @@ func (m *Mongo) GetWithdrawFreezeByUserId(ctx *gin.Context, userId int64) (*dbst
}
return doc, nil
}
func (m *Mongo) GetWithdrawFreezeByMid(ctx *gin.Context, mid int64) (*dbstruct.WithdrawFreeze, error) {
doc := new(dbstruct.WithdrawFreeze)
col := m.getColWithdrawFreeze()
query := qmgo.M{
"mid": mid,
}
err := col.Find(ctx, query).One(&doc)
if err == qmgo.ErrNoSuchDocuments {
err = nil
return nil, nil
}
if err != nil {
return nil, err
}
return doc, nil
}

View File

@ -4290,3 +4290,11 @@ func (v *Vas) GetWithdrawFreezeByUserId(ctx *gin.Context, userId int64) (*dbstru
func (v *Vas) GetWithdrawFreezeList(ctx *gin.Context) ([]*dbstruct.WithdrawFreeze, error) {
return v.store.GetWithdrawFreezeList(ctx)
}
func (v *Vas) IsWithdrawFreeze(ctx *gin.Context, mid int64) bool {
doc, _ := v.store.GetWithdrawFreezeByMid(ctx, mid)
if doc != nil {
return true
}
return false
}

View File

@ -1457,6 +1457,9 @@ func (s *Service) OpDelWithdrawFreeze(ctx *gin.Context, req *vasproto.OpDelWithd
defer func() {
ec, err = errs.DealVasErr(err)
}()
defer func() {
_ = _DefaultHistory.WriteOne(ctx, dbstruct.HistoryTypeVas, "del_withdraw_freeze", req, nil, nil)
}()
err = _DefaultVas.DelWithdrawFreeze(ctx, req.UserId)
if err != nil {
@ -1478,3 +1481,7 @@ func (s *Service) OpGetWithdrawFreezeList(ctx *gin.Context, req *vasproto.OpGetW
}
return
}
func (s *Service) IsWithdrawFreeze(ctx *gin.Context, mid int64) bool {
return _DefaultVas.IsWithdrawFreeze(ctx, mid)
}