修改交易服务函数命名;调整 docker compose 脚本;

This commit is contained in:
2025-08-14 18:10:04 +08:00
parent 47b6d2433f
commit 5541e16f0d
9 changed files with 172 additions and 124 deletions

33
web/tasks/log.go Normal file
View File

@@ -0,0 +1,33 @@
package tasks
import (
"encoding/json"
"github.com/hibiken/asynq"
"log/slog"
"time"
)
type RequestLog struct {
Type string
User int32
IP string
UA string
Method string
Path string
Status int
Error string
Latency time.Duration
Time time.Time
}
func NewRequestLog(data RequestLog) *asynq.Task {
var rs, err = json.Marshal(data)
if err != nil {
slog.Error("日志数据序列化失败", slog.Any("err", err), slog.Any("data", data))
return nil
}
return asynq.NewTask("logs:request", rs)
}
type LoginLog struct {
}