Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
package rechargectrl
import (
"errors"
"fmt"
"net/http"
"time"
"91porn-server/common/log"
"91porn-server/common/rchgutil"
"91porn-server/web/service/rechargeser"
"github.com/gin-gonic/gin"
)
// IZhiFuCallBack 金鱼结构回调函数
func IZhiFuCallBack(ctx *gin.Context) {
if err := func() error {
rchg := rchgutil.IZhiFuRes{}
if err := ctx.ShouldBind(&rchg); err != nil {
log.Error(fmt.Sprintf("IZhiFu callback parameter bind fail error:%+v:", err))
return err
}
log.Info(fmt.Sprintf("IZhiFu callback parameter data:%+v:", rchg))
if rchg.Sign != rchg.ToSign() {
log.Error("IZhiFu callback sign verify fail")
return errors.New("check sign fail")
}
var status int = 100
if rchg.Code == rchgutil.IZhiFuSuccess {
status = 200
}
paymentAt, err := rchg.QueryOrder()
if err != nil {
paymentAt = time.Now()
}
if err = rechargeser.RechargeCallBack(ctx, "", rchg.PayMoney, rchg.TradeNo, status, paymentAt); err != nil {
log.Error(fmt.Sprintf("IZhiFu RechargeCallBack fail error:%+v:", err))
}
return err
}(); err != nil {
ctx.String(http.StatusBadRequest, "fail")
return
}
ctx.String(http.StatusOK, "success")
}