// Copyright 2019 github.com. All rights reserved. // Use of this source code is governed by github.com. package v1 import ( "smart-site-management-gateway/param/base" "smart-site-management-gateway/pb/v1" ) type AlarmListQuery struct { Page int32 `form:"page" json:"page"` Start int64 `form:"start" json:"start"` End int64 `form:"end" json:"end"` Sn string `form:"sn" json:"sn"` // 0 不过滤 1 已处理 2 未处理 Filter int32 `form:"filter"` PageSize int32 `form:"page_size"` Timestamp int64 `form:"timestamp"` DeviceCode int32 `form:"device_code"` } type AlarmListRequest struct { base.Header AlarmListQuery } type AlarmListResponse struct { base.Result Data v1.AlarmListReply `json:"data"` } // 添加告警规则 type AlarmRuleAddBody struct { Sn string `form:"sn" json:"sn" binding:"required" description:"设备唯一编号"` AlarmCount int32 `form:"alarm_count" json:"alarm_count" binding:"required" description:"连续告警数"` SilencePeriod int32 `form:"silence_period" json:"silence_period" binding:"required" description:"静默时间,发送间隔(单位分)"` IsOn bool `form:"is_on" json:"is_on" binding:"required" description:"是否启用"` ContinuePeriod int32 `form:"continue_period" json:"continue_period" binding:"required" description:"持续周期"` } type AlarmRuleAddRequest struct { base.Header AlarmRuleAddBody } type AlarmRuleAddResponse struct { base.Result Data v1.AlarmRuleAddReply `json:"data"` } // 告警规则列表 type AlarmRuleListQuery struct { Sn string `form:"sn" json:"sn"` Page int32 `form:"page"` } type AlarmRuleListRequest struct { base.Header AlarmRuleListQuery } type AlarmRuleListResponse struct { base.Result Data v1.AlarmRuleListReply `json:"data"` } // 告警规则删除 type AlarmRuleDeletePath struct { Id int64 `uri:"id" json:"id" binding:"required" description:"id"` } type AlarmRuleDeleteRequest struct { base.Header AlarmRuleDeletePath } type AlarmRuleDeleteResponse struct { base.Result } // 告警规则开关 type AlarmRuleOnOffBody struct { Id int64 `form:"id" json:"id" binding:"required" description:"id"` Is0n bool `form:"is_on" json:"is_on" binding:"required" description:"是否启用"` } type AlarmRuleOnOffRequest struct { base.Header AlarmRuleOnOffBody } type AlarmRuleOnOffResponse struct { base.Result } // 告警规则更新 type AlarmRuleUpdateBody struct { Id int64 `form:"id" json:"id" binding:"required" description:"id"` Sn string `form:"sn" json:"sn" binding:"required" description:"设备唯一编号"` AlarmCount int32 `form:"alarm_count" json:"alarm_count" binding:"required" description:"连续告警数"` SilencePeriod int32 `form:"silence_period" json:"silence_period" binding:"required" description:"静默时间,发送间隔(单位分)"` IsOn bool `form:"is_on" json:"is_on" binding:"required" description:"是否启用"` ContinuePeriod int32 `form:"continue_period" json:"continue_period" binding:"required" description:"持续周期"` } type AlarmRuleUpdateRequest struct { base.Header AlarmRuleUpdateBody } type AlarmRuleUpdateResponse struct { base.Result } // 告警联系人添加 type AlarmContactAddBody struct { Phone string `form:"phone" json:"phone" binding:"required" description:"告警联系人电话"` Email string `form:"email" json:"email" binding:"required" description:"告警联系人邮箱"` } type AlarmContactAddRequest struct { base.Header AlarmContactAddBody } type AlarmContactAddResponse struct { base.Result Data v1.AlarmContactAddReply `json:"data"` } // 告警联系人列表 type AlarmContactListQuery struct { ProjectId int64 `form:"project_id" json:"project_id"` } type AlarmContactListRequest struct { base.Header AlarmContactListQuery } type AlarmContactListResponse struct { base.Result Data v1.AlarmContactListReply `json:"data"` } // 告警联系人删除 type AlarmContactDeletePath struct { Id int64 `uri:"id" json:"id" binding:"required" description:"id"` } type AlarmContactDeleteRequest struct { base.Header AlarmContactDeletePath } type AlarmContactDeleteResponse struct { base.Result } // 告警联系人添加 type AlarmContactUpdateBody struct { Id int64 `form:"id" json:"id" binding:"required" description:"id"` Phone string `form:"phone" json:"phone" binding:"required" description:"告警联系人电话"` Email string `form:"email" json:"email" binding:"required" description:"告警联系人邮箱"` } type AlarmContactUpdateRequest struct { base.Header AlarmContactUpdateBody } type AlarmContactUpdateResponse struct { base.Result Data v1.AlarmContactUpdateReply `json:"data"` }