param.go 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. package model
  2. // ArgGetQusBank 题库
  3. type ArgGetQusBank struct {
  4. QsBId int64 `form:"qb_id" validate:"required"`
  5. Stat int64 `form:"idel" validate:"min=0"`
  6. }
  7. // ArgAddQusBank 添加题库
  8. type ArgAddQusBank struct {
  9. QBName string `json:"qb_name" validate:"required"`
  10. CdTime int64 `json:"cd_time" validate:"required,min=1,gte=1"`
  11. MaxRetryTime int64 `json:"max_retry_time" validate:"required,min=1,gte=1"`
  12. }
  13. // ArgBaseBank 基本题库
  14. type ArgBaseBank struct {
  15. QsBId int64 `json:"qb_id" validate:"required"`
  16. }
  17. // ArgUpdateQusBank 更新题库
  18. type ArgUpdateQusBank struct {
  19. QsBId int64 `json:"qb_id" validate:"required"`
  20. QBName string `json:"qb_name"`
  21. CdTime int64 `json:"cd_time" validate:"min=1,gte=1"`
  22. MaxRetryTime int64 `json:"max_retry_time" validate:"min=1,gte=1"`
  23. }
  24. // ArgPage 分页
  25. type ArgPage struct {
  26. PageNo int `form:"page" validate:"required,min=1,gte=1"`
  27. PageSize int `form:"page_size" validate:"required,min=1,gte=1"`
  28. }
  29. // ArgBankList 题库列表
  30. type ArgBankList struct {
  31. ArgPage
  32. Name string `form:"key"`
  33. }
  34. // ArgGetQus 题目
  35. type ArgGetQus struct {
  36. QsID int64 `form:"qid" validate:"required"`
  37. Stat int64 `form:"status" validate:"min=0"`
  38. }
  39. // ArgBaseQus 基本题目信息
  40. type ArgBaseQus struct {
  41. Type int8 `json:"question_type" validate:"required,min=1,max=4"`
  42. AnType int8 `json:"answer_type" validate:"required,min=1,max=4"`
  43. Name string `json:"question_name" validate:"required,min=1,gte=1"`
  44. BId int64 `json:"qb_id" validate:"required,min=1,gte=1"`
  45. Dif int8 `json:"difficulty" validate:"required,min=1,max=3"`
  46. Answer []Answer `json:"answer" validate:"required"`
  47. }
  48. // ArgAddQus 添加题目
  49. type ArgAddQus struct {
  50. ArgBaseQus
  51. QsID string `json:"qid" validate:""`
  52. }
  53. // ArgUpdateQus 更新题目
  54. type ArgUpdateQus struct {
  55. ArgBaseQus
  56. QsID int64 `json:"qid" validate:"required"`
  57. }
  58. // ArgQusList 题目列表
  59. type ArgQusList struct {
  60. ArgPage
  61. QsBId int64 `form:"qb_id" validate:""`
  62. }
  63. // AddQus 添加题目
  64. type AddQus struct {
  65. QsID int64 `json:"qid" validate:""`
  66. Type int8 `json:"question_type" validate:"required"`
  67. AnType int8 `json:"answer_type" validate:"required,min=1,max=4"`
  68. Name string `json:"question_name" validate:"required,min=1,gte=1"`
  69. BId int64 `json:"qb_id" validate:"required,min=1,gte=1"`
  70. Dif int8 `json:"difficulty" validate:"required,min=1,gte=1"`
  71. Answers []Answer
  72. }
  73. // ArgQuestionBankBind 关联题库/修改关联
  74. type ArgQuestionBankBind struct {
  75. QsBId int64 `json:"qb_id" form:"qb_id" validate:"required"`
  76. Source int8 `json:"source" validate:"required"`
  77. TargetItemType int8 `json:"target_item_type" validate:"required"`
  78. UseInTime int64 `json:"use_in_time" validate:"required"`
  79. TargetItems string `json:"target_items" validate:"required"`
  80. }
  81. // ArgQuestionBankBinds to do
  82. type ArgQuestionBankBinds struct {
  83. BandBinds []ArgQuestionBankBind `json:"bind_info" validate:"required"`
  84. }
  85. // ArgQuestionBankBindToDb to do
  86. type ArgQuestionBankBindToDb struct {
  87. QsBId int64
  88. Source int8
  89. TargetItemType int8
  90. UseInTime int64
  91. TargetItems []string
  92. }
  93. // ArgQuestionBankUnbind 关联题库/修改关联
  94. type ArgQuestionBankUnbind struct {
  95. TargetItems []int64 `json:"target_items" validate:"required"`
  96. TargetItemType int8 `json:"target_item_type" validate:"required"`
  97. Source int8 `json:"source" validate:"required"`
  98. }
  99. // ArgGetBankBind 查询关联题库信息
  100. type ArgGetBankBind struct {
  101. TargetItems []string `json:"target_items" validate:"required"`
  102. TargetItemType int8 `json:"target_item_type" validate:"required"`
  103. Source int8 `json:"source" validate:"required"`
  104. }
  105. // ArgGetQuestion 随机获取一道题
  106. type ArgGetQuestion struct {
  107. UID string `form:"uid" json:"uid" validate:"required"`
  108. TargetItem string `form:"target_item" json:"target_item" validate:"required"`
  109. TargetItemType int8 `form:"target_item_type" json:"target_item_type" validate:"required"`
  110. Source int8 `form:"source" json:"source" validate:"required"`
  111. Platform int8 `form:"platform" json:"platform" validate:"required"`
  112. ComponentID int `form:"component_id" json:"component_id" validate:"required"`
  113. }
  114. // ArgGetBindItems 绑定
  115. type ArgGetBindItems struct {
  116. ArgPage
  117. QsBId int64 `form:"qb_id" validate:"required"`
  118. }
  119. // ArgBankSearch 搜索
  120. type ArgBankSearch struct {
  121. Name string `form:"name" validate:"required"`
  122. }
  123. // ArgCheckAnswer 答案检查
  124. type ArgCheckAnswer struct {
  125. ArgGetQuestion
  126. QsID int64 `json:"qid" validate:"required"`
  127. Answers []int64 `json:"answers"`
  128. X int `json:"x"`
  129. Y int `json:"y"`
  130. }
  131. // ArgCheckQus 题库检查
  132. type ArgCheckQus struct {
  133. QusIDs []int64 `json:"ids"`
  134. Cnt int `json:"cnt"`
  135. }