签入脚本
This commit is contained in:
+126
@@ -0,0 +1,126 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// ============================== 字典模块 ==============================
|
||||
|
||||
// DictItemRow 字典项行数据
|
||||
// 内嵌使用,供字典详情展示字典项明细
|
||||
type DictItemRow struct {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
Name string `json:"name"` // 字典项名称
|
||||
Value string `json:"value"` // 字典项值
|
||||
Sort int `json:"sort"` // 排序
|
||||
}
|
||||
|
||||
// DictItem 字典行数据
|
||||
// 用于字典分页列表、字典列表等场景的字典基础信息
|
||||
type DictItem struct {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
Name string `json:"name"` // 字典名称
|
||||
Code string `json:"code"` // 字典编码
|
||||
Sort int `json:"sort"` // 排序
|
||||
Note string `json:"note"` // 备注
|
||||
CreateUser string `json:"createUser"` // 创建人
|
||||
}
|
||||
|
||||
// DictPageReq 字典分页请求
|
||||
// 支持关键词、字典名称等条件组合查询
|
||||
type DictPageReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/dict/page" summary:"字典分页" permission:"sys:dict:page" log:"字典管理-查询分页记录" logType:"query"`
|
||||
PageReq // 分页基础参数
|
||||
Keyword string `json:"keyword" dc:"关键词(名称/编码模糊)"` // 关键词,名称或编码模糊匹配
|
||||
Name string `json:"name" dc:"字典名称模糊"` // 字典名称模糊匹配
|
||||
}
|
||||
|
||||
// DictPageRes 字典分页结果
|
||||
type DictPageRes = PageData[DictItem]
|
||||
|
||||
// DictDetailReq 字典详情请求
|
||||
// 返回字典基础信息及其下的字典项集合
|
||||
type DictDetailReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/dict/detail/:id" summary:"字典详情" permission:"sys:dict:detail" log:"字典管理-查询详情" logType:"query"`
|
||||
Id int64 `json:"id" v:"required#缺少ID" dc:"字典ID"` // 字典ID
|
||||
}
|
||||
|
||||
// DictDetailRes 字典详情结果
|
||||
// 包含字典基础信息及其下的字典项集合
|
||||
type DictDetailRes struct {
|
||||
DictItem
|
||||
Items []DictItemRow `json:"items"` // 字典项集合
|
||||
}
|
||||
|
||||
// DictAddReq 新增字典请求
|
||||
type DictAddReq struct {
|
||||
gmeta.Meta `method:"post" path:"/api/dict/add" summary:"新增字典" permission:"sys:dict:add" log:"字典管理-新增记录" logType:"add"`
|
||||
Name string `json:"name" v:"required#请输入字典名称" dc:"字典名称"` // 字典名称
|
||||
Code string `json:"code" v:"required#请输入字典编码" dc:"字典编码"` // 字典编码
|
||||
Sort int `json:"sort" dc:"排序"` // 排序
|
||||
Note string `json:"note" dc:"备注"` // 备注
|
||||
}
|
||||
|
||||
// DictUpdateReq 修改字典请求
|
||||
type DictUpdateReq struct {
|
||||
gmeta.Meta `method:"put" path:"/api/dict/update" summary:"修改字典" permission:"sys:dict: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:"字典编码"` // 字典编码
|
||||
Sort int `json:"sort" dc:"排序"` // 排序
|
||||
Note string `json:"note" dc:"备注"` // 备注
|
||||
}
|
||||
|
||||
// DictUpdateRes 修改字典结果
|
||||
type DictUpdateRes struct{}
|
||||
|
||||
// DictDeleteReq 删除字典请求
|
||||
type DictDeleteReq struct {
|
||||
gmeta.Meta `method:"delete" path:"/api/dict/delete/:id" summary:"删除字典" permission:"sys:dict:delete" log:"字典管理-删除记录" logType:"delete"`
|
||||
Id int64 `json:"id" v:"required#缺少ID" dc:"字典ID"` // 字典ID
|
||||
}
|
||||
|
||||
// DictDeleteRes 删除字典结果
|
||||
type DictDeleteRes struct{}
|
||||
|
||||
// DictBatchDeleteReq 批量删除字典请求
|
||||
type DictBatchDeleteReq struct {
|
||||
gmeta.Meta `method:"delete" path:"/api/dict/batchDelete" summary:"批量删除字典" permission:"sys:dict:batchDelete" log:"字典管理-批量删除记录" logType:"delete"`
|
||||
Ids []int64 `json:"ids" v:"required#请选择要删除的记录" dc:"字典ID列表"` // 字典ID列表
|
||||
}
|
||||
|
||||
// DictBatchDeleteRes 批量删除结果
|
||||
type DictBatchDeleteRes struct{}
|
||||
|
||||
// DictRefreshCacheReq 刷新字典缓存请求
|
||||
type DictRefreshCacheReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/dict/refreshCache" summary:"刷新字典缓存" permission:"sys:dict:cache" log:"字典管理-刷新缓存" logType:"update"`
|
||||
Code string `json:"code" dc:"字典编码(留空刷新全部)"` // 字典编码,留空刷新全部
|
||||
}
|
||||
|
||||
// DictRefreshCacheRes 刷新缓存结果
|
||||
type DictRefreshCacheRes struct{}
|
||||
|
||||
// DictAliasListReq 字典别名列表请求
|
||||
// 登录用户即可访问,供前端字典查询场景使用
|
||||
type DictAliasListReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/dictionary/list" summary:"字典列表" log:"字典管理-查询列表" logType:"query"`
|
||||
Keyword string `json:"keyword" dc:"关键词"` // 关键词
|
||||
}
|
||||
|
||||
// DictAliasListRes 字典别名列表结果
|
||||
type DictAliasListRes = []DictItem
|
||||
|
||||
// DictAliasInfoReq 字典别名详情请求
|
||||
// 登录用户即可访问,按字典编码查询字典及其字典项
|
||||
type DictAliasInfoReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/dictionary/info" summary:"字典详情" log:"字典管理-查询详情" logType:"query"`
|
||||
Code string `json:"code" v:"required#请输入字典编码" dc:"字典编码"` // 字典编码
|
||||
}
|
||||
|
||||
// DictAliasInfoRes 字典别名详情结果
|
||||
// 包含字典基础信息及其下的字典项集合
|
||||
type DictAliasInfoRes struct {
|
||||
DictItem
|
||||
Items []DictItemRow `json:"items"` // 字典项集合
|
||||
}
|
||||
Reference in New Issue
Block a user