diff --git a/src/processors/gateway/admin/pty.gateway.ts b/src/modules/pty/pty.gateway.ts similarity index 96% rename from src/processors/gateway/admin/pty.gateway.ts rename to src/modules/pty/pty.gateway.ts index 2eab4550..2d474ea3 100644 --- a/src/processors/gateway/admin/pty.gateway.ts +++ b/src/modules/pty/pty.gateway.ts @@ -10,12 +10,13 @@ import { isNil } from 'lodash' import { nanoid } from 'nanoid' import { IPty, spawn } from 'node-pty' import { Socket } from 'socket.io' -import { EventTypes } from '../events.types' -import { AuthGateway } from './auth.gateway' + import { RedisKeys } from '~/constants/cache.constant' import { AuthService } from '~/modules/auth/auth.service' import { ConfigsService } from '~/modules/configs/configs.service' import { CacheService } from '~/processors/cache/cache.service' +import { AuthGateway } from '~/processors/gateway/admin/auth.gateway' +import { EventTypes } from '~/processors/gateway/events.types' import { getIp, getRedisKey } from '~/utils' @WebSocketGateway({ namespace: 'pty' }) diff --git a/src/modules/pty/pty.module.ts b/src/modules/pty/pty.module.ts index f447f9b7..ded29354 100644 --- a/src/modules/pty/pty.module.ts +++ b/src/modules/pty/pty.module.ts @@ -1,9 +1,12 @@ import { Module } from '@nestjs/common' +import { AuthModule } from '../auth/auth.module' import { PTYController } from './pty.controller' +import { PTYGateway } from './pty.gateway' import { PTYService } from './pty.service' @Module({ + imports: [AuthModule], controllers: [PTYController], - providers: [PTYService], + providers: [PTYService, PTYGateway], }) export class PTYModule {} diff --git a/src/processors/gateway/gateway.module.ts b/src/processors/gateway/gateway.module.ts index 5c32ff5e..6cc26032 100644 --- a/src/processors/gateway/gateway.module.ts +++ b/src/processors/gateway/gateway.module.ts @@ -10,14 +10,13 @@ import { Global, Module } from '@nestjs/common' import { AuthModule } from '../../modules/auth/auth.module' import { AdminEventsGateway } from './admin/events.gateway' -import { PTYGateway } from './admin/pty.gateway' import { SharedGateway } from './shared/events.gateway' import { WebEventsGateway } from './web/events.gateway' @Global() @Module({ imports: [AuthModule], - providers: [AdminEventsGateway, WebEventsGateway, SharedGateway, PTYGateway], + providers: [AdminEventsGateway, WebEventsGateway, SharedGateway], exports: [AdminEventsGateway, WebEventsGateway, SharedGateway], }) export class GatewayModule {}