chapter.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package forms
  2. type ChapterOrdinaryListReq struct {
  3. PlayerId int64 `form:"player_id" json:"player_id" binding:"required"`
  4. }
  5. type ChapterActivityListReq struct {
  6. PlayerId int64 `form:"player_id" json:"player_id" binding:"required"`
  7. }
  8. // 重新进入
  9. type ChapterReconnectReq struct {
  10. ListReq
  11. ChannelId string `json:"channel_id" form:"channel_id"`
  12. Day string `form:"day"`
  13. EndDay string `form:"endDay"`
  14. ServerId int `json:"server_id" form:"server_id"`
  15. }
  16. type ChapterReconnectItem struct {
  17. Id int `json:"key"`
  18. Index int `json:"index"`
  19. ChapterId int `json:"chapter_id"`
  20. Chapter string `json:"chapter"`
  21. DifficultyIndex int `json:"difficulty_index"`
  22. Difficulty string `json:"difficulty"`
  23. DieCount int64 `json:"die_count"`
  24. DieUserCount int64 `json:"die_user_count"`
  25. NewDieCount int64 `json:"new_die_count"`
  26. NewDieUserCount int64 `json:"new_die_user_count"`
  27. }
  28. type ChapterReconnectRespData struct {
  29. ListRes
  30. }
  31. type ChapterReconnectItemSlice []ChapterReconnectItem
  32. func (p ChapterReconnectItemSlice) Len() int {
  33. return len(p)
  34. }
  35. func (p ChapterReconnectItemSlice) Swap(i, j int) {
  36. p[i], p[j] = p[j], p[i]
  37. }
  38. func (p ChapterReconnectItemSlice) Less(i, j int) bool {
  39. return p[j].Index > p[i].Index
  40. }