智慧食堂
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package hdl
  2. import (
  3. md2 "applet/app/customer/md"
  4. svc2 "applet/app/customer/svc"
  5. "applet/app/db"
  6. "applet/app/e"
  7. "applet/app/enum"
  8. "applet/app/utils"
  9. "fmt"
  10. "github.com/gin-gonic/gin"
  11. "time"
  12. )
  13. // Demo 测试
  14. func Demo(c *gin.Context) {
  15. sysCfgDb := db.SysCfgDb{}
  16. sysCfgDb.Set()
  17. sysCfg := sysCfgDb.SysCfgFindWithDb(enum.OpenAlipayAppid, enum.OpenAlipayAppPrivateKey, enum.OpenAlipayPublicKey)
  18. //调用支付宝进行退款
  19. err6, _ := svc2.CurlAlipayTradeRefund(md2.CurlAlipayTradeRefundReq{
  20. Config: struct {
  21. PayAliAppId string `json:"pay_ali_app_id" label:"支付宝开放平台-第三方应用-appid"`
  22. PayAliPrivateKey string `json:"pay_ali_private_key" label:"支付宝开放平台-第三方应用-接口加签-应用私钥"`
  23. PayAliPublicKey string `json:"pay_ali_public_key" label:"支付宝开放平台-第三方应用-接口加签-支付宝公钥"`
  24. }{
  25. PayAliAppId: sysCfg[enum.OpenAlipayAppid],
  26. PayAliPrivateKey: sysCfg[enum.OpenAlipayAppPrivateKey],
  27. PayAliPublicKey: sysCfg[enum.OpenAlipayPublicKey],
  28. },
  29. OutTradeNo: "SMIT1D20238140046521695702623232",
  30. RefundAmount: "2.00",
  31. RefundReason: "测试刷脸支付退款",
  32. OutRequestNo: utils.OrderUUID(1997),
  33. AppAuthToken: "202309BB893c46c0d6214c16913fb2268e5bdE03",
  34. })
  35. if err6 != nil {
  36. fmt.Println(err6.Error())
  37. }
  38. return
  39. qrcodeWithBatchRecordsDb := db.AdminDb{}
  40. qrcodeWithBatchRecordsDb.Set()
  41. data, _, err := qrcodeWithBatchRecordsDb.GetAdminRolePermission(1001)
  42. if err != nil {
  43. e.OutErr(c, e.ERR_DB_ORM, err.Error())
  44. return
  45. }
  46. e.OutSuc(c, data, nil)
  47. go GoOnExecuting()
  48. return
  49. }
  50. func GoOnExecuting() {
  51. for i := 0; i < 20; i++ {
  52. time.Sleep(1 * time.Second)
  53. fmt.Println(i)
  54. }
  55. }