115 lines
5.5 KiB
Go
115 lines
5.5 KiB
Go
package v1
|
|
|
|
import (
|
|
"github.com/gogf/gf/v2/util/gmeta"
|
|
)
|
|
|
|
// ============================== 参数模块 ==============================
|
|
|
|
// ParamItem 参数行数据
|
|
// 用于参数分页列表、参数列表等场景的参数基础信息
|
|
type ParamItem struct {
|
|
Id int64 `json:"id"` // 主键ID
|
|
Name string `json:"name"` // 参数名称
|
|
Code string `json:"code"` // 参数编码
|
|
Value string `json:"value"` // 参数值
|
|
Type int `json:"type"` // 类型:1-文本 2-数字 3-开关
|
|
TypeText string `json:"typeText"` // 类型文本
|
|
Status int `json:"status"` // 状态
|
|
StatusText string `json:"statusText"` // 状态文本
|
|
Sort int `json:"sort"` // 排序
|
|
Note string `json:"note"` // 备注
|
|
CreateUser string `json:"createUser"` // 创建人
|
|
}
|
|
|
|
// ParamPageReq 参数分页请求
|
|
// 支持关键词、参数名称、类型、状态等条件组合查询
|
|
type ParamPageReq struct {
|
|
gmeta.Meta `method:"get" path:"/api/param/page" summary:"参数分页" permission:"sys:param:page" log:"参数管理-查询分页记录" logType:"query"`
|
|
PageReq // 分页基础参数
|
|
Keyword string `json:"keyword" dc:"关键词(名称/编码模糊)"` // 关键词,名称或编码模糊匹配
|
|
Name string `json:"name" dc:"参数名称模糊"` // 参数名称模糊匹配
|
|
Type int `json:"type" dc:"类型:1-文本 2-数字 3-开关"` // 类型
|
|
Status int `json:"status" dc:"状态"` // 状态
|
|
}
|
|
|
|
// ParamPageRes 参数分页结果
|
|
type ParamPageRes = PageData[ParamItem]
|
|
|
|
// ParamListReq 参数列表请求
|
|
type ParamListReq struct {
|
|
gmeta.Meta `method:"get" path:"/api/param/list" summary:"参数列表" permission:"sys:param:list" log:"参数管理-查询列表" logType:"query"`
|
|
Keyword string `json:"keyword" dc:"关键词"` // 关键词
|
|
Type int `json:"type" dc:"类型"` // 类型
|
|
Status int `json:"status" dc:"状态"` // 状态
|
|
}
|
|
|
|
// ParamListRes 参数列表结果
|
|
type ParamListRes = []ParamItem
|
|
|
|
// ParamDetailReq 参数详情请求
|
|
type ParamDetailReq struct {
|
|
gmeta.Meta `method:"get" path:"/api/param/detail/:id" summary:"参数详情" permission:"sys:param:detail" log:"参数管理-查询详情" logType:"query"`
|
|
Id int64 `json:"id" v:"required#缺少ID" dc:"参数ID"` // 参数ID
|
|
}
|
|
|
|
// ParamDetailRes 参数详情结果
|
|
type ParamDetailRes struct {
|
|
Id int64 `json:"id"` // 主键ID
|
|
Name string `json:"name"` // 参数名称
|
|
Code string `json:"code"` // 参数编码
|
|
Value string `json:"value"` // 参数值
|
|
Type int `json:"type"` // 类型:1-文本 2-数字 3-开关
|
|
TypeText string `json:"typeText"` // 类型文本
|
|
Status int `json:"status"` // 状态
|
|
StatusText string `json:"statusText"` // 状态文本
|
|
Sort int `json:"sort"` // 排序
|
|
Note string `json:"note"` // 备注
|
|
}
|
|
|
|
// ParamAddReq 新增参数请求
|
|
type ParamAddReq struct {
|
|
gmeta.Meta `method:"post" path:"/api/param/add" summary:"新增参数" permission:"sys:param:add" log:"参数管理-新增记录" logType:"add"`
|
|
Name string `json:"name" v:"required#请输入参数名称" dc:"参数名称"` // 参数名称
|
|
Code string `json:"code" v:"required#请输入参数编码" dc:"参数编码"` // 参数编码
|
|
Value string `json:"value" dc:"参数值"` // 参数值
|
|
Type int `json:"type" dc:"类型:1-文本 2-数字 3-开关"` // 类型
|
|
Status int `json:"status" dc:"状态"` // 状态
|
|
Sort int `json:"sort" dc:"排序"` // 排序
|
|
Note string `json:"note" dc:"备注"` // 备注
|
|
}
|
|
|
|
// ParamUpdateReq 修改参数请求
|
|
type ParamUpdateReq struct {
|
|
gmeta.Meta `method:"put" path:"/api/param/update" summary:"修改参数" permission:"sys:param:update" log:"参数管理-修改记录" logType:"update"`
|
|
Id int64 `json:"id" v:"required#缺少ID" dc:"参数ID"` // 参数ID
|
|
Name string `json:"name" v:"required#请输入参数名称" dc:"参数名称"` // 参数名称
|
|
Code string `json:"code" v:"required#请输入参数编码" dc:"参数编码"` // 参数编码
|
|
Value string `json:"value" dc:"参数值"` // 参数值
|
|
Type int `json:"type" dc:"类型"` // 类型
|
|
Status int `json:"status" dc:"状态"` // 状态
|
|
Sort int `json:"sort" dc:"排序"` // 排序
|
|
Note string `json:"note" dc:"备注"` // 备注
|
|
}
|
|
|
|
// ParamUpdateRes 修改参数结果
|
|
type ParamUpdateRes struct{}
|
|
|
|
// ParamDeleteReq 删除参数请求
|
|
type ParamDeleteReq struct {
|
|
gmeta.Meta `method:"delete" path:"/api/param/delete/:id" summary:"删除参数" permission:"sys:param:delete" log:"参数管理-删除记录" logType:"delete"`
|
|
Id int64 `json:"id" v:"required#缺少ID" dc:"参数ID"` // 参数ID
|
|
}
|
|
|
|
// ParamDeleteRes 删除参数结果
|
|
type ParamDeleteRes struct{}
|
|
|
|
// ParamBatchDeleteReq 批量删除参数请求
|
|
type ParamBatchDeleteReq struct {
|
|
gmeta.Meta `method:"delete" path:"/api/param/batchDelete" summary:"批量删除参数" permission:"sys:param:batchDelete" log:"参数管理-批量删除记录" logType:"delete"`
|
|
Ids []int64 `json:"ids" v:"required#请选择要删除的记录" dc:"参数ID列表"` // 参数ID列表
|
|
}
|
|
|
|
// ParamBatchDeleteRes 批量删除结果
|
|
type ParamBatchDeleteRes struct{}
|