manual unlock wechat
This commit is contained in:
parent
4887207e0a
commit
6d1e62324e
|
@ -134,3 +134,10 @@ type OpZoneRefundVO struct {
|
|||
type OpZoneRefundListData struct {
|
||||
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
|
||||
}
|
||||
|
|
|
@ -302,6 +302,7 @@ func Init(r *gin.Engine) {
|
|||
opVasPayGroup.POST("refund_coin_order", middleware.JSONParamValidator(vasproto.RefundCoinOrderReq{}), RefundCoinOrder)
|
||||
opVasPayGroup.POST("wxpay_callback_manual", middleware.JSONParamValidator(vasproto.WxpayCallbackManualParam{}), WxpayCallbackManual)
|
||||
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())
|
||||
|
|
|
@ -60,3 +60,18 @@ func OpZoneRefundList(ctx *gin.Context) {
|
|||
}
|
||||
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)
|
||||
}
|
||||
|
|
|
@ -684,6 +684,7 @@ func (v *Vas) OneStepUnlockContact(ctx *gin.Context, req *vasproto.OneStepUnlock
|
|||
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 _err != nil {
|
||||
logger.Error("UnlockZoneIronfanshipReachConsume fail, coinOrder: %v, err: %v", util.ToJson(coinOrder), _err)
|
||||
return
|
||||
if coinPrice > 0 {
|
||||
_err := v.UnlockZoneIronfanshipReachConsume(ctx, tx, coinOrder.GetMid(), 0, coinOrder.GetUid())
|
||||
if _err != nil {
|
||||
logger.Error("UnlockZoneIronfanshipReachConsume fail, coinOrder: %v, err: %v", util.ToJson(coinOrder), _err)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/base64"
|
||||
"fmt"
|
||||
goproto "google.golang.org/protobuf/proto"
|
||||
"service/api/base"
|
||||
"service/api/errcode"
|
||||
"service/api/errs"
|
||||
accountproto "service/api/proto/account/proto"
|
||||
|
@ -1070,3 +1071,20 @@ func (s *Service) ZoneMomentOrderList(ctx *gin.Context, req *vasproto.ZoneMoment
|
|||
}
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue