(userID string)
| 369 | } |
| 370 | |
| 371 | func (s *UserStore) ListUserNodeUsage(userID string) ([]users.UserNodeUsage, error) { |
| 372 | rows, err := sqlcgen.New(s.db).ListUserNodeUsage(context.Background(), userID) |
| 373 | if err != nil { |
| 374 | return nil, fmt.Errorf("list user node usage: %w", err) |
| 375 | } |
| 376 | out := make([]users.UserNodeUsage, 0, len(rows)) |
| 377 | for _, r := range rows { |
| 378 | out = append(out, users.UserNodeUsage{ |
| 379 | NodeID: r.NodeID, |
| 380 | UploadBytes: r.UploadBytes, |
| 381 | DownloadBytes: r.DownloadBytes, |
| 382 | }) |
| 383 | } |
| 384 | return out, nil |
| 385 | } |
| 386 | |
| 387 | // ListTodayUserStats 返回今日有流量的用户统计(跨节点合并),按总流量降序。 |
| 388 | func (s *UserStore) ListTodayUserStats(limit int) ([]users.TodayUserStat, error) { |
nothing calls this directly
no test coverage detected