outer raven

This commit is contained in:
lwl0608 2024-07-29 15:33:42 +08:00
parent af2b7c9d18
commit 759a138d06
5 changed files with 40 additions and 5 deletions

View File

@ -320,6 +320,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)

View File

@ -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)

View File

@ -129,7 +129,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

View File

@ -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{

View File

@ -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 {