DeleteDeviceThresholdAlarm

DeleteAreaThresholdAlarm
This commit is contained in:
2025-11-10 18:22:00 +08:00
parent f44a94b451
commit cb075c907d
7 changed files with 131 additions and 8 deletions

View File

@@ -114,6 +114,11 @@ type UpdateAreaThresholdAlarmDTO struct {
Level models.SeverityLevel `json:"level,omitempty"` // 新的告警等级,可选
}
// DeleteDeviceThresholdAlarmDTO 删除设备阈值告警的请求DTO
type DeleteDeviceThresholdAlarmDTO struct {
SensorType models.SensorType `json:"sensor_type" binding:"required"` // 传感器类型
}
// AreaThresholdAlarmDTO 用于表示一个区域阈值告警任务的详细信息
type AreaThresholdAlarmDTO struct {
ID int `json:"id"`

View File

@@ -56,7 +56,7 @@ func NewListDeviceCommandLogResponse(data []models.DeviceCommandLog, total int64
func NewListPlanExecutionLogResponse(planLogs []models.PlanExecutionLog, plans []models.Plan, total int64, page, pageSize int) *ListPlanExecutionLogResponse {
planId2Name := make(map[uint]string)
for _, plan := range plans {
planId2Name[plan.ID] = plan.Name
planId2Name[plan.ID] = string(plan.Name)
}
dtos := make([]PlanExecutionLogDTO, len(planLogs))

View File

@@ -15,7 +15,7 @@ func NewPlanToResponse(plan *models.Plan) (*PlanResponse, error) {
response := &PlanResponse{
ID: plan.ID,
Name: plan.Name,
Name: string(plan.Name),
Description: plan.Description,
PlanType: plan.PlanType,
ExecutionType: plan.ExecutionType,
@@ -60,7 +60,7 @@ func NewPlanFromCreateRequest(req *CreatePlanRequest) (*models.Plan, error) {
}
plan := &models.Plan{
Name: req.Name,
Name: models.PlanName(req.Name),
Description: req.Description,
ExecutionType: req.ExecutionType,
ExecuteNum: req.ExecuteNum,
@@ -103,7 +103,7 @@ func NewPlanFromUpdateRequest(req *UpdatePlanRequest) (*models.Plan, error) {
}
plan := &models.Plan{
Name: req.Name,
Name: models.PlanName(req.Name),
Description: req.Description,
ExecutionType: req.ExecutionType,
ExecuteNum: req.ExecuteNum,