Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-casa-user-data-service
Commits
5983d793
Commit
5983d793
authored
2 years ago
by
tushar5526
Browse files
Options
Download
Patches
Plain Diff
feat: added student and tutor getdata paths
parent
adba9e48
main
getStudentByRollnumber
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app.controller.ts
+10
-0
src/app.controller.ts
src/app.service.ts
+16
-1
src/app.service.ts
with
26 additions
and
1 deletion
+26
-1
src/app.controller.ts
+
10
−
0
View file @
5983d793
...
@@ -28,4 +28,14 @@ export class AppController {
...
@@ -28,4 +28,14 @@ export class AppController {
getUserCredentials
(@
Param
()
params
)
{
getUserCredentials
(@
Param
()
params
)
{
return
this
.
appService
.
getUserCredentials
(
params
.
id
);
return
this
.
appService
.
getUserCredentials
(
params
.
id
);
}
}
@
Get
(
'
student/:id
'
)
getStudent
(@
Param
()
params
)
{
return
this
.
appService
.
getStudentById
(
params
.
id
);
}
@
Get
(
'
tutor/:id
'
)
getTutor
(@
Param
()
params
)
{
return
this
.
appService
.
getTutorById
(
params
.
id
);
}
}
}
This diff is collapsed.
Click to expand it.
src/app.service.ts
+
16
−
1
View file @
5983d793
import
{
Injectable
,
Inject
}
from
'
@nestjs/common
'
;
import
{
Injectable
,
Inject
}
from
'
@nestjs/common
'
;
import
{
MSSQL_CONNECTION
}
from
'
./constants
'
;
import
{
MSSQL_CONNECTION
}
from
'
./constants
'
;
import
*
as
bcrypt
from
'
bcrypt
'
;
import
*
as
CryptoJS
from
'
crypto
'
;
import
*
as
CryptoJS
from
'
crypto
'
;
@
Injectable
()
@
Injectable
()
...
@@ -108,4 +107,20 @@ export class AppService {
...
@@ -108,4 +107,20 @@ export class AppService {
});
});
return
cred_res
[
0
];
return
cred_res
[
0
];
}
}
async
getTutorById
(
id
:
string
)
{
const
db
=
await
this
.
conn
.
connect
();
const
res
=
await
db
.
query
(
`Select * from test.dbo.Master_Tutor_Basic_Info where TutorKey='
${
id
}
'`
,
);
return
res
.
recordset
[
0
];
}
async
getStudentById
(
id
:
string
)
{
const
db
=
await
this
.
conn
.
connect
();
const
res
=
await
db
.
query
(
`Select * from test.dbo.Master_StudentProfile where StudentProfileKey='
${
id
}
'`
,
);
return
res
.
recordset
[
0
];
}
}
}
This diff is collapsed.
Click to expand it.
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets