params.go 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package model
  2. // ArgQueryGroup query group arg.
  3. type ArgQueryGroup struct {
  4. GroupID int64 `form:"group_id"`
  5. State int8 `form:"state" default:"-1"`
  6. }
  7. // ArgQueryCards query cards arg.
  8. type ArgQueryCards struct {
  9. GroupID int64 `form:"group_id"`
  10. }
  11. // ArgState update state.
  12. type ArgState struct {
  13. ID int64 `form:"id" validate:"required,min=1,gte=1"`
  14. State int8 `form:"state"`
  15. }
  16. // ArgID arg id.
  17. type ArgID struct {
  18. ID int64 `form:"id" validate:"required,min=1,gte=1"`
  19. }
  20. // ArgIds ids arg.
  21. type ArgIds struct {
  22. Ids []int64 `form:"ids,split" validate:"min=1,max=50"`
  23. }
  24. // AddGroup add group arg.
  25. type AddGroup struct {
  26. Name string `form:"name" validate:"required" gorm:"column:name"`
  27. State int8 `form:"state" gorm:"column:state"`
  28. Operator string `gorm:"column:operator"`
  29. OrderNum int64 `gorm:"column:order_num"`
  30. }
  31. // UpdateGroup update group arg.
  32. type UpdateGroup struct {
  33. Name string `form:"name" validate:"required" gorm:"column:name"`
  34. State int8 `form:"state" gorm:"column:state"`
  35. Operator string `gorm:"column:operator"`
  36. ID int64 `form:"id" validate:"required,min=1,gte=1"`
  37. }
  38. // AddCard add card arg.
  39. type AddCard struct {
  40. Name string `json:"name" gorm:"column:name" form:"name" validate:"required"`
  41. State int32 `json:"state" gorm:"column:state" form:"state" `
  42. IsHot int32 `json:"is_hot" gorm:"column:is_hot" form:"is_hot"`
  43. CardURL string `json:"card_url" gorm:"column:card_url"`
  44. BigCradURL string `json:"big_crad_url" gorm:"column:big_crad_url"`
  45. CardType int32 `json:"card_type" gorm:"column:card_type" form:"card_type"`
  46. OrderNum int64 `json:"order_num" gorm:"column:order_num"`
  47. Operator string `json:"operator" gorm:"column:operator"`
  48. GroupID int64 `json:"group_id" gorm:"column:group_id" form:"group_id" validate:"required"`
  49. CardFileType string `gorm:"-"`
  50. CardBody []byte `gorm:"-"`
  51. BigCardFileType string `gorm:"-"`
  52. BigCardBody []byte `gorm:"-"`
  53. }
  54. // UpdateCard update card info.
  55. type UpdateCard struct {
  56. ID int64 `form:"id" validate:"required,min=1,gte=1"`
  57. Name string `json:"name" gorm:"column:name" form:"name" validate:"required"`
  58. State int32 `json:"state" gorm:"column:state" form:"state" `
  59. IsHot int32 `json:"is_hot" gorm:"column:is_hot" form:"is_hot"`
  60. CardURL string `json:"card_url" gorm:"column:card_url"`
  61. BigCradURL string `json:"big_crad_url" gorm:"column:big_crad_url"`
  62. Operator string `json:"operator" gorm:"column:operator"`
  63. CardFileType string `gorm:"-"`
  64. CardBody []byte `gorm:"-"`
  65. BigCardFileType string `gorm:"-"`
  66. BigCardBody []byte `gorm:"-"`
  67. }