vitality.go 556 B

12345678910111213141516171819202122232425262728293031323334
  1. package vitality
  2. import "bet24.com/log"
  3. //活跃度
  4. type Vitality struct {
  5. DayIndex int //天索引
  6. DayPoint int //天活跃度
  7. WeekIndex int //周索引
  8. WeekPoint int //周活跃度
  9. }
  10. var mgr *vitalitymgr
  11. func Run() {
  12. mgr = NewVitalityMgr()
  13. log.Debug("vitality running")
  14. }
  15. func GetUserInfo(userId int) *uservitality {
  16. return mgr.getUserInfo(userId)
  17. }
  18. func AddPoint(userId, point int) int {
  19. return mgr.addPoint(userId, point)
  20. }
  21. func AddUser(userId int) {
  22. mgr.onUserEnter(userId)
  23. }
  24. func RemoveUser(userId int) {
  25. mgr.onUserExit(userId)
  26. }