manual unlock wechat

This commit is contained in:
lwl0608 2024-05-29 15:26:24 +08:00
parent 4887207e0a
commit 6d1e62324e
6 changed files with 49 additions and 5 deletions

View File

@ -134,3 +134,10 @@ type OpZoneRefundVO struct {
type OpZoneRefundListData struct { type OpZoneRefundListData struct {
List []*OpZoneRefundVO `json:"list"` List []*OpZoneRefundVO `json:"list"`
} }
type OpManualUnlockWechatParam struct {
Mid int64 `json:"mid"` // 用户mid
StreamerMid int64 `json:"streamer_mid"` // 主播id
ProductId string `json:"product_id"` // 商品id
Oid2 string `json:"oid2"` // oid2
}

View File

@ -302,6 +302,7 @@ func Init(r *gin.Engine) {
opVasPayGroup.POST("refund_coin_order", middleware.JSONParamValidator(vasproto.RefundCoinOrderReq{}), RefundCoinOrder) opVasPayGroup.POST("refund_coin_order", middleware.JSONParamValidator(vasproto.RefundCoinOrderReq{}), RefundCoinOrder)
opVasPayGroup.POST("wxpay_callback_manual", middleware.JSONParamValidator(vasproto.WxpayCallbackManualParam{}), WxpayCallbackManual) opVasPayGroup.POST("wxpay_callback_manual", middleware.JSONParamValidator(vasproto.WxpayCallbackManualParam{}), WxpayCallbackManual)
opVasPayGroup.POST("zone_refund_list", middleware.JSONParamValidator(zoneproto.OpZoneRefundListParam{}), OpZoneRefundList) opVasPayGroup.POST("zone_refund_list", middleware.JSONParamValidator(zoneproto.OpZoneRefundListParam{}), OpZoneRefundList)
opVasPayGroup.POST("manual_unlock_wechat", middleware.JSONParamValidator(zoneproto.OpManualUnlockWechatParam{}), OpManualUnlockWechat)
// 验证码 // 验证码
opVeriCodeGroup := r.Group("/op/veri_code", PrepareOp()) opVeriCodeGroup := r.Group("/op/veri_code", PrepareOp())

View File

@ -60,3 +60,18 @@ func OpZoneRefundList(ctx *gin.Context) {
} }
ReplyOk(ctx, data) ReplyOk(ctx, data)
} }
func OpManualUnlockWechat(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*zoneproto.OpManualUnlockWechatParam)
ec, err := service.DefaultService.OpManualUnlockWechat(ctx, req)
if ec != errcode.ErrCodeVasSrvOk {
logger.Error("RefundOrder fail, req: %v, ec: %v", util.ToJson(req), ec)
if err != nil {
ReplyErrorMsg(ctx, err.Error())
return
}
ReplyErrCodeMsg(ctx, ec)
return
}
ReplyOk(ctx, nil)
}

View File

@ -684,6 +684,7 @@ func (v *Vas) OneStepUnlockContact(ctx *gin.Context, req *vasproto.OneStepUnlock
retContact = uVasInfo.WechatContact retContact = uVasInfo.WechatContact
} }
} }
logger.Info("OneStepUnlockContact success, req: %v, coinOrderId: %v", util.ToJson(req), orderId)
}() }()
// 锁钱包 余额检查 // 锁钱包 余额检查
@ -820,10 +821,12 @@ func (v *Vas) OneStepUnlockContact(ctx *gin.Context, req *vasproto.OneStepUnlock
} }
// 是否达到铁粉解锁条件 // 是否达到铁粉解锁条件
_err := v.UnlockZoneIronfanshipReachConsume(ctx, tx, coinOrder.GetMid(), 0, coinOrder.GetUid()) if coinPrice > 0 {
if _err != nil { _err := v.UnlockZoneIronfanshipReachConsume(ctx, tx, coinOrder.GetMid(), 0, coinOrder.GetUid())
logger.Error("UnlockZoneIronfanshipReachConsume fail, coinOrder: %v, err: %v", util.ToJson(coinOrder), _err) if _err != nil {
return logger.Error("UnlockZoneIronfanshipReachConsume fail, coinOrder: %v, err: %v", util.ToJson(coinOrder), _err)
return
}
} }
return return
} }

View File

@ -505,7 +505,7 @@ func (v *Vas) UnlockZoneIronfanshipReachConsume(ctx *gin.Context, tx *sqlx.Tx, m
// 解锁铁粉 // 解锁铁粉
err := v.MustUnlockIronfanship(ctx, tx, mid, zid, -1, "ironfan", dbstruct.ZoneUnlockTypeReachConsume) err := v.MustUnlockIronfanship(ctx, tx, mid, zid, -1, "ironfan", dbstruct.ZoneUnlockTypeReachConsume)
if err != nil { if err != nil {
logger.Error("UnlockZoneAdmission fail, mid: %v, zid: %v, err: %v", mid, zid, err) logger.Error("MustUnlockIronfanship fail, mid: %v, zid: %v, err: %v", mid, zid, err)
return err return err
} }

View File

@ -4,6 +4,7 @@ import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
goproto "google.golang.org/protobuf/proto" goproto "google.golang.org/protobuf/proto"
"service/api/base"
"service/api/errcode" "service/api/errcode"
"service/api/errs" "service/api/errs"
accountproto "service/api/proto/account/proto" accountproto "service/api/proto/account/proto"
@ -1070,3 +1071,20 @@ func (s *Service) ZoneMomentOrderList(ctx *gin.Context, req *vasproto.ZoneMoment
} }
return return
} }
func (s *Service) OpManualUnlockWechat(ctx *gin.Context, req *zoneproto.OpManualUnlockWechatParam) (ec errcode.ErrCode, err error) {
_, _, _, err = _DefaultVas.OneStepUnlockContact(ctx, &vasproto.OneStepUnlockContactReq{
BaseRequest: base.BaseRequest{
Mid: req.Mid,
},
ContactProductId: req.ProductId,
Uid: req.StreamerMid,
Oid2: req.Oid2,
})
ec, err = errs.DealVasErr(err)
if err != nil {
logger.Error("OneStepUnlockContact fail, req: %v, err: %v", util.ToJson(req), err)
return
}
return
}