签入脚本
This commit is contained in:
+107
@@ -0,0 +1,107 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// ============================== 部门模块 ==============================
|
||||
|
||||
// DeptItem 部门行数据
|
||||
// 用于部门分页列表、树形列表等场景的部门基础信息
|
||||
type DeptItem struct {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
TenantId int `json:"tenantId"` // 租户ID
|
||||
Name string `json:"name"` // 部门名称
|
||||
Type int `json:"type"` // 部门类型:1-公司 2-子公司 3-部门 4-小组
|
||||
TypeText string `json:"typeText"` // 部门类型文本
|
||||
ParentId int `json:"parentId"` // 上级部门ID(0=顶级)
|
||||
Sort int `json:"sort"` // 排序
|
||||
Note string `json:"note"` // 备注
|
||||
CreateUser string `json:"createUser"` // 创建人
|
||||
CreateTime *gtime.Time `json:"createTime"` // 创建时间
|
||||
}
|
||||
|
||||
// DeptPageReq 部门分页请求
|
||||
// 支持关键词、部门名称、部门类型等条件组合查询
|
||||
type DeptPageReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/dept/page" summary:"部门分页" permission:"sys:dept:page" log:"部门管理-查询分页记录" logType:"query"`
|
||||
PageReq // 分页基础参数
|
||||
Keyword string `json:"keyword" dc:"关键词"` // 关键词
|
||||
Name string `json:"name" dc:"部门名称模糊"` // 部门名称模糊匹配
|
||||
Type int `json:"type" dc:"部门类型:1-公司 2-子公司 3-部门 4-小组"` // 部门类型
|
||||
}
|
||||
|
||||
// DeptPageRes 部门分页结果
|
||||
type DeptPageRes = PageData[DeptItem]
|
||||
|
||||
// DeptListReq 部门树形列表请求
|
||||
// 返回平铺列表,由前端自行构建树形结构
|
||||
type DeptListReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/dept/list" summary:"部门树形列表" permission:"sys:dept:list" log:"部门管理-查询树形列表" logType:"query"`
|
||||
Keyword string `json:"keyword" dc:"关键词"` // 关键词
|
||||
Type int `json:"type" dc:"部门类型"` // 部门类型
|
||||
}
|
||||
|
||||
// DeptListRes 部门平铺列表结果
|
||||
// data 直接为数组,由前端自行构建树形结构
|
||||
type DeptListRes = []*DeptItem
|
||||
|
||||
// DeptDetailReq 部门详情请求
|
||||
type DeptDetailReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/dept/detail/:id" summary:"部门详情" permission:"sys:dept:detail" log:"部门管理-查询详情" logType:"query"`
|
||||
Id int64 `json:"id" v:"required#缺少ID" dc:"部门ID"` // 部门ID
|
||||
}
|
||||
|
||||
// DeptDetailRes 部门详情结果
|
||||
type DeptDetailRes struct {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
Name string `json:"name"` // 部门名称
|
||||
Type int `json:"type"` // 部门类型
|
||||
TypeText string `json:"typeText"` // 部门类型文本
|
||||
ParentId int `json:"parentId"` // 上级部门ID
|
||||
Sort int `json:"sort"` // 排序
|
||||
Note string `json:"note"` // 备注
|
||||
}
|
||||
|
||||
// DeptAddReq 新增部门请求
|
||||
type DeptAddReq struct {
|
||||
gmeta.Meta `method:"post" path:"/api/dept/add" summary:"新增部门" permission:"sys:dept:add" log:"部门管理-新增记录" logType:"add"`
|
||||
Name string `json:"name" v:"required#请输入部门名称" dc:"部门名称"` // 部门名称
|
||||
Type int `json:"type" v:"required:1,2,3,4#请选择部门类型" dc:"部门类型:1-公司 2-子公司 3-部门 4-小组"` // 部门类型
|
||||
ParentId int `json:"parentId" dc:"上级部门ID(0=顶级)"` // 上级部门ID
|
||||
Sort int `json:"sort" dc:"排序"` // 排序
|
||||
Note string `json:"note" dc:"备注"` // 备注
|
||||
}
|
||||
|
||||
// DeptUpdateReq 修改部门请求
|
||||
type DeptUpdateReq struct {
|
||||
gmeta.Meta `method:"put" path:"/api/dept/update" summary:"修改部门" permission:"sys:dept:update" log:"部门管理-修改记录" logType:"update"`
|
||||
Id int64 `json:"id" v:"required#缺少ID" dc:"部门ID"` // 部门ID
|
||||
Name string `json:"name" v:"required#请输入部门名称" dc:"部门名称"` // 部门名称
|
||||
Type int `json:"type" dc:"部门类型"` // 部门类型
|
||||
ParentId int `json:"parentId" dc:"上级部门ID"` // 上级部门ID
|
||||
Sort int `json:"sort" dc:"排序"` // 排序
|
||||
Note string `json:"note" dc:"备注"` // 备注
|
||||
}
|
||||
|
||||
// DeptUpdateRes 修改部门结果
|
||||
type DeptUpdateRes struct{}
|
||||
|
||||
// DeptDeleteReq 删除部门请求
|
||||
type DeptDeleteReq struct {
|
||||
gmeta.Meta `method:"delete" path:"/api/dept/delete/:id" summary:"删除部门" permission:"sys:dept:delete" log:"部门管理-删除记录" logType:"delete"`
|
||||
Id int64 `json:"id" v:"required#缺少ID" dc:"部门ID"` // 部门ID
|
||||
}
|
||||
|
||||
// DeptDeleteRes 删除部门结果
|
||||
type DeptDeleteRes struct{}
|
||||
|
||||
// DeptBatchDeleteReq 批量删除部门请求
|
||||
type DeptBatchDeleteReq struct {
|
||||
gmeta.Meta `method:"delete" path:"/api/dept/batchDelete" summary:"批量删除部门" permission:"sys:dept:batchDelete" log:"部门管理-批量删除记录" logType:"delete"`
|
||||
Ids []int64 `json:"ids" v:"required#请选择要删除的记录" dc:"部门ID列表"` // 部门ID列表
|
||||
}
|
||||
|
||||
// DeptBatchDeleteRes 批量删除结果
|
||||
type DeptBatchDeleteRes struct{}
|
||||
Reference in New Issue
Block a user