Skip to content

Commit f067b4c

Browse files
committed
refactor: streamline constructor syntax in Internal, Stats, and Xray controllers
- Simplified constructor definitions by removing redundant assignments in InternalController, StatsController, and XrayController
1 parent 09f3102 commit f067b4c

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/modules/internal/internal.controller.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { Controller, Get, UseFilters, UseGuards } from '@nestjs/common';
22

3+
import { PortGuard } from '@common/guards/request-port-guard/request-port.guard';
4+
import { HttpExceptionFilter } from '@common/exception/httpException.filter';
5+
import { OnPort } from '@common/decorators/port/port.decorator';
36
import {
47
XRAY_INTERNAL_API_CONTROLLER,
58
XRAY_INTERNAL_API_PATH,
69
XRAY_INTERNAL_API_PORT,
710
} from '@libs/contracts/constants';
8-
import { PortGuard } from '@common/guards/request-port-guard/request-port.guard';
9-
import { HttpExceptionFilter } from '@common/exception/httpException.filter';
10-
import { OnPort } from '@common/decorators/port/port.decorator';
1111

1212
import { InternalService } from './internal.service';
1313

14-
@Controller(XRAY_INTERNAL_API_CONTROLLER)
1514
@OnPort(XRAY_INTERNAL_API_PORT)
1615
@UseFilters(HttpExceptionFilter)
1716
@UseGuards(PortGuard)
17+
@Controller(XRAY_INTERNAL_API_CONTROLLER)
1818
export class InternalController {
1919
constructor(private readonly internalService: InternalService) {}
2020

src/modules/stats/stats.controller.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ import { StatsService } from './stats.service';
2626
@UseGuards(JwtDefaultGuard)
2727
@Controller(STATS_CONTROLLER)
2828
export class StatsController {
29-
constructor(private readonly statsService: StatsService) {
30-
this.statsService = statsService;
31-
}
29+
constructor(private readonly statsService: StatsService) {}
3230

3331
@Post(STATS_ROUTES.GET_USER_ONLINE_STATUS)
3432
public async getUserOnlineStatus(

src/modules/xray-core/xray.controller.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ import { XrayService } from './xray.service';
2020
export class XrayController {
2121
private readonly logger = new Logger(XrayController.name);
2222

23-
constructor(private readonly xrayService: XrayService) {
24-
this.xrayService = xrayService;
25-
}
23+
constructor(private readonly xrayService: XrayService) {}
2624

2725
@Post(XRAY_ROUTES.START)
2826
public async startXray(

0 commit comments

Comments
 (0)