You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/auto/api/v1/alipay_priv.go

157 lines
3.5 KiB

// Code generated by go-mir. DO NOT EDIT.
// versions:
// - mir v4.0.0
package v1
import (
"net/http"
"github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type AlipayPriv interface {
_default_
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
UserWalletBills(*web.UserWalletBillsReq) (*web.UserWalletBillsResp, mir.Error)
UserRechargeResult(*web.UserRechargeResultReq) (*web.UserRechargeResultResp, mir.Error)
UserRechargeLink(*web.UserRechargeLinkReq) (*web.UserRechargeLinkResp, mir.Error)
mustEmbedUnimplementedAlipayPrivServant()
}
// RegisterAlipayPrivServant register AlipayPriv servant to gin
func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv) {
router := e.Group("v1")
// use chain for router
middlewares := s.Chain()
router.Use(middlewares...)
// register routes info to router
router.Handle("GET", "/user/wallet/bills", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
var (
obj any
err mir.Error
)
req := new(web.UserWalletBillsReq)
obj = req
if bv, ok := obj.(_binding_); !ok {
err = s.Bind(c, req)
} else {
err = bv.Bind(c)
}
if err != nil {
s.Render(c, nil, err)
return
}
obj, err = s.UserWalletBills(req)
if err != nil {
s.Render(c, nil, err)
return
}
if rv, ok := obj.(_render_); !ok {
s.Render(c, obj, nil)
} else {
rv.Render(c)
}
})
router.Handle("GET", "/user/recharge", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
var (
obj any
err mir.Error
)
req := new(web.UserRechargeResultReq)
obj = req
if bv, ok := obj.(_binding_); !ok {
err = s.Bind(c, req)
} else {
err = bv.Bind(c)
}
if err != nil {
s.Render(c, nil, err)
return
}
obj, err = s.UserRechargeResult(req)
if err != nil {
s.Render(c, nil, err)
return
}
if rv, ok := obj.(_render_); !ok {
s.Render(c, obj, nil)
} else {
rv.Render(c)
}
})
router.Handle("POST", "/user/recharge", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
var (
obj any
err mir.Error
)
req := new(web.UserRechargeLinkReq)
obj = req
if bv, ok := obj.(_binding_); !ok {
err = s.Bind(c, req)
} else {
err = bv.Bind(c)
}
if err != nil {
s.Render(c, nil, err)
return
}
obj, err = s.UserRechargeLink(req)
if err != nil {
s.Render(c, nil, err)
return
}
if rv, ok := obj.(_render_); !ok {
s.Render(c, obj, nil)
} else {
rv.Render(c)
}
})
}
// UnimplementedAlipayPrivServant can be embedded to have forward compatible implementations.
type UnimplementedAlipayPrivServant struct{}
func (UnimplementedAlipayPrivServant) Chain() gin.HandlersChain {
return nil
}
func (UnimplementedAlipayPrivServant) UserWalletBills(req *web.UserWalletBillsReq) (*web.UserWalletBillsResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
func (UnimplementedAlipayPrivServant) UserRechargeResult(req *web.UserRechargeResultReq) (*web.UserRechargeResultResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
func (UnimplementedAlipayPrivServant) UserRechargeLink(req *web.UserRechargeLinkReq) (*web.UserRechargeLinkResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
func (UnimplementedAlipayPrivServant) mustEmbedUnimplementedAlipayPrivServant() {}