优化
This commit is contained in:
@@ -13,19 +13,27 @@ type MenuMetaRequest struct {
|
||||
}
|
||||
|
||||
type MenuButtonRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"desc"`
|
||||
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 MenuParameterRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
Type string `json:"type"`
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
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 MenuRequest struct {
|
||||
CreatedAt time.Time `json:"CreatedAt"`
|
||||
UpdatedAt time.Time `json:"UpdatedAt"`
|
||||
ID uint `json:"ID"`
|
||||
ParentID uint `json:"parentId"`
|
||||
Path string `json:"path"`
|
||||
@@ -39,20 +47,16 @@ type MenuRequest struct {
|
||||
}
|
||||
|
||||
type DeleteMenuRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
ID int `json:"id"`
|
||||
}
|
||||
|
||||
type GetMenuRequest struct {
|
||||
ID uint `json:"id"`
|
||||
}
|
||||
|
||||
type AuthorityMenuItemRequest struct {
|
||||
ID uint `json:"ID"`
|
||||
ID int `json:"id"`
|
||||
}
|
||||
|
||||
type SetAuthorityMenusRequest struct {
|
||||
AuthorityID uint `json:"authorityId"`
|
||||
Menus []AuthorityMenuItemRequest `json:"menus"`
|
||||
AuthorityID uint `json:"authorityId"`
|
||||
Menus []MenuRequest `json:"menus"`
|
||||
}
|
||||
|
||||
type GetAuthorityMenusRequest struct {
|
||||
@@ -108,14 +112,32 @@ type MenuResponse struct {
|
||||
Children []*MenuResponse `json:"children"`
|
||||
Parameters []MenuParameterResponse `json:"parameters"`
|
||||
MenuButtons []MenuButtonResponse `json:"menuBtn"`
|
||||
Authorities []*AuthorityResponse `json:"authoritys"`
|
||||
}
|
||||
|
||||
type DynamicMenuResponse struct {
|
||||
CreatedAt time.Time `json:"CreatedAt"`
|
||||
UpdatedAt time.Time `json:"UpdatedAt"`
|
||||
ID uint `json:"ID"`
|
||||
MenuID uint `json:"menuId"`
|
||||
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 []*DynamicMenuResponse `json:"children"`
|
||||
Parameters []MenuParameterResponse `json:"parameters"`
|
||||
MenuButtons []MenuButtonResponse `json:"menuBtn"`
|
||||
Buttons map[string]uint `json:"btns"`
|
||||
Authorities []*AuthorityResponse `json:"authoritys"`
|
||||
}
|
||||
|
||||
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"`
|
||||
*DynamicMenuResponse
|
||||
AuthorityID uint `json:"-"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user