Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/src/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Controller, Get, Redirect } from '@nestjs/common';
import { ApiExcludeController } from '@nestjs/swagger';

@Controller()
@ApiExcludeController()
export class AppController {
constructor() {}

Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/admin/admin.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { SpotdataTradingPairDto } from './spotData/adminSpot.dto';
@Controller('admin')
@UseGuards(JwtAuthGuard)
@ApiBearerAuth()
@ApiTags('Admin')
@ApiTags('Mixin')
export class AdminController {
constructor(
private readonly adminStrategyService: AdminStrategyService,
Expand Down
3 changes: 1 addition & 2 deletions server/src/modules/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { ApiBody, ApiQuery, ApiResponse, ApiTags } from '@nestjs/swagger'; // Im
import { AuthService } from 'src/modules/auth/auth.service';
import { CustomLogger } from '../logger/logger.service';

// Add @ApiTags to categorize the endpoint in Swagger
@ApiTags('Auth')
@ApiTags('Mixin')
@Controller('auth')
export class AuthController {
private readonly logger = new CustomLogger(AuthController.name);
Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/coingecko/coingecko.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
CoinMarketChartResponse,
} from 'coingecko-api-v3';

@ApiTags('marketdata')
@ApiTags('Marketdata')
@Controller('coingecko')
export class CoingeckoController {
constructor(private readonly coingeckoProxy: CoingeckoProxyService) {}
Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/growdata/growdata.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ApiTags } from '@nestjs/swagger';
import { Controller, Get } from '@nestjs/common';
import { GrowdataService } from 'src/modules/growdata/growdata.service';

@ApiTags('grow')
@ApiTags('Grow')
@Controller('grow')
export class GrowdataController {
constructor(private readonly growdataService: GrowdataService) {}
Expand Down
11 changes: 9 additions & 2 deletions server/src/modules/health/health.controller.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// health.controller.ts
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
import { HealthService } from './health.service';
import { ApiOperation, ApiParam, ApiResponse, ApiTags } from '@nestjs/swagger';
import {
ApiBearerAuth,
ApiOperation,
ApiParam,
ApiResponse,
ApiTags,
} from '@nestjs/swagger';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';

@ApiTags('health')
@ApiTags('Health')
@Controller('health')
export class HealthController {
constructor(private healthService: HealthService) {}
Expand Down Expand Up @@ -38,6 +44,7 @@ export class HealthController {
@ApiOperation({ summary: 'Get DB health status' })
@ApiResponse({ status: 200, description: 'Health of Database , OK | ERROR' })
@ApiResponse({ status: 400, description: 'Bad Request' })
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
async getDbHealth() {
return await this.healthService.checkDbHealth();
Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/marketdata/marketdata.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Controller, Get, Query } from '@nestjs/common';
import { MarketdataService } from './marketdata.service';
import { ApiOperation, ApiQuery, ApiResponse, ApiTags } from '@nestjs/swagger';

@ApiTags('marketdata')
@ApiTags('Marketdata')
@Controller('marketdata')
export class MarketDataController {
constructor(private marketDataService: MarketdataService) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { CustomLogger } from 'src/modules/logger/logger.service';
import { ExchangeService } from './exchange.service';

@ApiTags('exchange')
@ApiTags('Exchange')
@Controller('exchange')
export class ExchangeUserController {
private readonly logger = new CustomLogger(ExchangeUserController.name);
Expand Down
10 changes: 8 additions & 2 deletions server/src/modules/mixin/exchange/exchange.controller.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { Controller, Get, Post, UseGuards } from '@nestjs/common';
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import {
ApiBearerAuth,
ApiOperation,
ApiResponse,
ApiTags,
} from '@nestjs/swagger';
import { JwtAuthGuard } from 'src/modules/auth/jwt-auth.guard';
import { CustomLogger } from 'src/modules/logger/logger.service';
import { ExchangeService } from './exchange.service';
import { ExchangeDepositDto, ExchangeWithdrawalDto } from './exchange.dto';

// This API is used for admin page to do rebalance
@ApiTags('exchange')
@ApiTags('Mixin')
@Controller('exchange')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
export class ExchangeController {
private readonly logger = new CustomLogger(ExchangeController.name);
Expand Down
4 changes: 3 additions & 1 deletion server/src/modules/mixin/message/message.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from '@nestjs/common';
import {
ApiBadRequestResponse,
ApiBearerAuth,
ApiOperation,
ApiResponse,
ApiTags,
Expand All @@ -20,8 +21,9 @@ import {
} from './message.dto';
import { MessageService } from './message.service';

@ApiTags('message')
@ApiTags('Mixin')
@Controller('message')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
export class MessageController {
private readonly logger = new CustomLogger(MessageController.name);
Expand Down
10 changes: 8 additions & 2 deletions server/src/modules/mixin/rebalance/rebalance.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ import {
Post,
UseGuards,
} from '@nestjs/common';
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import {
ApiBearerAuth,
ApiOperation,
ApiResponse,
ApiTags,
} from '@nestjs/swagger';
import { RebalanceService } from './rebalance.service';
import { CustomLogger } from 'src/modules/logger/logger.service';
import { JwtAuthGuard } from 'src/modules/auth/jwt-auth.guard';

@ApiTags('rebalance')
@ApiTags('Mixin')
@Controller('rebalance')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
export class RebalanceController {
private readonly logger = new CustomLogger(RebalanceController.name);
Expand Down
5 changes: 4 additions & 1 deletion server/src/modules/mixin/user/user.controller.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Controller, Get, UseGuards } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { UserService } from './user.service';
import { MixinUser } from 'src/common/entities/mixin-user.entity';
import { JwtAuthGuard } from 'src/modules/auth/jwt-auth.guard';

@UseGuards(JwtAuthGuard)
@ApiTags('Mixin')
@Controller('users')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
export class UserController {
constructor(private userService: UserService) {}

Expand Down
2 changes: 2 additions & 0 deletions server/src/modules/performance/performance.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Controller, Get, Param, Query } from '@nestjs/common';
import { PerformanceService } from './performance.service';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('Performance')
@Controller('performance')
export class PerformanceController {
constructor(private readonly performanceService: PerformanceService) {}
Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/spotdata/spotdata.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ApiTags } from '@nestjs/swagger';
import { Controller, Get } from '@nestjs/common';
import { SpotdataService } from 'src/modules/spotdata/spotdata.service';

@ApiTags('spotdata')
@ApiTags('Spotdata')
@Controller('spot')
export class SpotdataController {
constructor(private readonly spotdataService: SpotdataService) {}
Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/strategy/strategy.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { AdminStrategyService } from '../admin/strategy/adminStrategy.service';
import { TimeIndicatorStrategyService } from './time-indicator.service';
import { TimeIndicatorStrategyDto } from './timeIndicator.dto';

@ApiTags('strategy')
@ApiTags('Strategy')
@Controller('strategy')
export class StrategyController {
private loops = new Map<string, NodeJS.Timeout>();
Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/trade/trade.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { TradeService } from './trade.service';
import { MarketTradeDto, LimitTradeDto } from './trade.dto';
import { CustomLogger } from '../logger/logger.service';

@ApiTags('trade')
@ApiTags('Trade')
@Controller('trade')
export class TradeController {
private readonly logger = new CustomLogger(TradeController.name);
Expand Down