package model import operationPb "kpt-tmr-group/proto/go/backend/operation" type SystemPasturePermissions struct { Id int64 `json:"id,omitempty"` RoleId int64 `json:"role_id"` PastureId int64 `json:"pasture_id"` IsShow operationPb.IsShow_Kind `json:"is_show"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` } func (s *SystemPasturePermissions) TableName() string { return "system_pasture_permissions" } func NewSystemPasturePermissions(roleID int64, pastureIds []int64) []*SystemPasturePermissions { systemPasturePermissions := make([]*SystemPasturePermissions, len(pastureIds)) for i, v := range pastureIds { systemPasturePermissions[i] = &SystemPasturePermissions{ RoleId: roleID, PastureId: v, IsShow: operationPb.IsShow_OK, } } return systemPasturePermissions }