Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
shahriar
instagram-service
Commits
1e0e5081
Commit
1e0e5081
authored
Jul 27, 2021
by
shahriar
☹
Browse files
Update app.controller.ts
parent
373bbda2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app.controller.ts
View file @
1e0e5081
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
();
}
@
Pos
t
(
'
search
'
)
async
getUserResults
(@
Body
(
'
username
'
)
username
:
string
)
{
return
await
this
.
appService
.
getUserResult
(
username
);
@
Ge
t
(
'
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
()
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment