访客落地页、在线读秒与浏览轨迹
记录进线页面与换页路径,心跳刷新活跃时间;工作台展示落地页/当前页/轨迹时间线与在线时长,嵌入脚本同步宿主 SPA 路由。
This commit is contained in:
@@ -84,6 +84,14 @@ type Session struct {
|
||||
VisitorIP string `gorm:"size:64" json:"visitor_ip"`
|
||||
VisitorRegion string `gorm:"size:100" json:"visitor_region"`
|
||||
UserAgent string `gorm:"size:500" json:"user_agent"`
|
||||
// 落地页 / 当前页(访客浏览轨迹)
|
||||
LandingURL string `gorm:"size:1000" json:"landing_url"`
|
||||
LandingTitle string `gorm:"size:200" json:"landing_title"`
|
||||
Referrer string `gorm:"size:1000" json:"referrer"`
|
||||
CurrentURL string `gorm:"size:1000" json:"current_url"`
|
||||
CurrentTitle string `gorm:"size:200" json:"current_title"`
|
||||
// LastSeenAt 访客最近活跃(心跳/换页),用于在线时长与在线状态
|
||||
LastSeenAt *time.Time `json:"last_seen_at"`
|
||||
LastReadSeq int `gorm:"default:0" json:"last_read_seq"`
|
||||
Status string `gorm:"size:20;default:waiting" json:"status"`
|
||||
Priority string `gorm:"size:20;default:normal" json:"priority"`
|
||||
@@ -95,6 +103,16 @@ type Session struct {
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// VisitorPageView 访客在宿主站的页面浏览记录(按会话)。
|
||||
type VisitorPageView struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
SessionID uint `gorm:"index;not null" json:"session_id"`
|
||||
TenantID uint `gorm:"index;not null" json:"tenant_id"`
|
||||
URL string `gorm:"size:1000;not null" json:"url"`
|
||||
Title string `gorm:"size:200" json:"title"`
|
||||
EnteredAt time.Time `json:"entered_at"`
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
SessionID uint `gorm:"not null;uniqueIndex:idx_message_session_seq" json:"session_id"`
|
||||
|
||||
Reference in New Issue
Block a user