s_role_menu.go 861 B

123456789101112131415161718192021222324252627282930313233343536
  1. package schema
  2. // RoleMenu 角色菜单对象
  3. type RoleMenu struct {
  4. RecordId string `json:"record_id"` // 记录id
  5. RoleId string `json:"role_id"` // 角色id
  6. MenuId string `json:"menu_id"` // 菜单Id
  7. MenuName string `json:"menu_name"` // 菜单名称
  8. }
  9. // RoleMenuQueryParam 查询条件
  10. type RoleMenuQueryParam struct {
  11. RoleId string `json:"role_id"`
  12. RoleIds string `json:"role_ids"`
  13. }
  14. // RoleMenuQueryOptions RoleMenu对象查询可选参数项
  15. type RoleMenuQueryOptions struct {
  16. PageParam *PaginationParam // 分页参数
  17. }
  18. // RoleMenuQueryResult RoleMenu对象查询结果
  19. type RoleMenuQueryResult struct {
  20. Data RoleMenus
  21. PageResult *PaginationResult
  22. }
  23. type RoleMenus []*RoleMenu
  24. func (a RoleMenus) ToMenuIds() []string {
  25. menuIds := make([]string, len(a))
  26. for k, v := range a {
  27. menuIds[k] = v.MenuId
  28. }
  29. return menuIds
  30. }