小程序一些功能更新

This commit is contained in:
李琦
2026-09-29 15:48:13 +08:00
parent 3bb7fa8db3
commit 75499ba85c
29 changed files with 1299 additions and 196 deletions

View File

@@ -26,6 +26,7 @@ const (
cronPatternScanRemind = "0 */1 * * * *" // 笔记提醒扫描:每 1 分钟
cronPatternReleaseCoupons = "0 */5 * * * *" // 免单券超时占用释放:每 5 分钟
cronPatternCloseOrders = "0 */5 * * * *" // 订单超时关闭:每 5 分钟
cronPatternRefundPoll = "0 */2 * * * *" // 退款结果轮询:每 2 分钟(logic/order_refund.go)
)
var (
@@ -76,6 +77,16 @@ var (
g.Log().Infof(ctx, "[cron] 已注册任务 %s pattern=%q", "order-close-pending", cronPatternCloseOrders)
}
// 退款结果轮询兜底:xpay_refund_notify 推送丢失时,主动查单确认「退款中」的订单
// (确认成功→终态+回收权益;超 24h 不可判定→置失败待人工)。每 2 分钟。
if _, err = gcron.AddSingleton(ctx, cronPatternRefundPoll, func(c context.Context) {
logic.RefundStatusPoll(c)
}, "refund-status-poll"); err != nil {
g.Log().Warningf(ctx, "[cron] 退款轮询任务注册失败: %v", err)
} else {
g.Log().Infof(ctx, "[cron] 已注册任务 %s pattern=%q", "refund-status-poll", cronPatternRefundPoll)
}
s := g.Server()
// 公开接口:小程序登录、开发登录、管理端登录、虚拟支付发货推送回调
s.Group("/", func(group *ghttp.RouterGroup) {