feat: complete Phase 3 of service refactoring
- Marked tasks in `TODO.md` as completed for moving backup-related files to the `data-management` directory and correcting imports across the codebase. - Updated imports in `backup-manager.ts`, API routes, and various components to reflect the new structure. - Removed obsolete `backup.ts` and `backup-scheduler.ts` files to streamline the codebase. - Added new tasks in `TODO.md` for future cleaning and organization of service imports.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { backupService } from '@/services/backup';
|
||||
import { backupService } from '@/services/data-management/backup';
|
||||
|
||||
interface RouteParams {
|
||||
params: Promise<{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { backupService } from '@/services/backup';
|
||||
import { backupScheduler } from '@/services/backup-scheduler';
|
||||
import { backupService } from '@/services/data-management/backup';
|
||||
import { backupScheduler } from '@/services/data-management/backup-scheduler';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { tasksService } from '@/services/tasks';
|
||||
import { tagsService } from '@/services/tags';
|
||||
import { backupService } from '@/services/backup';
|
||||
import { backupScheduler } from '@/services/backup-scheduler';
|
||||
import { backupService } from '@/services/data-management/backup';
|
||||
import { backupScheduler } from '@/services/data-management/backup-scheduler';
|
||||
import { AdvancedSettingsPageClient } from '@/components/settings/AdvancedSettingsPageClient';
|
||||
|
||||
// Force dynamic rendering for real-time data
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import BackupSettingsPageClient from '@/components/settings/BackupSettingsPageClient';
|
||||
import { backupService } from '@/services/backup';
|
||||
import { backupScheduler } from '@/services/backup-scheduler';
|
||||
import { backupService } from '@/services/data-management/backup';
|
||||
import { backupScheduler } from '@/services/data-management/backup-scheduler';
|
||||
|
||||
// Force dynamic rendering pour les données en temps réel
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { httpClient } from './base/http-client';
|
||||
import { BackupInfo, BackupConfig } from '@/services/backup';
|
||||
import { BackupInfo, BackupConfig } from '@/services/data-management/backup';
|
||||
|
||||
export interface BackupListResponse {
|
||||
backups: BackupInfo[];
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { backupClient, BackupListResponse } from '@/clients/backup-client';
|
||||
import { BackupConfig } from '@/services/backup';
|
||||
import { BackupConfig } from '@/services/data-management/backup';
|
||||
import { Button } from '@/components/ui/Button';
|
||||
import { Card, CardHeader, CardContent } from '@/components/ui/Card';
|
||||
import { Input } from '@/components/ui/Input';
|
||||
|
||||
@@ -125,7 +125,7 @@ export class SystemInfoService {
|
||||
private static async getBackupCount(): Promise<number> {
|
||||
try {
|
||||
// Import dynamique pour éviter les dépendances circulaires
|
||||
const { backupService } = await import('../backup');
|
||||
const { backupService } = await import('../data-management/backup');
|
||||
const backups = await backupService.listBackups();
|
||||
return backups.length;
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { promises as fs } from 'fs';
|
||||
import path from 'path';
|
||||
import { prisma } from './core/database';
|
||||
import { userPreferencesService } from './core/user-preferences';
|
||||
import { BackupUtils } from '../lib/backup-utils';
|
||||
import { prisma } from '../core/database';
|
||||
import { userPreferencesService } from '../core/user-preferences';
|
||||
import { BackupUtils } from '../../lib/backup-utils';
|
||||
import { getToday } from '@/lib/date-utils';
|
||||
|
||||
export interface BackupConfig {
|
||||
Reference in New Issue
Block a user