| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- // ==========================================================================
- // This is auto-generated by gf cli tool. Fill this file as you wish.
- // ==========================================================================
- package model
- import (
- "dashoo.cn/micro/app/model/internal"
- )
- // SysMenu is the golang structure for table sys_menu.
- type SysMenu internal.SysMenu
- // Fill with you ideas below.
- // SysMenuReq 新增页面请求参数
- type SysMenuReq struct {
- Id int `json:"id"` // ID
- MenuName string `json:"menuName" v:"required#菜单名称不能为空"` // 菜单名称
- ParentId int `json:"parentId"` // 父菜单ID
- Path string `json:"path"` // 路由地址
- Component string `json:"component"` // 组件路径
- Query string `json:"query"` // 路由参数
- IsFrame int `json:"isFrame"` // 是否为外链(10是20否)
- IsCache int `json:"isCache"` // 是否缓存(10缓存20不缓存)
- MenuType string `json:"menuType" v:"required#菜单类型不能为空"` // 菜单类型(M目录C菜单 F按钮)
- Visible string `json:"visible"` // 显示状态(10显示20隐藏)
- Status string `json:"status"` // 菜单状态(10正常20停用)
- Perms string `json:"perms"` // 权限标识
- Icon string `json:"icon"` // 菜单图标
- PlatformId int `json:"platformId"` // 所属平台
- Sort int `json:"sort"` // 显示顺序
- Remark string `json:"remark"` // 备注
- }
- type MenuTree struct {
- Id int `json:"id"`
- ParentId int `json:"parent_id"`
- Name string `json:"name"`
- Component string `json:"component"`
- Path string `json:"path"`
- Redirect string `json:"redirect"`
- Hidden bool `json:"hidden"`
- Meta Meta `json:"meta"`
- Children []MenuTree `json:"children,omitempty"`
- }
- type Meta struct {
- Title string `json:"title"`
- Icon string `json:"icon"`
- Link string `json:"link"`
- BreadcrumbHidden bool `json:"breadcrumbHidden"`
- NoCache bool `json:"noCache"`
- }
- func (m SysMenu) ConvMenuTree() MenuTree {
- menuTree := MenuTree{
- Id: m.Id,
- ParentId: m.ParentId,
- Name: m.MenuName,
- Component: m.Component,
- Path: m.Path,
- //Redirect: m.Redirect,
- //Hidden: m.Hidden,
- Meta: Meta{
- Title: m.MenuName,
- Icon: m.Icon,
- //Link: m.Link,
- //BreadcrumbHidden: m.BreadcrumbHidden,
- NoCache: m.IsCache == 1,
- },
- Children: nil,
- }
- return menuTree
- }
|