修改支付相关

This commit is contained in:
Yvan
2026-09-24 17:44:17 +08:00
parent 5c1da5bf55
commit a16b8f8e89
6 changed files with 270 additions and 15 deletions
+2
View File
@@ -433,6 +433,8 @@ func routedLogPaths(module string, level zapcore.Level) []string {
paths = append(paths, filepath.Join("http", "access.log"))
case "timedTask":
paths = append(paths, filepath.Join("timedTask", "task.log"))
case "payment", "payment-callback":
paths = append(paths, filepath.Join("payment", "payment.log"))
case "websocket":
paths = append(paths, filepath.Join("websocket", "websocket.log"))
case "error":
+3
View File
@@ -42,6 +42,8 @@ func TestZapHandlerRoutesHTTPAndErrorLogs(t *testing.T) {
logger := slog.New(handler)
logger.Info("request", "mod", "http", "request_id", "req-1")
logger.Info("handshake", "mod", "websocket")
logger.Info("payment started", "mod", "payment", "trade_no", "order-1")
logger.Info("callback received", "mod", "payment-callback", "payment_provider", "wechat-v3")
logger.Error("failed", "mod", "users")
cleanup()
@@ -54,6 +56,7 @@ func TestZapHandlerRoutesHTTPAndErrorLogs(t *testing.T) {
filepath.Join(root, date, "application.log"),
filepath.Join(root, date, "http", "access.log"),
filepath.Join(root, date, "websocket", "websocket.log"),
filepath.Join(root, date, "payment", "payment.log"),
filepath.Join(root, date, "users", "application.log"),
filepath.Join(root, date, "error", "error.log"),
}