ListPlanExecutionLogs

This commit is contained in:
2025-10-18 15:36:32 +08:00
parent 51a873049e
commit df0dfd62c6
4 changed files with 169 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import (
type MonitorService struct {
sensorDataRepo repository.SensorDataRepository
deviceCommandLogRepo repository.DeviceCommandLogRepository
executionLogRepo repository.ExecutionLogRepository
// 在这里可以添加其他超表模型的仓库依赖
}
@@ -16,10 +17,12 @@ type MonitorService struct {
func NewMonitorService(
sensorDataRepo repository.SensorDataRepository,
deviceCommandLogRepo repository.DeviceCommandLogRepository,
executionLogRepo repository.ExecutionLogRepository,
) *MonitorService {
return &MonitorService{
sensorDataRepo: sensorDataRepo,
deviceCommandLogRepo: deviceCommandLogRepo,
executionLogRepo: executionLogRepo,
}
}
@@ -32,3 +35,8 @@ func (s *MonitorService) ListSensorData(opts repository.SensorDataListOptions, p
func (s *MonitorService) ListDeviceCommandLogs(opts repository.DeviceCommandLogListOptions, page, pageSize int) ([]models.DeviceCommandLog, int64, error) {
return s.deviceCommandLogRepo.List(opts, page, pageSize)
}
// ListPlanExecutionLogs 负责处理查询计划执行日志列表的业务逻辑
func (s *MonitorService) ListPlanExecutionLogs(opts repository.PlanExecutionLogListOptions, page, pageSize int) ([]models.PlanExecutionLog, int64, error) {
return s.executionLogRepo.ListPlanExecutionLogs(opts, page, pageSize)
}