Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-191
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2023-191
2023-191
Commits
f43331d9
Commit
f43331d9
authored
Aug 29, 2023
by
it20118068
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new services
parent
9f540616
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
16 deletions
+80
-16
Frontend/src/services/RestService.js
Frontend/src/services/RestService.js
+80
-16
No files found.
Frontend/src/services/RestService.js
View file @
f43331d9
import
axios
from
'
axios
'
;
const
BASE_URL
=
"
http://127.0.0.1:500
0/
"
;
const
FLASK_URL
=
"
http://127.0.0.1:805
0/
"
;
const
BACKEND_URL
=
"
http://localhost:8885/ShrasthraBackendService/
"
;
class
RestService
{
...
...
@@ -24,26 +24,90 @@ class RestService {
return
axios
.
post
(
BACKEND_URL
+
'
sign/detectDynamicSign
'
,
formData
,
config
)
}
// detectSign(formData) {
// return axios.post(BASE_URL + 'api/data',formData)
// }
audioToSign
(
token
,
formData
)
{
const
config
=
{
headers
:
{
'
Access-Control-Allow-Origin
'
:
"
*
"
,
'
Authorization
'
:
'
Bearer
'
+
token
}
}
return
axios
.
post
(
BACKEND_URL
+
'
sign/audioToSign
'
,
formData
,
config
)
}
// authenticateUser(username, password) {
// return axios.post(USER_BASE_URL + 'api/user/login',{username:username, password:password})
// }
videoToSign
(
token
,
formData
)
{
const
config
=
{
headers
:
{
'
Access-Control-Allow-Origin
'
:
"
*
"
,
'
Authorization
'
:
'
Bearer
'
+
token
}
}
return
axios
.
post
(
BACKEND_URL
+
'
sign/videoToSign
'
,
formData
,
config
)
}
checkVocal
(
token
,
formData
)
{
const
config
=
{
headers
:
{
'
Access-Control-Allow-Origin
'
:
"
*
"
,
'
Authorization
'
:
'
Bearer
'
+
token
}
}
return
axios
.
post
(
BACKEND_URL
+
'
sign/vocalTraining
'
,
formData
,
config
)
}
getAllLessonsById
(
token
,
req
){
const
config
=
{
headers
:
{
'
Access-Control-Allow-Origin
'
:
"
*
"
,
'
Authorization
'
:
'
Bearer
'
+
token
}
}
return
axios
.
post
(
BACKEND_URL
+
'
lessons/getAllLessons
'
,
req
,
config
)
}
getSignByText
(
token
,
req
){
const
config
=
{
headers
:
{
'
Access-Control-Allow-Origin
'
:
"
*
"
,
'
Authorization
'
:
'
Bearer
'
+
token
}
}
return
axios
.
post
(
BACKEND_URL
+
'
sign/getURL
'
,
req
,
config
)
}
startQuiz
(
token
,
req
){
const
config
=
{
headers
:
{
'
Access-Control-Allow-Origin
'
:
"
*
"
,
'
Authorization
'
:
'
Bearer
'
+
token
}
}
return
axios
.
post
(
BACKEND_URL
+
'
quiz/startQuiz
'
,
req
,
config
)
}
getQuizByUID
(
token
,
req
){
const
config
=
{
headers
:
{
'
Access-Control-Allow-Origin
'
:
"
*
"
,
'
Authorization
'
:
'
Bearer
'
+
token
}
}
return
axios
.
post
(
BACKEND_URL
+
'
quiz/getQuiz
'
,
req
,
config
)
}
// getAllUsers(token) {
// const config = {
// headers: {
// 'Access-Control-Allow-Origin': "*",
// 'Authorization': 'Bearer ' + token
// }
// }
// return axios.get(USER_BASE_URL + 'api/user/getAll', config)
// }
// Direct Flask APIs
checkVoice
(
req
){
return
axios
.
post
(
FLASK_URL
+
'
api/checkVoice
'
,
req
);
}
getTextToSignURL
(
req
){
return
axios
.
post
(
FLASK_URL
+
'
api/get-url
'
,
req
);
}
getTextBySign
(
req
){
return
axios
.
post
(
FLASK_URL
+
'
api/getTextBySign
'
,
req
);
}
}
...
...
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