busniess-user-center/internal/models/application/request.go

85 lines
2.8 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 {
Code string `json:"code" 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"`
Total int64
Page int
PageSize int
}
type MenusReq struct {
AppCode string `json:"app_code" binding:"required"`
}
type DeleteAppReq struct {
Id uint `form:"id" json:"id" binding:"required"`
}
type GetAppReq struct {
Code string `form:"code" json:"code" 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"` // 是否显示01
}
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"` // 是否显示01
}