mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 10:07:39 +08:00
发布v2.2.10版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
58
server/api/admin/dict/dict_data.go
Normal file
58
server/api/admin/dict/dict_data.go
Normal file
@@ -0,0 +1,58 @@
|
||||
// Package dict
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package dict
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
)
|
||||
|
||||
// DataEditReq 修改/新增字典数据
|
||||
type DataEditReq struct {
|
||||
entity.SysDictData
|
||||
TypeID int64 `json:"typeID" dc:"字典类型ID"`
|
||||
g.Meta `path:"/dictData/edit" method:"post" tags:"字典数据" summary:"修改/新增字典数据"`
|
||||
}
|
||||
|
||||
type DataEditRes struct{}
|
||||
|
||||
// DataDeleteReq 删除字典数据
|
||||
type DataDeleteReq struct {
|
||||
Id interface{} `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"`
|
||||
g.Meta `path:"/dictData/delete" method:"post" tags:"字典数据" summary:"删除字典数据"`
|
||||
}
|
||||
type DataDeleteRes struct{}
|
||||
|
||||
// DataListReq 查询列表
|
||||
type DataListReq struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
TypeID int64 `json:"typeId" v:"required#字典类型ID不能为空" dc:"字典类型ID"` //
|
||||
Type string `json:"type"`
|
||||
Label string `json:"label"`
|
||||
g.Meta `path:"/dictData/list" method:"get" tags:"字典数据" summary:"获取字典数据列表"`
|
||||
}
|
||||
|
||||
type DataListRes struct {
|
||||
List []*sysin.DictDataListModel `json:"list" dc:"数据列表"`
|
||||
form.PageRes
|
||||
}
|
||||
|
||||
type DataSelectReq struct {
|
||||
g.Meta `path:"/dictData/option/{Type}" method:"get" summary:"字典数据" tags:"获取指定字典选项"`
|
||||
Type string `in:"path" v:"required#字典类型不能为空" dc:"字典类型"`
|
||||
}
|
||||
type DataSelectRes sysin.DataSelectModel
|
||||
|
||||
type DataSelectsReq struct {
|
||||
g.Meta `path:"/dictData/options" method:"get" summary:"字典数据" tags:"获取多个字典选项"`
|
||||
Types []string `json:"types"`
|
||||
}
|
||||
type DataSelectsRes map[string]sysin.DataSelectModel
|
43
server/api/admin/dict/dict_type.go
Normal file
43
server/api/admin/dict/dict_type.go
Normal file
@@ -0,0 +1,43 @@
|
||||
// Package dict
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package dict
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
)
|
||||
|
||||
// TypeTreeReq 字典类型树
|
||||
type TypeTreeReq struct {
|
||||
g.Meta `path:"/dictType/tree" tags:"字典类型" method:"get" summary:"字典类型树列表"`
|
||||
}
|
||||
type TypeTreeRes struct {
|
||||
List []map[string]interface{} `json:"list" dc:"数据列表"`
|
||||
}
|
||||
|
||||
// TypeEditReq 修改/新增字典数据
|
||||
type TypeEditReq struct {
|
||||
entity.AdminDept
|
||||
g.Meta `path:"/dictType/edit" method:"post" tags:"字典类型" summary:"修改/新增字典类型"`
|
||||
}
|
||||
|
||||
type TypeEditRes struct{}
|
||||
|
||||
// TypeDeleteReq 删除字典类型
|
||||
type TypeDeleteReq struct {
|
||||
Id interface{} `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
|
||||
g.Meta `path:"/dictType/delete" method:"post" tags:"字典类型" summary:"删除字典类型"`
|
||||
}
|
||||
type TypeDeleteRes struct{}
|
||||
|
||||
// TypeSelectReq 修改/新增字典数据
|
||||
type TypeSelectReq struct {
|
||||
g.Meta `path:"/dictType/select" method:"get" tags:"字典类型" summary:"字典类型选项"`
|
||||
}
|
||||
|
||||
type TypeSelectRes sysin.DictTypeSelectModel
|
Reference in New Issue
Block a user