platform.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package param
  2. // ChallListParam describe challenge list search params of a business
  3. type ChallListParam struct {
  4. Businesses []int8 `form:"businesses" validate:"required,min=1"`
  5. AssignNum []int8 `form:"assign_num" validate:"required,min=0"`
  6. Order string `form:"order" default:"id"`
  7. Sort string `form:"sort" default:"desc"`
  8. PN int `form:"pn"`
  9. PS int `form:"ps"`
  10. R int64 `form:"r" validate:"required"`
  11. }
  12. // ChallHandlingDoneListParam describe params challenge list handling of admin
  13. type ChallHandlingDoneListParam struct {
  14. Businesses int8 `form:"businesses" validate:"required,min=1"`
  15. Order string `form:"order"`
  16. Sort string `form:"sort"`
  17. PN int `form:"pn"`
  18. PS int `form:"ps"`
  19. }
  20. // ChallCountParam describe challenge count in some states of a business
  21. type ChallCountParam struct {
  22. Business int64 `form:"business" validate:"required,min=1"`
  23. States []int64 `form:"states,split" validate:"dive,gt=-1"`
  24. }
  25. // ChallCreatedListParam return challenge list created by an admin
  26. type ChallCreatedListParam struct {
  27. Businesses int8 `form:"businesses" validate:"required,min=1"`
  28. Order string `form:"order"`
  29. Sort string `form:"sort"`
  30. PN int `form:"pn"`
  31. PS int `form:"ps"`
  32. }