ListUserActionLogs

This commit is contained in:
2025-10-18 15:47:13 +08:00
parent fab26ffca4
commit bcdcaa5631
5 changed files with 170 additions and 28 deletions

View File

@@ -11,6 +11,7 @@ type MonitorService struct {
deviceCommandLogRepo repository.DeviceCommandLogRepository
executionLogRepo repository.ExecutionLogRepository
pendingCollectionRepo repository.PendingCollectionRepository
userActionLogRepo repository.UserActionLogRepository
// 在这里可以添加其他超表模型的仓库依赖
}
@@ -20,12 +21,14 @@ func NewMonitorService(
deviceCommandLogRepo repository.DeviceCommandLogRepository,
executionLogRepo repository.ExecutionLogRepository,
pendingCollectionRepo repository.PendingCollectionRepository,
userActionLogRepo repository.UserActionLogRepository,
) *MonitorService {
return &MonitorService{
sensorDataRepo: sensorDataRepo,
deviceCommandLogRepo: deviceCommandLogRepo,
executionLogRepo: executionLogRepo,
pendingCollectionRepo: pendingCollectionRepo,
userActionLogRepo: userActionLogRepo,
}
}
@@ -53,3 +56,8 @@ func (s *MonitorService) ListTaskExecutionLogs(opts repository.TaskExecutionLogL
func (s *MonitorService) ListPendingCollections(opts repository.PendingCollectionListOptions, page, pageSize int) ([]models.PendingCollection, int64, error) {
return s.pendingCollectionRepo.List(opts, page, pageSize)
}
// ListUserActionLogs 负责处理查询用户操作日志列表的业务逻辑
func (s *MonitorService) ListUserActionLogs(opts repository.UserActionLogListOptions, page, pageSize int) ([]models.UserActionLog, int64, error) {
return s.userActionLogRepo.List(opts, page, pageSize)
}