211 lines
8.8 KiB
Go
211 lines
8.8 KiB
Go
// ==========================================================================
|
||
// GFast自动生成api操作代码。
|
||
// 生成日期:2023-07-27 15:20:49
|
||
// 生成路径: api/v1/system/sys_project.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/api/v1/common/shp"
|
||
"github.com/tiger1103/gfast/v3/internal/app/system/model"
|
||
)
|
||
|
||
// SysProjectSearchReq 分页请求参数
|
||
type SysProjectSearchReq struct {
|
||
g.Meta `path:"/list" tags:"项目" method:"get" summary:"项目列表"`
|
||
ProjectName string `p:"projectName"` //项目名称
|
||
PId string `p:"pId" v:"pId@integer#父id需为整数"` //父id
|
||
Status string `p:"status"` //状态(0正常 1停用)
|
||
CreateTime string `p:"createTime" v:"createTime@datetime#创建时间需为YYYY-MM-DD hh:mm:ss格式"` //创建时间
|
||
Type string `p:"type" dc:"1工程 2运维 3全部" v:"between:1,3#取值范围为1~3"` //项目类型
|
||
IsType string `p:"isType" dc:"1光伏 2风电 3全部" v:"between:1,3#取值范围为1~3"` //项目类别
|
||
PagingType int `json:"pagingType" dc:"0分页 1不分页" v:"between:0,1#取值范围为0~1"`
|
||
IsShow int `json:"isShow" dc:"0显示 1隐藏 2全部" v:"between:0,2#取值范围为0~2"`
|
||
commonApi.PageReq
|
||
commonApi.Author
|
||
}
|
||
|
||
// SysProjectSearchRes 列表返回结果
|
||
type SysProjectSearchRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
commonApi.ListRes
|
||
List []*model.SysProjectListRes `json:"list"`
|
||
}
|
||
|
||
// SysProjectSearchAllReq 分页请求参数
|
||
type SysProjectSearchAllReq struct {
|
||
g.Meta `path:"/listAll" tags:"项目" method:"get" summary:"项目列表"`
|
||
Project int64 `p:"project" dc:"项目id"`
|
||
Name string `p:"name" dc:"根据项目名称模糊查询"`
|
||
commonApi.Author
|
||
}
|
||
|
||
// SysProjectSearchAllRes 列表返回结果
|
||
type SysProjectSearchAllRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
List []*model.SysProjectListRes `json:"list"`
|
||
}
|
||
|
||
// SysProjectAddReq 添加操作请求参数
|
||
type SysProjectAddReq struct {
|
||
g.Meta `path:"/add" tags:"项目" method:"post" summary:"项目添加"`
|
||
commonApi.Author
|
||
ProjectName string `p:"projectName" v:"required#项目名称不能为空"`
|
||
ShortName string `p:"shortName" `
|
||
PunchRange string `p:"punchRange" v:"required#打卡范围不能为空"`
|
||
PId int64 `p:"pId"`
|
||
//Status string `p:"status"`
|
||
PicUrl string `p:"picUrl" `
|
||
CreateBy string `p:"createBy" `
|
||
CreateTime *gtime.Time `p:"createTime" `
|
||
UpdateBy string `p:"updateBy" `
|
||
UpdateTime *gtime.Time `p:"updateTime" `
|
||
Lng string `p:"lng" `
|
||
Lat string `p:"lat" `
|
||
Remark string `p:"remark" `
|
||
Type string `p:"type" v:"required#项目类型不能为空"`
|
||
ColourRgb string `p:"colourRgb" `
|
||
Sort int64 `p:"sort" dc:"排序字段(asc)"`
|
||
|
||
PrincipalXz string `p:"principalXz" dc:"小程序薪资管理员" `
|
||
ProjectSite string `p:"projectSite" v:"required#项目地址不能为空"`
|
||
Principal string `p:"principal" v:"required#项目负责人不能为空"`
|
||
PrincipalPhone string `p:"principalPhone" v:"required#负责人电话不能为空"`
|
||
Actual string `p:"actual" dc:"实际容量" v:"required#实际容量不能为空"`
|
||
Plan string `p:"plan" dc:"计划容量" v:"required#计划容量不能为空"`
|
||
OnStreamTime string `p:"onStreamTime" dc:"开工时间" v:"required#开工时间不能为空"`
|
||
RichText string `p:"richText" dc:"富文本"`
|
||
DesignTotal int64 `p:"designTotal" dc:"设计总量"`
|
||
IsType int64 `p:"isType" dc:"项目类型(1光伏 2风电)"`
|
||
|
||
ProjectPunchRangeList []*ProjectPunchRangeRes `json:"projectPunchRangeList" dc:"范围边界"`
|
||
}
|
||
|
||
// SysProjectAddRes 添加操作返回结果
|
||
type SysProjectAddRes struct {
|
||
commonApi.EmptyRes
|
||
}
|
||
|
||
// SysProjectEditReq 修改操作请求参数
|
||
type SysProjectEditReq struct {
|
||
g.Meta `path:"/edit" tags:"项目" method:"put" summary:"项目修改"`
|
||
commonApi.Author
|
||
Id int64 `p:"id" v:"required#主键ID不能为空"`
|
||
ProjectName string `p:"projectName" v:"required#项目名称不能为空"`
|
||
ShortName string `p:"shortName" `
|
||
PunchRange string `p:"punchRange" v:"required#打卡范围不能为空"`
|
||
PId int64 `p:"pId" v:"required#父id不能为空"`
|
||
Status string `p:"status" v:"required#状态(0正常 1停用)不能为空"`
|
||
PicUrl string `p:"picUrl" `
|
||
Lng string `p:"lng" `
|
||
Lat string `p:"lat" `
|
||
Remark string `p:"remark" `
|
||
Type string `p:"type" v:"required#项目类型不能为空"`
|
||
ColourRgb string `p:"colourRgb" `
|
||
Sort int64 `p:"sort" dc:"排序字段(asc)"`
|
||
ShowHidden string `p:"showHidden" dc:"显示隐藏(1显示 2隐藏)"`
|
||
|
||
PrincipalXz string `p:"principalXz" dc:"小程序薪资管理员" `
|
||
ProjectSite string `p:"projectSite" v:"required#项目地址不能为空"`
|
||
Principal string `p:"principal" v:"required#项目负责人不能为空"`
|
||
PrincipalPhone string `p:"principalPhone" v:"required#负责人电话不能为空"`
|
||
Actual string `p:"actual" dc:"实际容量" v:"required#实际容量不能为空"`
|
||
Plan string `p:"plan" dc:"计划容量" v:"required#计划容量不能为空"`
|
||
OnStreamTime string `p:"onStreamTime" dc:"开工时间" v:"required#开工时间不能为空"`
|
||
RichText string `p:"richText" dc:"富文本"`
|
||
DesignTotal int64 `p:"designTotal" dc:"设计总量"`
|
||
IsType int64 `p:"isType" dc:"项目类型(1光伏 2风电)"`
|
||
|
||
PunchRangeList []*ProjectPunchRangeRes `json:"punchRangeList" dc:"范围边界"`
|
||
}
|
||
|
||
// SysProjectEditRes 修改操作返回结果
|
||
type SysProjectEditRes struct {
|
||
commonApi.EmptyRes
|
||
}
|
||
|
||
// SysProjectGetReq 获取一条数据请求
|
||
type SysProjectGetReq struct {
|
||
g.Meta `path:"/get" tags:"项目" method:"get" summary:"获取项目信息"`
|
||
commonApi.Author
|
||
Id int64 `p:"id" v:"required#主键必须"` //通过主键获取
|
||
}
|
||
|
||
// SysProjectGetRes 获取一条数据结果
|
||
type SysProjectGetRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
*model.SysProjectInfoRes
|
||
FangzhengList []*FangzhengListRes `json:"fangzhengList" dc:"方正边界范围"`
|
||
PunchRangeList []*ProjectPunchRangeRes `json:"punchRangeList" dc:"打卡范围边界"`
|
||
}
|
||
|
||
type FangzhengListRes struct {
|
||
Id string `json:"id" dc:"主键ID"`
|
||
SourceId string `json:"sourceId" dc:"资源ID"`
|
||
Name string `json:"name" dc:"方正名称"`
|
||
Detail shp.Polyline `json:"detail" dc:"方正范围"`
|
||
}
|
||
|
||
type ProjectPunchRangeRes struct {
|
||
Id int64 `json:"id" dc:"主键ID"`
|
||
ProjectId string `json:"projectId" dc:"项目ID"`
|
||
PunchName string `json:"punchName" dc:"范围名称"`
|
||
PunchColor string `json:"punchColor" dc:"颜色"`
|
||
PunchRange []*Position `json:"punchRange" dc:"打卡范围"`
|
||
}
|
||
|
||
// Position 定义一个结构体来表示JSON数据中的位置信息
|
||
type Position struct {
|
||
Lng float64 `json:"lng"`
|
||
Lat float64 `json:"lat"`
|
||
Alt float64 `json:"alt"`
|
||
}
|
||
|
||
// SysProjectDeleteReq 删除数据请求
|
||
type SysProjectDeleteReq struct {
|
||
g.Meta `path:"/delete" tags:"项目" method:"delete" summary:"删除项目"`
|
||
commonApi.Author
|
||
Ids []int64 `p:"ids" v:"required#主键必须"` //通过主键删除
|
||
}
|
||
|
||
// SysProjectDeleteRes 删除数据返回
|
||
type SysProjectDeleteRes struct {
|
||
commonApi.EmptyRes
|
||
}
|
||
|
||
// BriefIntroductionReq 获取一条数据请求
|
||
type BriefIntroductionReq struct {
|
||
g.Meta `path:"/briefIntroduction" tags:"项目" method:"get" summary:"根据主键ID获取项目简介"`
|
||
commonApi.Author
|
||
ProjectId string `p:"projectId" dc:"项目id" v:"required#项目id必须"`
|
||
}
|
||
|
||
// BriefIntroductionRes 获取一条数据结果
|
||
type BriefIntroductionRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
ProjectId string `json:"projectId" dc:"项目ID"`
|
||
ProjectName string `json:"projectName" dc:"项目全称"`
|
||
ShortName string `json:"shortName" dc:"项目简称"`
|
||
RichText string `json:"richText" dc:"富文本"`
|
||
}
|
||
|
||
// SecurityAgreementReq 上传安全协议书
|
||
type SecurityAgreementReq struct {
|
||
g.Meta `path:"/securityAgreement" tags:"项目" method:"post" summary:"上传安全协议书(每个项目都有一个安全协议书)"`
|
||
commonApi.Author
|
||
Id string `p:"id" dc:"项目主键id" v:"required#项目主键id必须"`
|
||
File string `p:"file" dc:"传递安全协议书" v:"required#安全协议书必须"`
|
||
}
|
||
|
||
// SecurityAgreementRes 上传安全协议书
|
||
type SecurityAgreementRes struct {
|
||
g.Meta `mime:"application/json"`
|
||
}
|