12345678910111213141516171819202122232425262728 |
- package model
- import operationPb "kpt-tmr-group/proto/go/backend/operation"
- type SystemMenuPermissions struct {
- Id int64 `json:"id,omitempty"`
- RoleId int64 `json:"role_id"`
- MenuId int64 `json:"menu_id"`
- IsShow operationPb.IsShow_Kind `json:"is_show"`
- CreatedAt int64 `json:"created_at"`
- UpdatedAt int64 `json:"updated_at"`
- }
- func (s *SystemMenuPermissions) TableName() string {
- return "system_menu_permissions"
- }
- func NewSystemMenuPermissions(roleID int64, menuIds []uint32) []*SystemMenuPermissions {
- systemMenuPermissions := make([]*SystemMenuPermissions, len(menuIds))
- for i, v := range menuIds {
- systemMenuPermissions[i] = &SystemMenuPermissions{
- RoleId: roleID,
- MenuId: int64(v),
- IsShow: operationPb.IsShow_OK,
- }
- }
- return systemMenuPermissions
- }
|