优化阅读页跳转逻辑,优先传递章节中间ID(mid),以提升分享功能的一致性。更新相关页面以支持新逻辑,确保用户体验流畅。增加退款功能的相关处理,支持订单退款及退款原因的记录,增强订单管理的灵活性。

This commit is contained in:
Alex-larget
2026-02-28 10:19:46 +08:00
parent 9f77d1cfe2
commit 8af2d808f9
62 changed files with 1168 additions and 1798 deletions

View File

@@ -11,6 +11,7 @@ import (
"soul-api/internal/config"
"soul-api/internal/database"
"soul-api/internal/handler"
"soul-api/internal/router"
"soul-api/internal/wechat"
)
@@ -45,6 +46,28 @@ func main() {
}
}()
// 内置订单对账定时任务SYNC_ORDERS_INTERVAL_MINUTES > 0 时启动)
if cfg.SyncOrdersIntervalMinutes > 0 {
interval := time.Duration(cfg.SyncOrdersIntervalMinutes) * time.Minute
go func() {
// 启动后延迟 1 分钟执行第一次,避免与启动流程抢资源
time.Sleep(1 * time.Minute)
ticker := time.NewTicker(interval)
defer ticker.Stop()
handler.SyncOrdersLogf("内置定时任务已启动,间隔 %d 分钟", cfg.SyncOrdersIntervalMinutes)
for {
ctx := context.Background()
synced, total, err := handler.RunSyncOrders(ctx, 7)
if err != nil {
handler.SyncOrdersLogf("对账失败: %v", err)
} else if total > 0 {
handler.SyncOrdersLogf("本轮检查 %d 笔,补齐 %d 笔漏单", total, synced)
}
<-ticker.C
}
}()
}
quit := make(chan os.Signal, 1)
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
<-quit