reason.go 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package model
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // State code const .
  6. const (
  7. InvalidateState int64 = 0
  8. ValidateState int64 = 1
  9. AllState int64 = -1
  10. AllType int64 = -1
  11. CategoryCode int64 = 0
  12. SecondeCode int64 = 1
  13. ExtensionCode int64 = 2
  14. )
  15. // Reason .
  16. type Reason struct {
  17. ID int64 `json:"id" gorm:"primary_key" form:"id"`
  18. BusinessID int64 `json:"bid" gorm:"column:bid" form:"bid"`
  19. RoleID int64 `json:"role_id" gorm:"column:rid" form:"role_id" validate:"required"`
  20. RoleName string `json:"role_name" gorm:"-"`
  21. CategoryID int64 `json:"cate_id" gorm:"column:cid" form:"cate_id" validate:"required"`
  22. CategoryName string `json:"category_name" gorm:"-"`
  23. SecondID int64 `json:"sec_id" gorm:"column:sid" form:"sec_id" validate:"required"`
  24. SecondName string `json:"sec_name" gorm:"-"`
  25. State int64 `json:"state" gorm:"column:state" form:"state" default:"1"`
  26. Common int64 `json:"common" gorm:"column:common" form:"common" default:"0"`
  27. UID int64 `json:"uid" gorm:"column:uid" form:"uid"`
  28. UName string `json:"uname" gorm:"-"`
  29. Description string `json:"description" gorm:"column:description" form:"description" validate:"required"`
  30. Weight int64 `json:"weight" gorm:"column:weight" form:"weight" default:"1" validate:"required"`
  31. Flag int64 `json:"flag" gorm:"column:flag" form:"flag" default:"0"`
  32. LinkID int64 `json:"link_id" gorm:"column:lid" form:"link_id" default:"0"`
  33. TypeID int64 `json:"type_id" gorm:"column:type_id" form:"type_id" default:"0"`
  34. TagID int64 `json:"tag_id" gorm:"column:tid" form:"tag_id" default:"0"`
  35. Ctime xtime.Time `json:"ctime" gorm:"column:ctime"`
  36. Mtime xtime.Time `json:"mtime" gorm:"column:mtime"`
  37. }
  38. // DropList .
  39. type DropList struct {
  40. ID int64 `json:"id"`
  41. Name string `json:"name"`
  42. Child []*DropList `json:"child"`
  43. }
  44. // CateSecExt .
  45. type CateSecExt struct {
  46. ID int64 `json:"id" gorm:"primary_key" form:"id"`
  47. BusinessID int64 `json:"bid" gorm:"column:bid" form:"bid"`
  48. Name string `json:"name" gorm:"column:name" form:"name"`
  49. Type int64 `json:"type" gorm:"column:type" form:"type"`
  50. State int64 `json:"state" gorm:"column:state" form:"state" default:"-1"`
  51. Ctime xtime.Time `json:"ctime" gorm:"column:ctime"`
  52. Mtime xtime.Time `json:"mtime" gorm:"column:mtime"`
  53. }
  54. // Association .
  55. type Association struct {
  56. ID int64 `json:"id" gorm:"primary_key" form:"id"`
  57. BusinessID int64 `json:"bid" gorm:"column:bid" form:"bid"`
  58. RoleID int64 `json:"role_id" gorm:"column:rid" form:"role_id"`
  59. RoleName string `json:"role_name" gorm:"-"`
  60. CategoryID int64 `json:"cate_id" gorm:"column:cid" form:"cate_id"`
  61. CategoryName string `json:"cate_name" gorm:"-"`
  62. SecondIDs string `json:"second_ids" gorm:"column:sids" form:"sec_ids"`
  63. State int64 `json:"state" gorn:"column:state" form:"state" default:"1"`
  64. Ctime xtime.Time `json:"ctime" gorm:"column:ctime"`
  65. Mtime xtime.Time `json:"mtime" gorm:"column:mtime"`
  66. Child []*CateSecExt `json:"child" gorm:"-"`
  67. }
  68. // BatchUpdateReasonState .
  69. type BatchUpdateReasonState struct {
  70. IDs []int64 `json:"ids" form:"ids,split" validate:"required"`
  71. State int64 `json:"state" form:"state"`
  72. }
  73. // SearchReasonParams .
  74. type SearchReasonParams struct {
  75. BusinessID int64 `form:"bid" default:"-1"`
  76. KeyWord string `json:"keyword" form:"keyword"`
  77. RoleID int64 `json:"role_id" form:"role_id" default:"0"`
  78. CategoryID int64 `json:"cate_id" form:"cate_id" default:"0"`
  79. SecondID int64 `json:"sec_id" form:"sec_id" default:"0"`
  80. State int64 `json:"state" form:"state" default:"-1"`
  81. UID int64 `json:"uid"`
  82. UName string `json:"uname" form:"uname"`
  83. Order string `json:"order" form:"order" default:"ctime"`
  84. Sort string `json:"sort" form:"sort" default:"desc"`
  85. PS int64 `form:"ps" default:"20"`
  86. PN int64 `form:"pn" default:"1"`
  87. }
  88. // BusinessAttr .
  89. type BusinessAttr struct {
  90. BID int64 `json:"bid" form:"bid" validate:"required"`
  91. }