feat: 初始化配置中心项目
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package model
|
||||
|
||||
type WrapperResponse struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg,omitempty"`
|
||||
Data interface{} `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
type PageResult struct {
|
||||
PageNo int `json:"pageNo"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Total int64 `json:"total"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
type SelectOption struct {
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
type Menu struct {
|
||||
Title string `json:"title"`
|
||||
Icon string `json:"icon"`
|
||||
Active bool `json:"active"`
|
||||
Children []SubMenu `json:"children"`
|
||||
}
|
||||
|
||||
type SubMenu struct {
|
||||
Title string `json:"title"`
|
||||
Icon string `json:"icon"`
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
func NewMenu(title, icon string, active bool) Menu {
|
||||
return Menu{Title: title, Icon: icon, Active: active, Children: make([]SubMenu, 0)}
|
||||
}
|
||||
|
||||
func (m *Menu) AddSubMenu(title, icon, url string) {
|
||||
m.Children = append(m.Children, SubMenu{Title: title, Icon: icon, Url: url})
|
||||
}
|
||||
Reference in New Issue
Block a user