Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sfcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush
sfcode
Commits
918df412
Commit
918df412
authored
Dec 10, 2020
by
Adarsh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments
parent
19d6efad
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
21 deletions
+24
-21
src/app/api.service.ts
src/app/api.service.ts
+6
-6
src/app/auth.guard.ts
src/app/auth.guard.ts
+2
-2
src/app/file.service.ts
src/app/file.service.ts
+8
-8
src/app/problem.service.ts
src/app/problem.service.ts
+3
-0
src/app/question.service.ts
src/app/question.service.ts
+2
-2
src/app/run-code.service.ts
src/app/run-code.service.ts
+3
-3
No files found.
src/app/api.service.ts
View file @
918df412
...
...
@@ -21,7 +21,7 @@ export class ApiService {
constructor
(
private
httpClient
:
HttpClient
)
{
}
/*
/*
! \brief
This function is used to log in the user by posting username and password as it's parameters to the backend php scripts.
*/
...
...
@@ -37,7 +37,7 @@ export class ApiService {
}));
}
/*
/*
! \brief
This function is used to register the user by posting name, email, username and password as it's parameters to the backend php scripts.
*/
...
...
@@ -48,7 +48,7 @@ export class ApiService {
}));
}
/*
/*
! \brief
This function is used to set token for the user to the local storage.
*/
...
...
@@ -56,7 +56,7 @@ export class ApiService {
localStorage
.
setItem
(
'
sfcode_user_token_2n1289bpxd
'
,
token
);
}
/*
/*
! \brief
This function is used to get token for the user from the local storage.
*/
...
...
@@ -64,7 +64,7 @@ export class ApiService {
return
localStorage
.
getItem
(
'
sfcode_user_token_2n1289bpxd
'
);
}
/*
/*
! \brief
This function is used to delete token from the local storage.
*/
...
...
@@ -72,7 +72,7 @@ export class ApiService {
localStorage
.
removeItem
(
'
sfcode_user_token_2n1289bpxd
'
);
}
/*
/*
! \brief
This function is used to check the login state of the user by the availability of token in local storage.
*/
...
...
src/app/auth.guard.ts
View file @
918df412
...
...
@@ -15,7 +15,7 @@ export class AuthGuard implements CanActivate {
constructor
(
private
dataService
:
ApiService
,
private
router
:
Router
)
{
}
/*
/*
! \brief
This function checks the state of router and calls the boolean function isLogin() to check whether a user is logged in or not.
*/
canActivate
(
...
...
@@ -26,7 +26,7 @@ export class AuthGuard implements CanActivate {
return
this
.
isLogin
(
routeUrl
);
}
/*
/*
! \brief
This function calls Api Service to check the login status of the user and redirects the user to appropriate routes according to status.
*/
...
...
src/app/file.service.ts
View file @
918df412
...
...
@@ -15,7 +15,7 @@ import { User } from './user';
})
export
class
FileService
{
/*
/*
! \brief
Url variables to store the backend urls for post and get requests.
*/
...
...
@@ -29,7 +29,7 @@ export class FileService {
constructor
(
private
http
:
HttpClient
)
{
}
/*
/*
! \brief
Temporary function to get files used for debugging.
*/
...
...
@@ -51,7 +51,7 @@ export class FileService {
return
of
(
ret
);
}
/*
/*
! \brief
Function to upload a file to the database using file interface and a boolean whether it is an attempt to a question
or created in ide.
*/
...
...
@@ -60,7 +60,7 @@ export class FileService {
return
this
.
http
.
post
(
this
.
saveUrl
,
{
file
,
isAttempt
});
}
/*
/*
! \brief
Function to upload a file to the database using upload option, was used for debugging.
*/
...
...
@@ -70,7 +70,7 @@ export class FileService {
return
this
.
http
.
post
(
this
.
uploadUrl
,
formData
);
}
/*
/*
! \brief
Function to delete a file from the database and server, by a post request, posting file, username and number of files .
*/
...
...
@@ -78,21 +78,21 @@ export class FileService {
return
this
.
http
.
post
(
this
.
deleteUrl
,
{
file
,
isFile
,
username
,
nFiles
});
}
/*
/*
! \brief
Function to get files from the database and server, by a post request, posting username.
*/
getFileList
(
username
:
string
):
Observable
<
any
>
{
return
this
.
http
.
post
(
this
.
fileListUrl
,
{
username
});
}
/*
/*
! \brief
Function to get file's content from the database and server, by a post request, posting username and file's path.
*/
getFileContent
(
username
:
string
,
filepath
:
string
):
Observable
<
any
>
{
return
this
.
http
.
post
(
this
.
fileContentUrl
,
{
username
,
file_path
:
filepath
});
}
/*
/*
! \brief
Function to create a directory for a particular user on the server while posting username, directory name and it's path.
*/
createDirectory
(
username
:
string
,
dirname
:
string
,
path
:
string
):
Observable
<
any
>
{
...
...
src/app/problem.service.ts
View file @
918df412
...
...
@@ -15,6 +15,9 @@ export class ProblemService {
constructor
()
{
}
/*! \brief
Function to get temporary problems used for debugging.
*/
getProblems
():
Observable
<
Problem
[]
>
{
const
ret
:
Problem
[]
=
[];
...
...
src/app/question.service.ts
View file @
918df412
...
...
@@ -19,14 +19,14 @@ export class QuestionService {
constructor
(
private
http
:
HttpClient
)
{
}
/*
/*
! \brief
This function is used to upload question from each user to database.
*/
uploadQues
(
ques
:
Question
):
Observable
<
any
>
{
return
this
.
http
.
post
(
this
.
uploadUrl
,
ques
);
}
/*
/*
! \brief
This function is used to get questions from all user from database.
*/
getQues
():
Observable
<
Question
[]
>
{
...
...
src/app/run-code.service.ts
View file @
918df412
...
...
@@ -22,7 +22,7 @@ export class RunCodeService {
constructor
(
private
httpClient
:
HttpClient
)
{
}
/*
/*
! \brief
This function is used to post the file data for compilation.
*/
...
...
@@ -30,7 +30,7 @@ export class RunCodeService {
return
this
.
httpClient
.
post
(
this
.
baseUrl
+
'
compile.php
'
,
file
);
}
/*
/*
! \brief
This function is used to post the file data and custom input for execution.
*/
...
...
@@ -41,7 +41,7 @@ export class RunCodeService {
});
}
/*
/*
! \brief
This function is used to verify the testcases while posting the file data and other relaated parameters to the backend.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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