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

102 lines
3.5 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操作代码。
// 生成日期2024-03-01 12:50:08
// 生成路径: api/v1/system/device_preset.go
// 生成人gfast
// desc:预置位相关参数
// 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"
)
// DevicePresetSearchReq 分页请求参数
type DevicePresetSearchReq struct {
g.Meta `path:"/list" tags:"预置位" method:"get" summary:"预置位列表"`
Id string `p:"id"` // 主键ID
CreatedAt string `p:"createdAt" v:"createdAt@datetime#创建时间需为YYYY-MM-DD hh:mm:ss格式"` // 创建时间
DeviceSerial string `p:"deviceSerial"` // 设备序列号
ChannelNo string `p:"channelNo" d:"1"` // 通道号
commonApi.PageReq
commonApi.Author
}
// DevicePresetSearchRes 列表返回结果
type DevicePresetSearchRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*model.DevicePresetListRes `json:"list"`
}
// DevicePresetAddReq 添加操作请求参数
type DevicePresetAddReq struct {
g.Meta `path:"/add" tags:"预置位" method:"post" summary:"预置位添加"`
commonApi.Author
DeviceSerial string `p:"deviceSerial" dc:"设备穿号"`
PresetName string `p:"presetName" dc:"预置位点名"`
ChannelNo string `p:"channelNo" dc:"频道号默认为1" d:"1"`
}
// DevicePresetAddRes 添加操作返回结果
type DevicePresetAddRes struct {
commonApi.EmptyRes
}
// DevicePresetEditReq 修改操作请求参数
type DevicePresetEditReq struct {
g.Meta `path:"/edit" tags:"预置位" method:"put" summary:"预置位修改"`
commonApi.Author
DeviceSerial string `p:"deviceSerial" dc:"设备编号"`
Id int `p:"id" dc:"需要被修改的主键id"`
NewName string `p:"newName" dc:"新名字"`
}
// DevicePresetEditRes 修改操作返回结果
type DevicePresetEditRes struct {
commonApi.EmptyRes
}
// DevicePresetGetReq 获取一条数据请求
type DevicePresetGetReq struct {
g.Meta `path:"/get" tags:"预置位" method:"get" summary:"获取预置位信息"`
commonApi.Author
Id uint `p:"id" v:"required#主键必须"` // 通过主键获取
}
// DevicePresetGetRes 获取一条数据结果
type DevicePresetGetRes struct {
g.Meta `mime:"application/json"`
*model.DevicePresetInfoRes
}
// DevicePresetDeleteReq 删除数据请求
type DevicePresetDeleteReq struct {
g.Meta `path:"/delete" tags:"预置位" method:"delete" summary:"删除预置位"`
commonApi.Author
DeviceSerial string `p:"deviceSerial" v:"required#设备序列号不能为空"` // 设备序列号
Ids []int `p:"ids" v:"required#通道号必须"` // 通过主键删除
}
// DevicePresetDeleteRes 删除数据返回
type DevicePresetDeleteRes struct {
commonApi.EmptyRes
}
// DevicePresetCallReq 调用预置点
type DevicePresetCallReq struct {
g.Meta `path:"/call" tags:"预置位" method:"post" summary:"调用预置位"`
DeviceSerial string `p:"deviceSerial" v:"required#设备序列号不能为空"` // 设备序列号
Index int `p:"index" v:"required#预置点位不能为空"`
commonApi.Author
}
// DevicePresetCallRes 调用预置点返回
type DevicePresetCallRes struct {
commonApi.EmptyRes
}