search.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package search
  2. import (
  3. "go-common/app/admin/main/workflow/model"
  4. )
  5. // ChallSearchCond is the condition model to send challenge search request
  6. type ChallSearchCond struct {
  7. // Using int64 directly
  8. Cids []int64
  9. Gids []int64
  10. Mids []int64
  11. Tids []int64
  12. TagRounds []int64
  13. States []int64
  14. Keyword string
  15. CTimeFrom string
  16. CTimeTo string
  17. PN int64
  18. PS int64
  19. Order string
  20. Sort string
  21. }
  22. // FormatState .
  23. func (cc *ChallSearchCond) FormatState() {
  24. for _, st := range cc.States {
  25. if st == model.QueueStateBefore {
  26. cc.States = append(cc.States, model.QueueState)
  27. }
  28. }
  29. }
  30. // ArcSearchResult is the model to parse search archive appeal result
  31. type ArcSearchResult struct {
  32. Code int32 `json:"code"`
  33. Message string `json:"message"`
  34. TTL int32 `json:"ttl"`
  35. Data struct {
  36. Page *model.Page `json:"page"`
  37. Result []GroupSearchCommonData `json:"result"`
  38. } `json:"data"`
  39. }
  40. // ChallSearchResult is the model to parse search challenge result
  41. type ChallSearchResult struct {
  42. Code int32 `json:"code"`
  43. Message string `json:"message"`
  44. TTL int32 `json:"ttl"`
  45. Data struct {
  46. Order string `json:"order"`
  47. Sort string `json:"sort"`
  48. Page struct {
  49. Num int64 `json:"num"`
  50. Size int64 `json:"size"`
  51. Total int64 `json:"total"`
  52. } `json:"page"`
  53. Result []struct {
  54. ID int64 `json:"id"`
  55. Gid int64 `json:"gid"`
  56. Mid int64 `json:"mid"`
  57. Tid int64 `json:"tid"`
  58. CTime string `json:"ctime"`
  59. } `json:"result"`
  60. } `json:"data"`
  61. }
  62. // ChallListPage is the model for challenge list result
  63. type ChallListPage struct {
  64. Items []*model.Chall `json:"items"`
  65. TotalCount int32 `json:"total_count"`
  66. PN int32 `json:"pn"`
  67. PS int32 `json:"ps"`
  68. }
  69. // ChallListPageCommon model for challenge/list2 result
  70. type ChallListPageCommon struct {
  71. Items []*model.Chall `json:"items"`
  72. Page *model.Page `json:"page"`
  73. }
  74. // ChallCount is the model for challenge count result
  75. type ChallCount struct {
  76. TotalCount int64 `json:"total_count"`
  77. BusinessCount map[int8]int64 `json:"business_count"`
  78. }