user_reg_count.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package entity
  2. // UserRetentionResp 用于存储用户的留存数据
  3. type UserRetentionResp struct {
  4. Details []*UserRetentionDetail `json:"details"`
  5. }
  6. type UserRetentionDetail struct {
  7. ID string `bson:"_id"` // 用户唯一标识符
  8. RegistrationDate int64 `bson:"registration_date"` // 注册日期
  9. RetentionData Retention `bson:"retention_data"`
  10. }
  11. type UserRetentionReq struct {
  12. StartTime int64 `json:"start_time"` // 开始时间
  13. EndTime int64 `json:"end_time"` // 结束时间
  14. Page int `json:"page"` // 页码
  15. Size int `json:"size"` // 每页数量
  16. }
  17. // UserRetentionData 用于存储用户的留存数据
  18. type UserRetentionData struct {
  19. }
  20. // DayRetention 用于存储单一天数的留存数据
  21. type DayRetention struct {
  22. LoggedIn interface{} `bson:"logged_in"` // 是否在指定天数内登录
  23. LoginDate int64 `bson:"login_date"` // 登录日期
  24. }
  25. // Retention 用于存储不同天数的留存数据
  26. type Retention struct {
  27. Day1 DayRetention `bson:"day_1"`
  28. Day3 DayRetention `bson:"day_3"`
  29. Day7 DayRetention `bson:"day_7"`
  30. Day14 DayRetention `bson:"day_14"`
  31. Day30 DayRetention `bson:"day_30"`
  32. }