183 lines
7.0 KiB
Go
183 lines
7.0 KiB
Go
// ==========================================================================
|
||
// GFast自动生成api操作代码。
|
||
// 生成日期:2024-03-19 11:45:09
|
||
// 生成路径: api/v1/system/work_status.go
|
||
// 生成人:gfast
|
||
// desc:工作状态相关参数
|
||
// company:云南奇讯科技有限公司
|
||
// ==========================================================================
|
||
|
||
package system
|
||
|
||
import (
|
||
"github.com/gogf/gf/v2/frame/g"
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
|
||
"github.com/tiger1103/gfast/v3/internal/app/system/model"
|
||
)
|
||
|
||
// WorkStatusSearchReq 分页请求参数
|
||
type WorkStatusSearchReq struct {
|
||
g.Meta `path:"/list" tags:"工作状态" method:"get" summary:"工作状态列表"`
|
||
Id string `p:"id"` //
|
||
FangzhenId string `p:"fangzhenId"` // 方阵ID
|
||
Parent string `p:"parent" v:"parent@integer#父节点需为整数"` // 父节点
|
||
WorkId string `p:"workId"` // 工作id
|
||
WorkName string `p:"workName"` // 工作名称
|
||
Total string `p:"total" v:"total@integer#总量需为整数"` // 总量
|
||
Finished string `p:"finished" v:"finished@integer#完成量需为整数"` // 完成量
|
||
StartAt string `p:"startAt" v:"startAt@datetime#开始时间需为YYYY-MM-DD hh:mm:ss格式"` // 开始时间
|
||
EndAt string `p:"endAt" v:"endAt@datetime#工作结束时间需为YYYY-MM-DD hh:mm:ss格式"` // 工作结束时间
|
||
Status string `p:"status" v:"status@integer#状态 0未开始 1 进行中 2 已完成 3 已延期需为整数"` // 状态 0未开始 1 进行中 2 已完成 3 已延期
|
||
CreatedAt string `p:"createdAt" v:"createdAt@datetime#需为YYYY-MM-DD hh:mm:ss格式"` //
|
||
commonApi.PageReq
|
||
commonApi.Author
|
||
}
|
||
|
||
// WorkStatusSearchRes 列表返回结果
|
||
type WorkStatusSearchRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
commonApi.ListRes
|
||
List []*model.WorkStatusListRes `json:"list"`
|
||
}
|
||
|
||
// WorkStatusAddReq 添加操作请求参数
|
||
type WorkStatusAddReq struct {
|
||
g.Meta `path:"/add" tags:"工作状态" method:"post" summary:"工作状态添加"`
|
||
commonApi.Author
|
||
FangzhenId string `p:"fangzhenId" `
|
||
Parent int `p:"parent" `
|
||
WorkId string `p:"workId" `
|
||
WorkName string `p:"workName" v:"required#工作名称不能为空"`
|
||
Total int `p:"total" `
|
||
Finished int `p:"finished" `
|
||
StartAt *gtime.Time `p:"startAt" `
|
||
EndAt *gtime.Time `p:"endAt" `
|
||
Status int `p:"status" v:"required#状态 0未开始 1 进行中 2 已完成 3 已延期不能为空"`
|
||
}
|
||
|
||
// WorkStatusAddRes 添加操作返回结果
|
||
type WorkStatusAddRes struct {
|
||
commonApi.EmptyRes
|
||
}
|
||
|
||
// WorkStatusEditReq 修改操作请求参数
|
||
type WorkStatusEditReq struct {
|
||
g.Meta `path:"/edit" tags:"工作状态" method:"put" summary:"工作状态修改"`
|
||
commonApi.Author
|
||
Id uint `p:"id" v:"required#主键ID不能为空"`
|
||
FangzhenId string `p:"fangzhenId" `
|
||
Parent int `p:"parent" `
|
||
WorkId string `p:"workId" `
|
||
WorkName string `p:"workName" v:"required#工作名称不能为空"`
|
||
Total int `p:"total" `
|
||
Finished int `p:"finished" `
|
||
StartAt *gtime.Time `p:"startAt" `
|
||
EndAt *gtime.Time `p:"endAt" `
|
||
Status int `p:"status" v:"required#状态 0未开始 1 进行中 2 已完成 3 已延期不能为空"`
|
||
}
|
||
|
||
// WorkStatusEditRes 修改操作返回结果
|
||
type WorkStatusEditRes struct {
|
||
commonApi.EmptyRes
|
||
}
|
||
|
||
// WorkStatusGetReq 获取一条数据请求
|
||
type WorkStatusGetReq struct {
|
||
g.Meta `path:"/get" tags:"工作状态" method:"get" summary:"获取工作状态信息"`
|
||
commonApi.Author
|
||
Id uint `p:"id" v:"required#主键必须"` // 通过主键获取
|
||
}
|
||
|
||
// WorkStatusGetRes 获取一条数据结果
|
||
type WorkStatusGetRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
*model.WorkStatusInfoRes
|
||
}
|
||
|
||
// WorkStatusDeleteReq 删除数据请求
|
||
type WorkStatusDeleteReq struct {
|
||
g.Meta `path:"/delete" tags:"工作状态" method:"delete" summary:"删除工作状态"`
|
||
commonApi.Author
|
||
Ids []uint `p:"ids" v:"required#主键必须"` // 通过主键删除
|
||
}
|
||
|
||
// WorkStatusDeleteRes 删除数据返回
|
||
type WorkStatusDeleteRes struct {
|
||
commonApi.EmptyRes
|
||
}
|
||
|
||
// 删除父项目或子项目
|
||
type WorkStatusDeleteParentReq struct {
|
||
g.Meta `path:"/deleteParentWorkStatus" tags:"工作状态" method:"delete" summary:"删除父项目或子项目"`
|
||
commonApi.Author
|
||
WorkID string `p:"workId" v:"required#工作ID不能为空" dc:"删除父级时,将删除其所有子级"`
|
||
}
|
||
|
||
// 删除父项目或子项目
|
||
type WorkStatusDeleteParentRes struct {
|
||
commonApi.EmptyRes
|
||
}
|
||
|
||
// 传入fangzhenid 获取进度图
|
||
type WorkStatusGetProgressReq struct {
|
||
g.Meta `path:"/getProgress" tags:"工作状态" method:"get" summary:"获取工作状态进度图"`
|
||
commonApi.Author
|
||
FangzhenId string `p:"fangzhenId" v:"required#方阵ID不能为空"`
|
||
}
|
||
|
||
type WorkStatusGetProgressRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
Progress []*model.WorkStatusProgressRes `json:"progress"`
|
||
}
|
||
|
||
// App 获取指定父项目的所有子项目的信息
|
||
type WorkStatusGetSubProjectReq struct {
|
||
g.Meta `path:"/getSubProject" tags:"App(进度管理)" method:"get" summary:"获取指定父项目的所有子项目的信息"`
|
||
commonApi.Author
|
||
WorkID string `p:"workId" v:"required#父项目的WorkID不能为空" dc:"父级的WorkID"` // 父级的 WorkID
|
||
}
|
||
|
||
type WorkStatusGetSubProjectRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
Progress []*model.WorkStatusProgressRes `json:"progress"`
|
||
}
|
||
|
||
// 根据主项目获取其子项目和子项目所有的方阵
|
||
type WorkStatusGetTreeReq struct {
|
||
g.Meta `path:"/getTree" tags:"工作状态" method:"get" summary:"传入主项目ID获取其子项目和及其方阵"`
|
||
commonApi.Author
|
||
ProjectID string `p:"ProjectID" v:"required#主项目ID不能为空"`
|
||
}
|
||
|
||
type WorkStatusGetTreeRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
Tree []model.WorkStatusTreeRes `json:"tree"`
|
||
}
|
||
|
||
// 根据主项目获取其子项目和子项目所有的方阵
|
||
type WorkStatusQueryReq struct {
|
||
g.Meta `path:"/getrc" tags:"工作状态" method:"get" summary:"传入主项目ID获取其子项目和及其方阵"`
|
||
commonApi.Author
|
||
ProjectID string `p:"ProjectID" v:"required#主项目ID不能为空"`
|
||
}
|
||
|
||
type WorkStatusQueryRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
Tree []model.ProjectHierarchy `json:"tree"`
|
||
}
|
||
|
||
// 获取所有父项的总进度和当前进度
|
||
type WorkStatusGetParentProgressReq struct {
|
||
g.Meta `path:"/getParentProgress" tags:"工作状态" method:"get" summary:"获取所有父项的总进度和当前进度"`
|
||
commonApi.Author
|
||
FangzhenId string `p:"fangzhenId" ` // 方阵ID
|
||
SubProjectID string `p:"sub_projectId" dc:"子项目ID"` // 子项目ID
|
||
ProjectID string `p:"projectId" dc:"大项目ID" `
|
||
}
|
||
|
||
type WorkStatusGetParentProgressRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
Tree []model.WorkStatusTreeRes `json:"tree"`
|
||
}
|