122 lines
3.8 KiB
Go
122 lines
3.8 KiB
Go
package dto
|
|
|
|
import "time"
|
|
|
|
type MenuMetaRequest struct {
|
|
ActiveName string `json:"activeName"`
|
|
KeepAlive bool `json:"keepAlive"`
|
|
DefaultMenu bool `json:"defaultMenu"`
|
|
Title string `json:"title"`
|
|
Icon string `json:"icon"`
|
|
CloseTab bool `json:"closeTab"`
|
|
TransitionType string `json:"transitionType"`
|
|
}
|
|
|
|
type MenuButtonRequest struct {
|
|
ID uint `json:"ID"`
|
|
Name string `json:"name"`
|
|
Description string `json:"desc"`
|
|
}
|
|
|
|
type MenuParameterRequest struct {
|
|
ID uint `json:"ID"`
|
|
Type string `json:"type"`
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type MenuRequest struct {
|
|
ID uint `json:"ID"`
|
|
ParentID uint `json:"parentId"`
|
|
Path string `json:"path"`
|
|
Name string `json:"name"`
|
|
Hidden bool `json:"hidden"`
|
|
Component string `json:"component"`
|
|
Sort int `json:"sort"`
|
|
Meta MenuMetaRequest `json:"meta"`
|
|
MenuButtons []MenuButtonRequest `json:"menuBtn"`
|
|
Parameters []MenuParameterRequest `json:"parameters"`
|
|
}
|
|
|
|
type DeleteMenuRequest struct {
|
|
ID uint `json:"ID"`
|
|
}
|
|
|
|
type GetMenuRequest struct {
|
|
ID uint `json:"id"`
|
|
}
|
|
|
|
type AuthorityMenuItemRequest struct {
|
|
ID uint `json:"ID"`
|
|
}
|
|
|
|
type SetAuthorityMenusRequest struct {
|
|
AuthorityID uint `json:"authorityId"`
|
|
Menus []AuthorityMenuItemRequest `json:"menus"`
|
|
}
|
|
|
|
type GetAuthorityMenusRequest struct {
|
|
AuthorityID uint `json:"authorityId"`
|
|
}
|
|
|
|
type SetMenuRolesRequest struct {
|
|
MenuID uint `json:"menuId" form:"menuId"`
|
|
AuthorityIDs []uint `json:"authorityIds"`
|
|
}
|
|
|
|
type MenuMetaResponse struct {
|
|
ActiveName string `json:"activeName"`
|
|
KeepAlive bool `json:"keepAlive"`
|
|
DefaultMenu bool `json:"defaultMenu"`
|
|
Title string `json:"title"`
|
|
Icon string `json:"icon"`
|
|
CloseTab bool `json:"closeTab"`
|
|
TransitionType string `json:"transitionType"`
|
|
}
|
|
|
|
type MenuButtonResponse struct {
|
|
CreatedAt time.Time `json:"CreatedAt"`
|
|
UpdatedAt time.Time `json:"UpdatedAt"`
|
|
ID uint `json:"ID"`
|
|
Name string `json:"name"`
|
|
Description string `json:"desc"`
|
|
SysBaseMenuID uint `json:"sysBaseMenuID"`
|
|
}
|
|
|
|
type MenuParameterResponse struct {
|
|
CreatedAt time.Time `json:"CreatedAt"`
|
|
UpdatedAt time.Time `json:"UpdatedAt"`
|
|
ID uint `json:"ID"`
|
|
SysBaseMenuID uint `json:"SysBaseMenuID"`
|
|
Type string `json:"type"`
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type MenuResponse struct {
|
|
CreatedAt time.Time `json:"CreatedAt"`
|
|
UpdatedAt time.Time `json:"UpdatedAt"`
|
|
ID uint `json:"ID"`
|
|
MenuID uint `json:"menuId,omitempty"`
|
|
ParentID uint `json:"parentId"`
|
|
Path string `json:"path"`
|
|
Name string `json:"name"`
|
|
Hidden bool `json:"hidden"`
|
|
Component string `json:"component"`
|
|
Sort int `json:"sort"`
|
|
Meta MenuMetaResponse `json:"meta"`
|
|
Children []*MenuResponse `json:"children"`
|
|
Parameters []MenuParameterResponse `json:"parameters"`
|
|
MenuButtons []MenuButtonResponse `json:"menuBtn"`
|
|
Buttons map[string]uint `json:"btns"`
|
|
}
|
|
|
|
type AuthorityMenuResponse struct {
|
|
// The administration response embeds the base-menu fields, so menu fields are
|
|
// flat in the response (there is no sysBaseMenu envelope). Keep the
|
|
// authority ID internal, matching the compatible json:"-" field.
|
|
*MenuResponse
|
|
MenuID uint `json:"menuId"`
|
|
AuthorityID uint `json:"-"`
|
|
}
|