12345678910111213141516171819202122232425262728 |
- package model
- import operationPb "kpt-tmr-group/proto/go/backend/operation"
- type SystemGroupPasturePermissions 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 *SystemGroupPasturePermissions) TableName() string {
- return "system_group_pasture_permissions"
- }
- func NewSystemGroupPasturePermissions(roleID int64, pastureIds []uint32) []*SystemGroupPasturePermissions {
- systemPasturePermissions := make([]*SystemGroupPasturePermissions, len(pastureIds))
- for i, v := range pastureIds {
- systemPasturePermissions[i] = &SystemGroupPasturePermissions{
- RoleId: roleID,
- PastureId: int64(v),
- IsShow: operationPb.IsShow_OK,
- }
- }
- return systemPasturePermissions
- }
|