数据上报
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.7 KiB

package GZGZM
const (
UnitCJ = "mm"
UnitSP = "mm"
UnitZL = "kN"
UnitQX = "°"
MonitorTypeCodeCJ = "settlement"
MonitorTypeCodeSP = "displacement"
MonitorTypeCodeZL = "supporting_force"
MonitorTypeCodeQX = "inclination"
)
type TokenBody struct {
Code int `json:"code"`
Message string `json:"message"`
Data string `json:"data"`
}
type PostData struct {
MonitorDataId string `json:"monitorDataId"` // 第三方平台监测数据Id,必填
UploadTime string `json:"uploadTime"` //上传时间,格式为yyyy-MM-dd HH:mm:ss,必填
StartTime string `json:"startTime"` //开始时间,格式为yyyy-MM-dd HH:mm:ss,必填
Contractor string `json:"contractor"` //厂商编码或者名称,必填
Type string `json:"type"` //监测类型code,对应的值下方字典有说明:supporting_force\settlement\displacement\inclination
DeviceSn string `json:"deviceSn"` //设备code,必填
DeviceIp string `json:"deviceIp"` //设备ip
Soc int `json:"soc"` //设备剩余电量
MeasuredPoint string `json:"measuredPoint"` // 测点编号,必填
BranchCode string `json:"branchCode"` // 分部编码,必填
Status int `json:"status"` // 数据状态,1正常,2预警,3报警。必填
Data PointData `json:"data"`
}
type PointData struct {
Unit string `json:"unit"` //单位
MeasuredValue1 float64 `json:"measuredValue1"` //当前测量值1,必填
MeasuredValue2 float64 `json:"measuredValue2"` //当前测量值2,如果有值时传
MeasuredValue3 float64 `json:"measuredValue3"` //当前测量值3,如果有值时传
CumulativeValue1 float64 `json:"cumulativeValue1"` // 变化量1,倾角时对应x,必填
CumulativeValue2 float64 `json:"cumulativeValue2"` // 变化量2,倾角时对应y
CumulativeValue3 float64 `json:"cumulativeValue3"` // 变化量3,倾角时对应z
InitAmount1 float64 `json:"initAmount1"` //检测归零值1,倾角时的x值,必填
InitAmount2 float64 `json:"initAmount2"` //检测归零值2,倾角时的y值
InitAmount3 float64 `json:"initAmount3"` //检测归零值3,倾角时的Z值
}
type UploadHistoryData struct {
DeviceId string `json:"deviceId"`
Apikey string `json:"apikey"`
Data map[string]HistoryData `json:"data"`
}
type HistoryData struct {
L1_GP_1 map[string]string `json:"L1_GP_1"`
}
type RegisterPointBody struct {
ThirdId string `json:"thirdId"` //第三方系统ID
BranchCode string `json:"branchCode"` //分部编码,必填
Name string `json:"name"` // 监测点位名称,必填
Code string `json:"code"` // 监测点位编号,必填
Type string `json:"type"` // 监测类型code,必填。对应的值下方字典有说明:supporting_force\settlement\displacement\inclination
AlarmValue1 float64 `json:"alarmValue1"` // 报警值1,必填
AlarmValue2 float64 `json:"alarmValue2"`
AlarmValue3 float64 `json:"alarmValue3"`
WarnValue1 float64 `json:"warnValue1"` // 预警值1,必填
WarnValue2 float64 `json:"warnValue2"`
WarnValue3 float64 `json:"warnValue3"`
AlarmCount int `json:"alarmCount"` // 报警次数,默认为0
WarnCount int `json:"warnCount"` // 预警次数,默认为0
InitAmount1 float64 `json:"initAmount1"` // 监测归零值1,必填
InitAmount2 float64 `json:"initAmount2"` // 监测归零值2,倾角时传y值
InitAmount3 float64 `json:"initAmount3"` // 监测归零值3,如果有z值时
Unit string `json:"unit"` //数据单位
IsClose int `json:"isClose"` //是否关闭,1是0否,必填
}