search2.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. package search
  2. import (
  3. "go-common/app/admin/main/workflow/model"
  4. )
  5. // search appid
  6. const (
  7. GroupSrhComID = "workflow_group_common"
  8. ChallSrhComID = "workflow_chall_common"
  9. )
  10. // GroupSearchCommonCond is the common condition model to send group search request
  11. type GroupSearchCommonCond struct {
  12. Fields []string
  13. Business int8
  14. IDs []int64
  15. Oids []string
  16. Tids []int64
  17. States []int8
  18. Mids []int64
  19. Rounds []int64
  20. TypeIDs []int64
  21. FID []int64
  22. RID []int8
  23. EID []int64
  24. TagRounds []int64
  25. FirstUserTid []int64
  26. ReportMID []int64 // report_mid
  27. AuthorMID []int64 // mid
  28. KWPriority bool
  29. KW []string
  30. KWFields []string
  31. CTimeFrom string
  32. CTimeTo string
  33. PN int64
  34. PS int64
  35. Order string
  36. Sort string
  37. }
  38. // GroupSearchCommonData .
  39. type GroupSearchCommonData struct {
  40. ID int64 `json:"id"`
  41. Oid int64 `json:"oid"`
  42. Mid int64 `json:"mid"`
  43. TypeID int64 `json:"typeid"`
  44. Eid int64 `json:"eid"`
  45. FirstUserTid int64 `json:"first_user_tid"`
  46. }
  47. // GroupSearchCommonResp .
  48. type GroupSearchCommonResp struct {
  49. Page *model.Page `json:"page"`
  50. Result []*GroupSearchCommonData `json:"result"`
  51. }
  52. // ChallSearchCommonCond is the common condition model to send challenge search request
  53. type ChallSearchCommonCond struct {
  54. // Using int64 directly
  55. Fields []string
  56. Business int8
  57. IDs []int64
  58. Gids []int64
  59. Oids []string
  60. Tids []int64
  61. Mids []int64
  62. ObjectMids []int64
  63. Rounds []int64
  64. TypeIDs []int64
  65. AssigneeAdminIDs []int64
  66. AssigneeAdminNames []string
  67. AdminIDs []int64
  68. States []int64
  69. BusinessStates []int64
  70. CTimeFrom string
  71. CTimeTo string
  72. KW []string
  73. KWFields []string
  74. Distinct []string
  75. PN int
  76. PS int
  77. Order string
  78. Sort string
  79. }
  80. // FormatState transform add state in queue into search cond
  81. func (csc *ChallSearchCommonCond) FormatState() {
  82. for _, busState := range csc.BusinessStates {
  83. if busState == model.QueueBusinessStateBefore {
  84. csc.BusinessStates = append(csc.BusinessStates, model.QueueBusinessState)
  85. }
  86. }
  87. for _, st := range csc.States {
  88. if st == model.QueueStateBefore {
  89. csc.States = append(csc.States, model.QueueState)
  90. }
  91. }
  92. }
  93. // ChallSearchCommonData .
  94. type ChallSearchCommonData struct {
  95. ID int64 `json:"id"`
  96. Oid int64 `json:"oid"`
  97. Mid int64 `json:"mid"`
  98. Gid int64 `json:"gid"`
  99. Tid int64 `json:"tid"`
  100. CountTid int64 `json:"count_tid"`
  101. State interface{} `json:"state"` //兼容 int string
  102. Title string `json:"title"`
  103. Business int8 `json:"business"`
  104. TypeID int64 `json:"typeid"`
  105. CTime string `json:"ctime"`
  106. }
  107. // ChallSearchCommonResp .
  108. type ChallSearchCommonResp struct {
  109. Page *model.Page `json:"page"`
  110. Result []*ChallSearchCommonData `json:"result"`
  111. }
  112. // ChallReleaseUpSearchCond .
  113. type ChallReleaseUpSearchCond struct {
  114. Cids []int64 `json:"id"`
  115. AssigneeAdminID int64 `json:"assignee_adminid"`
  116. BusinessState int64 `json:"business_state"`
  117. }
  118. // ChallReleaseUpSearchCondItem .
  119. type ChallReleaseUpSearchCondItem struct {
  120. Cid int64 `json:"id"`
  121. AssigneeAdminID int64 `json:"assignee_adminid"`
  122. BusinessState int64 `json:"business_state"`
  123. }
  124. // ChallUpSearchResult .
  125. type ChallUpSearchResult struct {
  126. Code int32 `json:"code"`
  127. Message string `json:"message"`
  128. TTL int32 `json:"ttl"`
  129. }