Files
zmkgC/api/v1/system/device.go
2025-07-07 20:11:59 +08:00

150 lines
5.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ==========================================================================
// GFast自动生成api操作代码。
// 生成日期2023-11-24 09:57:07
// 生成路径: api/v1/system/device.go
// 生成人gfast
// desc:安全帽设备java相关参数
// company:云南奇讯科技有限公司
// ==========================================================================
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
)
// DeviceSearchReq 分页请求参数
type DeviceSearchReq struct {
g.Meta `path:"/list" tags:"安全帽设备java" method:"get" summary:"安全帽设备java列表"`
ProjectId int64 `p:"projectId" v:"required#项目ID不能为空"`
DevNum string `p:"devNum"` //设备编号
DevName string `p:"devName"` //设备名称
Status string `p:"status" v:"status@integer#状态需为整数"` //状态
commonApi.PageReq
commonApi.Author
}
// DeviceSearchRes 列表返回结果
type DeviceSearchRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*model.DeviceListRes `json:"list"`
}
// DeviceSearchAllReq 分页请求参数
type DeviceSearchAllReq struct {
g.Meta `path:"/allList" tags:"安全帽设备java" method:"get" summary:"GIS云图树上数据返回当前项目下。设备和用户关联到的所有设备"`
ProjectId int64 `p:"projectId" v:"required#项目ID不能为空"`
commonApi.Author
}
// DeviceSearchAllRes 列表返回结果
type DeviceSearchAllRes struct {
g.Meta `mime:"application/json"`
List []*model.DeviceListRes `json:"list"`
}
// HelmetListReq 分页请求参数
type HelmetListReq struct {
g.Meta `path:"/helmetList" tags:"安全帽设备java" method:"get" summary:"安全帽列表(设备名和设备标识)"`
ProjectId int64 `p:"projectId" v:"required#项目ID不能为空"`
DevNum string `p:"devNum"` //设备编号
DevName string `p:"devName"` //设备名称
commonApi.PageReq
commonApi.Author
}
// HelmetListRes 列表返回结果
type HelmetListRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*model.DeviceListRes `json:"list"`
}
// DeviceAddReq 添加操作请求参数
type DeviceAddReq struct {
g.Meta `path:"/add" tags:"安全帽设备java" method:"post" summary:"安全帽设备java添加"`
commonApi.Author
DevNum string `p:"devNum" v:"required#主键ID不能为空"`
DevName string `p:"devName" `
Status int `p:"status" dc:"状态0下线 1上线 v:"required#状态不能为空"`
ProjectId int `p:"project_id" v:"required#项目id不能为空"`
}
// DeviceAddRes 添加操作返回结果
type DeviceAddRes struct {
commonApi.EmptyRes
}
// RemoveRelationReq 移除当前人员与安全帽的佩戴关系
type RemoveRelationReq struct {
g.Meta `path:"/removeRelation" tags:"安全帽设备java" method:"put" summary:"移除当前人员与安全帽的佩戴关系"`
commonApi.Author
Openid string `p:"openid" v:"required#openid不能为空"`
}
// RemoveRelationRes 移除当前人员与安全帽的佩戴关系
type RemoveRelationRes struct {
commonApi.EmptyRes
}
// DeviceGetReq 获取一条数据请求
type DeviceGetReq struct {
g.Meta `path:"/get" tags:"安全帽设备java" method:"get" summary:"获取安全帽设备java信息"`
commonApi.Author
DateRange []string `p:"dateRange" dc:"日期范围"`
DevNum string `p:"devNum" v:"required#主键必须"` //通过主键获取
}
// DeviceGetRes 获取一条数据结果
type DeviceGetRes struct {
g.Meta `mime:"application/json"`
*model.DeviceInfoRes
LatAndLonList []*ActionPathLatAndLonActionPathLatAndLon `json:"latAndLonList" dc:"足迹列表"`
}
type ActionPathLatAndLonActionPathLatAndLon struct {
Latitude float64 `p:"latitude" dc:"纬度" `
Longitude float64 `p:"longitude" dc:"经度" `
}
// DeviceDeleteReq 删除数据请求
type DeviceDeleteReq struct {
g.Meta `path:"/delete" tags:"安全帽设备java" method:"delete" summary:"删除安全帽设备java"`
commonApi.Author
DevNums []string `p:"devNums" v:"required#主键必须"` //通过主键删除
}
// DeviceDeleteRes 删除数据返回
type DeviceDeleteRes struct {
commonApi.EmptyRes
}
// ScheduleTimeReq 根据指定时间段去查询有足迹的日期
type ScheduleTimeReq struct {
g.Meta `path:"scheduleTime" tags:"安全帽设备java" method:"get" summary:"根据指定时间段去查询有足迹的日期"`
DevNum string `p:"devNum" dc:"设备编号" v:"required#设备编号必须"`
DateRange []string `p:"dateRange" dc:"日期范围" v:"required|array#日期范围必须"`
commonApi.Author
}
// ScheduleTimeRes 根据指定时间段去查询有足迹的日期
type ScheduleTimeRes struct {
g.Meta `mime:"application/json"`
List []string `json:"list"`
}
// WebsocketReq 服务
type WebsocketReq struct {
g.Meta `path:"/websocketReq" tags:"安全帽设备java" method:"get" summary:"WebSocket服务"`
commonApi.Author
ProjectId string `p:"projectId" v:"required#项目ID必须" dc:"项目ID"` //通过主键删除
}
// WebsocketRes 服务
type WebsocketRes struct {
commonApi.EmptyRes
}