-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
import { JwtAuthGuard } from '@app/auth'; | ||
import { Controller, Get, UseGuards } from '@nestjs/common'; | ||
import { Controller, Get, Param, UseGuards } from '@nestjs/common'; | ||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; | ||
import { ClansService } from './clans.service'; | ||
|
||
@ApiTags('CLANS') | ||
@ApiBearerAuth() | ||
@Controller('/clans') | ||
@UseGuards(JwtAuthGuard) | ||
export class ClansController { | ||
@Get() | ||
getHello() { | ||
return {}; | ||
constructor(private clansService: ClansService) {} | ||
|
||
@Get('/:clanTag/capital-contribution') | ||
getCapitalContribution(@Param('clanTag') clanTag: string) { | ||
return this.clansService.getCapitalContribution(clanTag); | ||
} | ||
|
||
@Get('/:clanTag/linked-members') | ||
getLinkedMembers(@Param('clanTag') clanTag: string) { | ||
return this.clansService.getCapitalContribution(clanTag); | ||
} | ||
|
||
@Get('/:clanTag/wars/:warId') | ||
getClanWar(@Param('clanTag') clanTag: string, @Param('warId') warId: string) { | ||
return this.clansService.getClanWar(clanTag, warId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { ClansService } from './clans.service'; | ||
import { ClansController } from './clans.controller'; | ||
import { ClansService } from './clans.service'; | ||
|
||
@Module({ | ||
providers: [ClansService], | ||
controllers: [ClansController], | ||
providers: [ClansService], | ||
}) | ||
export class ClansModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class ClansService {} | ||
export class ClansService { | ||
constructor() {} | ||
|
||
getCapitalContribution(clanTag: string) { | ||
return { clanTag }; | ||
} | ||
|
||
getClanWar(clanTag: string, warId: string) { | ||
return { clanTag, warId }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,6 @@ export class LinksService { | |
} | ||
|
||
getLinks(playerTags: string[]) { | ||
return [playerTags]; | ||
return playerTags; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { JwtAuthGuard } from '@app/auth'; | ||
import { Controller, Get, UseGuards } from '@nestjs/common'; | ||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; | ||
import { PlayersService } from './players.service'; | ||
|
||
@ApiTags('PLAYERS') | ||
@ApiBearerAuth() | ||
@UseGuards(JwtAuthGuard) | ||
@Controller('/players') | ||
export class PlayersController { | ||
constructor(private playersService: PlayersService) {} | ||
|
||
@Get('/:playerTag/clan-wars') | ||
getWarHistory() {} | ||
|
||
@Get('/:playerTag/clan-war-league-stats') | ||
getClanWarLeagueStats() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { PlayersController } from './players.controller'; | ||
import { PlayersService } from './players.service'; | ||
|
||
@Module({ | ||
controllers: [PlayersController], | ||
providers: [PlayersService], | ||
}) | ||
export class PlayersModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class PlayersService {} |