user_reg_count.go 1.1 KB

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