fix: rebuild MES as compilable go-zero+ent backend (renamed bj_power_mes), restore 3 workstation projects from pristine original, align naming; all Go projects go build clean
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
syntax = "v1"
|
||||
|
||||
import (
|
||||
"base.api"
|
||||
)
|
||||
|
||||
type (
|
||||
// 报警信息(对齐 frontend-api.md 第 11 节)
|
||||
Alarm {
|
||||
Id int `json:"id"`
|
||||
AlarmCode string `json:"alarmCode"`
|
||||
AlarmMessage string `json:"alarmMessage"`
|
||||
Level string `json:"level"`
|
||||
EquipmentId int `json:"equipmentId"`
|
||||
JobId int `json:"jobId"`
|
||||
Source string `json:"source"`
|
||||
Resolved bool `json:"resolved"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
ResolvedAt string `json:"resolvedAt,omitempty"`
|
||||
}
|
||||
|
||||
// 报警信息查询参数
|
||||
AlarmQueryParams {
|
||||
PageReq
|
||||
SortReq
|
||||
Level string `form:"level,optional"`
|
||||
EquipmentId int `form:"equipmentId,optional"`
|
||||
Resolved *bool `form:"resolved,optional"`
|
||||
StartTime *int64 `form:"startTime,optional"`
|
||||
EndTime *int64 `form:"endTime,optional"`
|
||||
}
|
||||
|
||||
// 报警信息查询响应
|
||||
QueryAlarmsReply {
|
||||
PageReply
|
||||
Data []Alarm `json:"data"`
|
||||
}
|
||||
|
||||
// 确认报警请求
|
||||
AckAlarmReq {
|
||||
PathId
|
||||
Remark string `json:"remark,optional"`
|
||||
}
|
||||
|
||||
// 确认报警响应
|
||||
AckAlarmReply {
|
||||
Id int `json:"id"`
|
||||
Resolved bool `json:"resolved"`
|
||||
ResolvedAt int64 `json:"resolvedAt"`
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
jwt: Auth
|
||||
group: reports
|
||||
prefix: /api/v1
|
||||
)
|
||||
service hougai-api {
|
||||
@doc "查询报警信息"
|
||||
@handler queryAlarms
|
||||
get /alarms (AlarmQueryParams) returns (QueryAlarmsReply)
|
||||
|
||||
@doc "确认报警"
|
||||
@handler ackAlarm
|
||||
post /alarms/:id/ack (AckAlarmReq) returns (AckAlarmReply)
|
||||
}
|
||||
Reference in New Issue
Block a user