Commit 1e0e5081 authored by shahriar's avatar shahriar
Browse files

Update app.controller.ts

parent 373bbda2
import { Body, Controller, Get, Post } from '@nestjs/common';
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
import { AppService } from './app.service';
import { GetUserScore } from './dto/get-user-score';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) { }
constructor(private readonly appService: AppService) {}
@Get('get-comments')
async getCommentsFromIG() {
return await this.appService.getComments();
}
@Get('get-followers')
async getFollowers() {
return await this.appService.getFollowers();
}
@Post()
async getUserScore(@Body() getUserScoreDto: GetUserScore) {
return await this.appService.calculateUserScore(getUserScoreDto.username);
......@@ -25,7 +23,7 @@ export class AppController {
@Get('calculate-result')
async calculateResult() {
return await this.appService.getResults()
return await this.appService.getResults();
}
@Get('get-results')
......@@ -33,19 +31,18 @@ export class AppController {
return await this.appService.getFinalResults();
}
@Post('search')
async getUserResults(@Body('username') username: string) {
return await this.appService.getUserResult(username);
@Get('search/:id')
async getUserResults(@Param('id') id: string) {
return await this.appService.getUserResult(id);
}
@Get('shuffle')
async shuffle() {
return await this.appService.getShuffleData()
return await this.appService.getShuffleData();
}
@Get('add-lottory-result')
async addResultDb() {
return await this.appService.addResultsToDB()
return await this.appService.addResultsToDB();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment