From 66a0708274f1158b23e50936999f7738da1c442c Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 8 Jun 2024 22:23:48 +0000 Subject: [PATCH] refactor(server): renamed files with service classes --- server/src/api/index.ts | 2 +- server/src/api/routes/config.ts | 2 +- server/src/api/routes/login.ts | 2 +- server/src/app.ts | 6 +++--- .../cron/{agenda-cron.ts => agenda-cron-service.ts} | 0 server/src/services/cron/index.ts | 2 +- server/src/services/cron/jobs/clear-cache.ts | 2 +- server/src/services/cron/jobs/content-scan.ts | 2 +- server/src/services/cron/jobs/library-scan.ts | 2 +- server/src/services/cron/jobs/quota-reset.ts | 2 +- server/src/services/cron/jobs/resource-cache.ts | 2 +- server/src/services/cron/jobs/users-scan.ts | 2 +- server/src/services/migration/index.ts | 2 +- .../migration/{migration.ts => migration-service.ts} | 0 server/src/services/settings/index.ts | 2 +- .../services/settings/{settings.ts => settings-service.ts} | 0 server/src/services/setup/setup.ts | 2 +- 17 files changed, 16 insertions(+), 16 deletions(-) rename server/src/services/cron/{agenda-cron.ts => agenda-cron-service.ts} (100%) rename server/src/services/migration/{migration.ts => migration-service.ts} (100%) rename server/src/services/settings/{settings.ts => settings-service.ts} (100%) diff --git a/server/src/api/index.ts b/server/src/api/index.ts index 0e7a7c65..c54d68cf 100644 --- a/server/src/api/index.ts +++ b/server/src/api/index.ts @@ -19,7 +19,7 @@ import { import { getFromContainer } from '@/infrastructure/container/container'; import { HttpServer } from '@/infrastructure/http/http-server'; import { SettingsSchemaProps } from '@/resources/settings/schema'; -import { SettingsService } from '@/services/settings/settings'; +import { SettingsService } from '@/services/settings/settings-service'; const routes = (settings: SettingsSchemaProps): Koa => { const app = new Koa(); diff --git a/server/src/api/routes/config.ts b/server/src/api/routes/config.ts index 58e7b0ca..adf5c92b 100644 --- a/server/src/api/routes/config.ts +++ b/server/src/api/routes/config.ts @@ -7,7 +7,7 @@ import { validateRequest } from '@/api/middleware/validation'; import { HTTP_BASE_PATH } from '@/infrastructure/config/env'; import { getFromContainer } from '@/infrastructure/container/container'; import logger from '@/infrastructure/logger/logger'; -import { SettingsService } from '@/services/settings/settings'; +import { SettingsService } from '@/services/settings/settings-service'; const getConfig = async (ctx: Context) => { try { diff --git a/server/src/api/routes/login.ts b/server/src/api/routes/login.ts index 1d60b9fc..a97c95cb 100644 --- a/server/src/api/routes/login.ts +++ b/server/src/api/routes/login.ts @@ -14,7 +14,7 @@ import { UserEntity } from '@/resources/user/entity'; import { UserMapper } from '@/resources/user/mapper'; import { UserRepository } from '@/resources/user/repository'; import { UserRole } from '@/resources/user/types'; -import { SettingsService } from '@/services/settings/settings'; +import { SettingsService } from '@/services/settings/settings-service'; const logger = loggerMain.child({ module: 'routes.login' }); diff --git a/server/src/app.ts b/server/src/app.ts index 1153e775..2202749c 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -20,9 +20,9 @@ import { MongooseDatabaseConnection } from '@/infrastructure/database/connection import logger from '@/infrastructure/logger/logger'; import { Master } from '@/infrastructure/worker/master'; import { CacheService } from '@/services/cache/cache-service'; -import { AgendaCronService } from '@/services/cron/agenda-cron'; -import { MigrationService } from '@/services/migration/migration'; -import { SettingsService } from '@/services/settings/settings'; +import { AgendaCronService } from '@/services/cron/agenda-cron-service'; +import { MigrationService } from '@/services/migration/migration-service'; +import { SettingsService } from '@/services/settings/settings-service'; import appConfig from '../package.json'; diff --git a/server/src/services/cron/agenda-cron.ts b/server/src/services/cron/agenda-cron-service.ts similarity index 100% rename from server/src/services/cron/agenda-cron.ts rename to server/src/services/cron/agenda-cron-service.ts diff --git a/server/src/services/cron/index.ts b/server/src/services/cron/index.ts index 2dcf106d..650101a0 100644 --- a/server/src/services/cron/index.ts +++ b/server/src/services/cron/index.ts @@ -11,7 +11,7 @@ import { QuotaResetJob } from '@/services/cron/jobs/quota-reset'; import { ResourceCacheJob } from '@/services/cron/jobs/resource-cache'; import { UsersScanJob } from '@/services/cron/jobs/users-scan'; -import { AgendaCronService } from './agenda-cron'; +import { AgendaCronService } from './agenda-cron-service'; import { JobCronName } from './types'; export default (builder: ContainerBuilder) => { diff --git a/server/src/services/cron/jobs/clear-cache.ts b/server/src/services/cron/jobs/clear-cache.ts index acb3fe0a..3d85c742 100644 --- a/server/src/services/cron/jobs/clear-cache.ts +++ b/server/src/services/cron/jobs/clear-cache.ts @@ -2,7 +2,7 @@ import { Service } from 'diod'; import pino from 'pino'; import { Logger } from '@/infrastructure/logger/logger'; -import { AgendaCronService } from '@/services/cron/agenda-cron'; +import { AgendaCronService } from '@/services/cron/agenda-cron-service'; import { Jobber } from '@/services/cron/job'; import { JobCronName } from '@/services/cron/types'; diff --git a/server/src/services/cron/jobs/content-scan.ts b/server/src/services/cron/jobs/content-scan.ts index 4ac3b242..a9512953 100644 --- a/server/src/services/cron/jobs/content-scan.ts +++ b/server/src/services/cron/jobs/content-scan.ts @@ -1,6 +1,6 @@ import { Service } from 'diod'; -import { AgendaCronService } from '@/services/cron/agenda-cron'; +import { AgendaCronService } from '@/services/cron/agenda-cron-service'; import { Jobber } from '@/services/cron/job'; import { JobCronName } from '@/services/cron/types'; import { ScannerService } from '@/services/scanner/scanner-service'; diff --git a/server/src/services/cron/jobs/library-scan.ts b/server/src/services/cron/jobs/library-scan.ts index 3080b0a2..1fd6abec 100644 --- a/server/src/services/cron/jobs/library-scan.ts +++ b/server/src/services/cron/jobs/library-scan.ts @@ -1,6 +1,6 @@ import { Service } from 'diod'; -import { AgendaCronService } from '@/services/cron/agenda-cron'; +import { AgendaCronService } from '@/services/cron/agenda-cron-service'; import { Jobber } from '@/services/cron/job'; import { JobCronName } from '@/services/cron/types'; import { ScannerService } from '@/services/scanner/scanner-service'; diff --git a/server/src/services/cron/jobs/quota-reset.ts b/server/src/services/cron/jobs/quota-reset.ts index 31d9faea..e8d4fe85 100644 --- a/server/src/services/cron/jobs/quota-reset.ts +++ b/server/src/services/cron/jobs/quota-reset.ts @@ -1,6 +1,6 @@ import { Service } from 'diod'; -import { AgendaCronService } from '@/services/cron/agenda-cron'; +import { AgendaCronService } from '@/services/cron/agenda-cron-service'; import { Jobber } from '@/services/cron/job'; import { JobCronName } from '@/services/cron/types'; import QuotaSystem from '@/services/requests/quotas'; diff --git a/server/src/services/cron/jobs/resource-cache.ts b/server/src/services/cron/jobs/resource-cache.ts index 730bd7f8..cd3758af 100644 --- a/server/src/services/cron/jobs/resource-cache.ts +++ b/server/src/services/cron/jobs/resource-cache.ts @@ -1,6 +1,6 @@ import { Service } from 'diod'; -import { AgendaCronService } from '@/services/cron/agenda-cron'; +import { AgendaCronService } from '@/services/cron/agenda-cron-service'; import { Jobber } from '@/services/cron/job'; import { JobCronName } from '@/services/cron/types'; import { MovieService } from '@/services/movie/movie'; diff --git a/server/src/services/cron/jobs/users-scan.ts b/server/src/services/cron/jobs/users-scan.ts index 360a5f27..5d47b9e9 100644 --- a/server/src/services/cron/jobs/users-scan.ts +++ b/server/src/services/cron/jobs/users-scan.ts @@ -1,6 +1,6 @@ import { Service } from 'diod'; -import { AgendaCronService } from '@/services/cron/agenda-cron'; +import { AgendaCronService } from '@/services/cron/agenda-cron-service'; import { Jobber } from '@/services/cron/job'; import { JobCronName } from '@/services/cron/types'; import { ScannerService } from '@/services/scanner/scanner-service'; diff --git a/server/src/services/migration/index.ts b/server/src/services/migration/index.ts index 11db87cb..c3924c5e 100644 --- a/server/src/services/migration/index.ts +++ b/server/src/services/migration/index.ts @@ -1,6 +1,6 @@ import { ContainerBuilder } from 'diod'; -import { MigrationService } from '@/services/migration/migration'; +import { MigrationService } from '@/services/migration/migration-service'; export default (builder: ContainerBuilder) => { builder.registerAndUse(MigrationService).asSingleton(); diff --git a/server/src/services/migration/migration.ts b/server/src/services/migration/migration-service.ts similarity index 100% rename from server/src/services/migration/migration.ts rename to server/src/services/migration/migration-service.ts diff --git a/server/src/services/settings/index.ts b/server/src/services/settings/index.ts index 9939d698..9abe779b 100644 --- a/server/src/services/settings/index.ts +++ b/server/src/services/settings/index.ts @@ -1,6 +1,6 @@ import { ContainerBuilder } from 'diod'; -import { SettingsService } from '@/services/settings/settings'; +import { SettingsService } from '@/services/settings/settings-service'; export default (builder: ContainerBuilder) => { builder.registerAndUse(SettingsService).asSingleton(); diff --git a/server/src/services/settings/settings.ts b/server/src/services/settings/settings-service.ts similarity index 100% rename from server/src/services/settings/settings.ts rename to server/src/services/settings/settings-service.ts diff --git a/server/src/services/setup/setup.ts b/server/src/services/setup/setup.ts index f341ff69..c5527b57 100644 --- a/server/src/services/setup/setup.ts +++ b/server/src/services/setup/setup.ts @@ -14,7 +14,7 @@ import { MediaServerType } from '@/resources/media-server/types'; import { UserEntity } from '@/resources/user/entity'; import { UserRepository } from '@/resources/user/repository'; import { UserRole } from '@/resources/user/types'; -import { SettingsService } from '@/services/settings/settings'; +import { SettingsService } from '@/services/settings/settings-service'; import { CreateAdminUserProps, CreateMediaServerProps,