user_reg_count.go 1.3 KB

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