Merge branch 'add_raven' into test
This commit is contained in:
commit
940b5d7400
|
@ -326,6 +326,9 @@ func Init(r *gin.Engine) {
|
|||
vasPayGroup.POST("moment_order_list", middleware.JSONParamValidator(vasproto.ZoneMomentOrderListReq{}), middleware.JwtAuthenticator(), ZoneMomentOrderList)
|
||||
vasPayGroup.POST("income_page", middleware.JSONParamValidator(vasproto.IncomePageReq{}), middleware.JwtAuthenticator(), IncomePage)
|
||||
|
||||
outerVasGroup := r.Group("/outer/vas")
|
||||
outerVasGroup.POST("create_order", middleware.JSONParamValidator(vasproto.CreateOrderReq{}), CreateOrderOuter)
|
||||
|
||||
extVasPayGroup := r.Group("/ext/vas")
|
||||
extVasPayGroup.POST("alipay_callback", AlipayCallback)
|
||||
extVasPayGroup.POST("wxpay_callback", WxpayCallback)
|
||||
|
|
|
@ -109,6 +109,36 @@ func CreateOrderWxPub(ctx *gin.Context) {
|
|||
ReplyOk(ctx, data)
|
||||
}
|
||||
|
||||
func CreateOrderOuter(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*vasproto.CreateOrderReq)
|
||||
if req.From != dbstruct.VasCoinOrderFromOuterRaven {
|
||||
logger.Error("CreateOrder, invalid param, req: %v", util.ToJson(req))
|
||||
ReplyErrCodeMsg(ctx, errcode.ErrCodeBadParam)
|
||||
return
|
||||
}
|
||||
if req.PayType != vasproto.PayTypeAlipayH5 || len(req.ProductId) <= 0 {
|
||||
logger.Error("CreateOrder, invalid param, req: %v", util.ToJson(req))
|
||||
ReplyErrCodeMsg(ctx, errcode.ErrCodeBadParam)
|
||||
return
|
||||
}
|
||||
if len(req.Model) >= 28 {
|
||||
req.Model = req.Model[:28]
|
||||
}
|
||||
req.Mid = 100000001
|
||||
|
||||
data, ec, err := service.DefaultService.CreateOrder(ctx, req)
|
||||
if ec != errcode.ErrCodeVasSrvOk {
|
||||
logger.Error("CreateOrder fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
if ec == errcode.ErrCodeVasSrvFail && err != nil {
|
||||
ReplyErrorMsg(ctx, err.Error())
|
||||
return
|
||||
}
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
return
|
||||
}
|
||||
ReplyOk(ctx, data)
|
||||
}
|
||||
|
||||
// op充值
|
||||
func OpCreateOrder(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*vasproto.OpCreateOrderReq)
|
||||
|
|
|
@ -130,7 +130,6 @@ type CreateOrderProxy struct {
|
|||
}
|
||||
|
||||
func (v *Vas) CreateOrder(ctx *gin.Context, req *vasproto.CreateOrderReq) (data *vasproto.CreateOrderData, err error) {
|
||||
|
||||
_, err = v.createOrderProxy.PreProc(ctx, req)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
@ -38,6 +38,8 @@ const (
|
|||
ProductIdH5ZoneAdmission = "h5_zone_admission" // 空间普通会员
|
||||
ProductIdH5ZoneIronfanship = "h5_zone_ironfanship" // 空间铁粉
|
||||
ProductIdH5ZoneSuperfanship = "h5_zone_superfanship" // 空间超粉
|
||||
|
||||
ProductIdOuterRaven = "outer_raven" // 瑞文测试
|
||||
)
|
||||
|
||||
var ProductIdDescMap = map[string]string{
|
||||
|
|
|
@ -323,10 +323,11 @@ var CoinOrderStatusDescMap = map[int32]string{
|
|||
}
|
||||
|
||||
const (
|
||||
VasCoinOrderFromApp = "app" // app应用内
|
||||
VasCoinOrderFromH5 = "h5" // h5
|
||||
VasCoinOrderFromOp = "op" // op
|
||||
VasCoinOrderFromWxPub = "wx_pub" // 微信小程序
|
||||
VasCoinOrderFromApp = "app" // app应用内
|
||||
VasCoinOrderFromH5 = "h5" // h5
|
||||
VasCoinOrderFromOp = "op" // op
|
||||
VasCoinOrderFromWxPub = "wx_pub" // 微信小程序
|
||||
VasCoinOrderFromOuterRaven = "outer_raven" // 瑞文测试
|
||||
)
|
||||
|
||||
type CoinOrder struct {
|
||||
|
|
Loading…
Reference in New Issue