This commit is contained in:
ryan
2026-07-13 15:17:45 +08:00
parent 08e61ce833
commit e0eb4e5975
334 changed files with 17212 additions and 12321 deletions
+1 -1
View File
@@ -93,4 +93,4 @@ func applyFilter(query *gorm.DB, filter AccessLogFilter) *gorm.DB {
query = query.Where("created_at <= ?", *filter.EndTime)
}
return query
}
}
@@ -14,4 +14,4 @@ type AccessLogFilter struct {
StartTime *time.Time
// EndTime filters created_at <= EndTime when non-nil.
EndTime *time.Time
}
}
@@ -156,4 +156,4 @@ func GetTopActiveUsers(ctx context.Context, startTime time.Time, limit int) ([]T
return nil, fmt.Errorf("get top active users: %w", err)
}
return users, nil
}
}
@@ -141,10 +141,10 @@ func TestBatchInsert_UsesModelBatchSQL(t *testing.T) {
}
type mockConn struct {
batch driver.Batch
batchQuery string
prepareCalled bool
preparedQuery string
batch driver.Batch
batchQuery string
prepareCalled bool
preparedQuery string
}
func (m *mockConn) Contributors() []string { return nil }
@@ -204,4 +204,4 @@ func (m *mockBatch) Rows() int { return len(m.rows) }
func (m *mockBatch) Columns() []column.Interface { return nil }
func (m *mockBatch) Close() error { return nil }
func (m *mockBatch) Close() error { return nil }
@@ -46,4 +46,4 @@ func BatchInsert(ctx context.Context, logs []analyticsmodel.UserAccessLog) error
return fmt.Errorf("send clickhouse batch: %w", err)
}
return nil
}
}
+1 -1
View File
@@ -27,4 +27,4 @@ func ParseBrowserName(ua string) string {
return "Safari"
}
return "Other"
}
}