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.

48 lines
1.1 KiB

package v1
import (
"fmt"
"github.com/gin-gonic/gin"
"pure-admin/dto"
"pure-admin/model/request"
"pure-admin/model/response"
"pure-admin/service"
)
// @Summary 奖励账户充值
// @Security Bearer
// @Description
// @Tags wallet
// @Param data body request.FundRecharge false "data..."
// @Success 200 {object} response.PayResult "{"code": 0, "data": [...]}"
// @Success 200 {string} string "{"code": 1, "message": ""}"
// @Router /wallet/fund/recharge [post]
func FundRecharge(c *gin.Context) {
var (
err error
params request.FundRecharge
result response.PayResult
)
_ = c.ShouldBindJSON(&params)
err, result = service.FundRecharge(&params)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
response.OkWithDataMessage(result, "ok", c)
}
func PaymentPayback(c *gin.Context) {
var (
err error
params dto.PaybackBody
)
_ = c.ShouldBind(&params)
fmt.Println(params)
err = service.PaypalCallback(&params)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
response.OkWithMessage("回调成功", c)
}