feat: 排行榜不再展示任何IP,用户列显示地区(ip2region v4 离线库)+浏览器(UA解析);IP仅后台保存,页面上方显示IP+地区

This commit is contained in:
dsh
2026-08-17 23:10:02 -04:00
parent 780e84e67e
commit d8917a666a
9 changed files with 229 additions and 83 deletions
+4 -2
View File
@@ -5,8 +5,10 @@ import "time"
// SpeedTestResult 一次完整的测速结果记录
type SpeedTestResult struct {
ID uint `gorm:"primaryKey" json:"id"`
ClientIP string `gorm:"size:64;index" json:"client_ip"` // 展示 IP(优先前端探测的公网出口 IP
ServerIP string `gorm:"size:64" json:"server_ip"` // 服务器看到的来源 IPNAT 环境下为内网 IP,用于区分设备
ClientIP string `gorm:"size:64;index" json:"client_ip"` // 客户端 IP(仅后台保存,不对外展示
ServerIP string `gorm:"size:64" json:"server_ip"` // 服务器看到的来源 IPNAT 调试用,仅后台保存
Location string `gorm:"size:64" json:"location"` // 地区(ip2region 离线解析)
UserAgent string `gorm:"size:256" json:"user_agent"` // 浏览器 UA(仅后台保存)
LatencyMs float64 `json:"latency_ms"` // 延迟(毫秒,取中位数)
JitterMs float64 `json:"jitter_ms"` // 抖动(毫秒,平均绝对偏差)
DownloadMbps float64 `json:"download_mbps"` // 下载速度(Mbps