123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- // 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"`
- }
|