82 lines
2.7 KiB
Go
82 lines
2.7 KiB
Go
package application
|
||
|
||
type CreateReq struct {
|
||
Code string `json:"code" binding:"required"`
|
||
Secret string `json:"secret" binding:"required,len=32"`
|
||
Name string `json:"Name" binding:"required"`
|
||
Description string `json:"description"`
|
||
}
|
||
|
||
type ResetSecretReq struct {
|
||
Id uint `json:"id" binding:"required"`
|
||
Secret string `json:"secret" binding:"required,len=32"`
|
||
}
|
||
|
||
type Query struct {
|
||
Page int `form:"page" json:"page" `
|
||
PageSize int `form:"page_size" json:"page_size"`
|
||
Keyword string `form:"keyword" Json:"keyword"`
|
||
Sort string `form:"sort" json:"sort" binding:"sql_sort"`
|
||
}
|
||
|
||
func (q *Query) Default() {
|
||
if q.Page < 0 {
|
||
q.Page = 0
|
||
}
|
||
|
||
if q.PageSize <= 0 {
|
||
q.PageSize = 20
|
||
}
|
||
|
||
if len(q.Sort) == 0 {
|
||
q.Sort = "created_on desc"
|
||
}
|
||
}
|
||
|
||
type List struct {
|
||
List []ApplicationInfo `json:"list"`
|
||
}
|
||
|
||
type MenusReq struct {
|
||
AppCode string `json:"app_code" binding:"required"`
|
||
}
|
||
|
||
type DeleteAppReq struct {
|
||
Id uint `json:"id" binding:"required"`
|
||
}
|
||
|
||
type GetAppReq struct {
|
||
Id uint `form:"id" json:"id" binding:"required"`
|
||
}
|
||
|
||
type CreateMenuReq struct {
|
||
AppCode string `json:"app_code" binding:"required"` // 应用code
|
||
Code string `json:"code" binding:"required"` // 编码
|
||
Name string `json:"name" binding:"required"` // 名称
|
||
ParentCode string `json:"parent_code"` // 父级菜单编码
|
||
Order int32 `json:"order" binding:"required"` // 排序
|
||
Icon string `json:"icon"` // 图标
|
||
Path string `json:"path" binding:"required"` // 访问路径
|
||
ChildPath string `json:"child_path"` // 子级路径(前端用)
|
||
GoFirstChild int8 `json:"go_first_child"` // 前端用
|
||
IsShow int32 `json:"is_show" binding:"oneof=0,1"` // 是否显示(0:否;1:是)
|
||
}
|
||
|
||
type DelMenuReq struct {
|
||
Id uint `json:"id" binding:"required"`
|
||
}
|
||
|
||
type ModifyMenuReq struct {
|
||
Id uint `json:"id" binding:"required"`
|
||
AppCode string `json:"app_code" binding:"required"` // 应用code
|
||
Code string `json:"code" binding:"required"` // 编码
|
||
Name string `json:"name" binding:"required"` // 名称
|
||
ParentCode string `json:"parent_code"` // 父级菜单编码
|
||
Order int `json:"order" binding:"required"` // 排序
|
||
Icon string `json:"icon"` // 图标
|
||
Path string `json:"path" binding:"required"` // 访问路径
|
||
ChildPath string `json:"child_path"` // 子级路径(前端用)
|
||
GoFirstChild int `json:"go_first_child"` // 前端用
|
||
IsShow int `json:"is_show" binding:"oneof=0,1"` // 是否显示(0:否;1:是)
|
||
}
|