menu_pasture.go 472 B

1234567891011121314151617181920212223
  1. package models
  2. type MenuPasture struct {
  3. Id int64 `xorm:"id"`
  4. PastureId int64 `xorm:"pastureid"`
  5. IsGroups int32 `xorm:"isgroups"`
  6. }
  7. func (m *MenuPasture) TableName() string {
  8. return "menu_pasture"
  9. }
  10. func NewMenuPastureList(pastureId int64, menuList []*Menu) []*MenuPasture {
  11. res := make([]*MenuPasture, len(menuList))
  12. for i, v := range menuList {
  13. res[i] = &MenuPasture{
  14. PastureId: pastureId,
  15. Id: v.Id,
  16. IsGroups: 0,
  17. }
  18. }
  19. return res
  20. }