|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package hdl
-
- import (
- md2 "applet/app/customer/md"
- svc2 "applet/app/customer/svc"
- "applet/app/db"
- "applet/app/e"
- "applet/app/enum"
- "applet/app/utils"
- "fmt"
- "github.com/gin-gonic/gin"
- "time"
- )
-
- // Demo 测试
- func Demo(c *gin.Context) {
- sysCfgDb := db.SysCfgDb{}
- sysCfgDb.Set()
- sysCfg := sysCfgDb.SysCfgFindWithDb(enum.OpenAlipayAppid, enum.OpenAlipayAppPrivateKey, enum.OpenAlipayPublicKey)
-
- //调用支付宝进行退款
- err6, _ := svc2.CurlAlipayTradeRefund(md2.CurlAlipayTradeRefundReq{
- Config: struct {
- PayAliAppId string `json:"pay_ali_app_id" label:"支付宝开放平台-第三方应用-appid"`
- PayAliPrivateKey string `json:"pay_ali_private_key" label:"支付宝开放平台-第三方应用-接口加签-应用私钥"`
- PayAliPublicKey string `json:"pay_ali_public_key" label:"支付宝开放平台-第三方应用-接口加签-支付宝公钥"`
- }{
- PayAliAppId: sysCfg[enum.OpenAlipayAppid],
- PayAliPrivateKey: sysCfg[enum.OpenAlipayAppPrivateKey],
- PayAliPublicKey: sysCfg[enum.OpenAlipayPublicKey],
- },
- OutTradeNo: "SMIT1D20238140046521695702623232",
- RefundAmount: "2.00",
- RefundReason: "测试刷脸支付退款",
- OutRequestNo: utils.OrderUUID(1997),
- AppAuthToken: "202309BB893c46c0d6214c16913fb2268e5bdE03",
- })
- if err6 != nil {
- fmt.Println(err6.Error())
- }
- return
- qrcodeWithBatchRecordsDb := db.AdminDb{}
- qrcodeWithBatchRecordsDb.Set()
- data, _, err := qrcodeWithBatchRecordsDb.GetAdminRolePermission(1001)
- if err != nil {
- e.OutErr(c, e.ERR_DB_ORM, err.Error())
- return
- }
- e.OutSuc(c, data, nil)
- go GoOnExecuting()
- return
- }
-
- func GoOnExecuting() {
- for i := 0; i < 20; i++ {
- time.Sleep(1 * time.Second)
- fmt.Println(i)
- }
- }
|