rank.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package ut
  2. import (
  3. "go-common/library/time"
  4. "sync"
  5. )
  6. // RankResp resp result of rank list
  7. type RankResp struct {
  8. UserName string `gorm:"column:username" json:"username"`
  9. Score float64 `gorm:"-" json:"score"`
  10. Newton float64 `gorm:"-" json:"newton"`
  11. Coverage float64 `gorm:"-" json:"coverage"`
  12. PassRate float64 `gorm:"-" json:"pass_rate"`
  13. Assertions int `gorm:"-" json:"assertions"`
  14. Passed int `gorm:"-" json:"passed"`
  15. AvatarURL string `gorm:"-" json:"avatar_url"`
  16. Mtime time.Time `gorm:"column:mtime" json:"mtime"`
  17. Rank int `gorm:"-" json:"rank"`
  18. Total int `gorm:"-" json:"total"`
  19. Change int `gorm:"-" json:"change"`
  20. }
  21. // RanksCache ranks cache.
  22. type RanksCache struct {
  23. Slice []*RankResp
  24. Map map[string]*RankResp
  25. sync.Mutex
  26. }
  27. // Image image of gitlab
  28. type Image struct {
  29. ID int `json:"id"`
  30. Name string `json:"name"`
  31. Username string `json:"username"`
  32. State string `json:"state"`
  33. AvatarURL string `json:"avatar_url"`
  34. WebURL string `json:"web_url"`
  35. }