Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2021-210
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
2021-210
2021-210
Commits
ccd3620a
Commit
ccd3620a
authored
Nov 24, 2021
by
shalithadeshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add all the necessary service
parent
5cfc6a6d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
192 additions
and
0 deletions
+192
-0
ClientApp/src/app/core/food.ts
ClientApp/src/app/core/food.ts
+4
-0
ClientApp/src/app/core/post.ts
ClientApp/src/app/core/post.ts
+9
-0
ClientApp/src/app/core/python-backend.service.spec.ts
ClientApp/src/app/core/python-backend.service.spec.ts
+16
-0
ClientApp/src/app/core/python-backend.service.ts
ClientApp/src/app/core/python-backend.service.ts
+80
-0
ClientApp/src/app/core/review.ts
ClientApp/src/app/core/review.ts
+3
-0
ClientApp/src/app/rest-calls.service.ts
ClientApp/src/app/rest-calls.service.ts
+22
-0
ClientApp/src/app/spring-backend-service.service.ts
ClientApp/src/app/spring-backend-service.service.ts
+58
-0
No files found.
ClientApp/src/app/core/food.ts
0 → 100644
View file @
ccd3620a
export
interface
Food
{
name
:
string
;
calories
:
number
;
}
ClientApp/src/app/core/post.ts
0 → 100644
View file @
ccd3620a
import
{
Review
}
from
'
./review
'
;
export
interface
Post
{
id
:
number
;
score
:
number
;
title
:
string
;
description
:
string
;
reviews
:
Review
[];
}
ClientApp/src/app/core/python-backend.service.spec.ts
0 → 100644
View file @
ccd3620a
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
PythonBackendService
}
from
'
./python-backend.service
'
;
describe
(
'
PythonBackendService
'
,
()
=>
{
let
service
:
PythonBackendService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
PythonBackendService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
ClientApp/src/app/core/python-backend.service.ts
0 → 100644
View file @
ccd3620a
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
environment
}
from
'
../../environments/environment
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
Observable
}
from
'
rxjs
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
PythonBackendService
{
baseUrlSkinImageClassification
=
environment
.
baseUrlSkinImageClassification
;
baseUrlSymptoms
=
environment
.
baseUrlSymptoms
;
baseUrlOntology
=
environment
.
baseUrlOntology
;
baseUrlWeight
=
environment
.
baseUrlWeight
;
baseUrlWeightPuppy
=
environment
.
baseUrlWeightPuppy
;
baseUrlDb
=
environment
.
baseUrlDb
;
constructor
(
private
httpClient
:
HttpClient
)
{
}
predictSkinDisease
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlSkinImageClassification
}
predict`
,
data
);
}
getImage
():
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlSkinImageClassification
}
getImage`
,
null
);
}
predictDiseaseWithSymptoms
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlSymptoms
}
predict`
,
data
);
}
predictOntologyScore
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlOntology
}
predict`
,
data
);
}
predictWeight
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlWeight
}
predict`
,
data
);
}
predictWeightPuppy
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlWeightPuppy
}
predict`
,
data
);
}
signup
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
signup`
,
data
);
}
login
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
login`
,
data
);
}
addPet
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
addPet`
,
data
);
}
addQuestion
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
addQuestion`
,
data
);
}
addReview
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
addReview`
,
data
);
}
getPets
():
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
getPets`
,
null
);
}
getQuestions
():
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
getQuestions`
,
null
);
}
setQuestionVote
(
data
:
any
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
setQuestionVote`
,
data
);
}
getReviews
():
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrlDb
}
getReviews`
,
null
);
}
}
ClientApp/src/app/core/review.ts
0 → 100644
View file @
ccd3620a
export
interface
Review
{
content
:
string
;
}
ClientApp/src/app/rest-calls.service.ts
0 → 100644
View file @
ccd3620a
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
environment
}
from
"
../environments/environment
"
;
import
{
HttpHeaders
}
from
"
@angular/common/http
"
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
RestCallsService
{
baseUrl
=
environment
.
baseUrlSpring
;
constructor
()
{
}
getRequestHeaders
()
{
const
httpOptions
=
{
headers
:
new
HttpHeaders
({
'
Content-Type
'
:
'
application/json
'
,
Authorization
:
'
Bearer
'
+
localStorage
.
getItem
(
'
token
'
)
})
};
return
httpOptions
;
}
}
ClientApp/src/app/spring-backend-service.service.ts
0 → 100644
View file @
ccd3620a
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
environment
}
from
'
../environments/environment
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
RestCallsService
}
from
'
./rest-calls.service
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
LoginDto
}
from
'
./interfaces/login-dto
'
;
import
{
UserDto
}
from
'
./interfaces/user-dto
'
;
import
{
Dog
}
from
'
./interfaces/dog
'
;
import
{
Question
}
from
'
./interfaces/question
'
;
import
{
Answer
}
from
'
./interfaces/answer
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
SpringBackendServiceService
{
baseUrl
=
environment
.
baseUrlSpring
;
constructor
(
private
httpClient
:
HttpClient
,
private
restCallsService
:
RestCallsService
)
{
}
login
(
login
:
LoginDto
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrl
}
auth/signin`
,
login
);
}
signup
(
userDto
:
UserDto
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrl
}
auth/createAccount`
,
userDto
);
}
newDog
(
dog
:
Dog
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrl
}
dog`
,
dog
,
this
.
restCallsService
.
getRequestHeaders
());
}
allDogs
()
{
return
this
.
httpClient
.
get
<
any
>
(
`
${
this
.
baseUrl
}
dogs`
,
this
.
restCallsService
.
getRequestHeaders
());
}
newQuestion
(
question
:
Question
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrl
}
question`
,
question
,
this
.
restCallsService
.
getRequestHeaders
());
}
allQuestions
()
{
return
this
.
httpClient
.
get
<
any
>
(
`
${
this
.
baseUrl
}
questions`
,
this
.
restCallsService
.
getRequestHeaders
());
}
newAnswer
(
answer
:
Answer
):
Observable
<
any
>
{
return
this
.
httpClient
.
post
<
any
>
(
`
${
this
.
baseUrl
}
answer`
,
answer
,
this
.
restCallsService
.
getRequestHeaders
());
}
answersByQuestion
(
id
)
{
return
this
.
httpClient
.
get
<
any
>
(
`
${
this
.
baseUrl
}
answers/`
+
id
,
this
.
restCallsService
.
getRequestHeaders
());
}
allAnswers
()
{
return
this
.
httpClient
.
get
<
any
>
(
`
${
this
.
baseUrl
}
answers`
,
this
.
restCallsService
.
getRequestHeaders
());
}
}
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