Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ArchiAServices
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
elisabeth kee
ArchiAServices
Commits
d1a28cb5
Commit
d1a28cb5
authored
Apr 11, 2022
by
elisabeth kee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mise à jour de tous les patchs
parent
dd0b4e78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
ProfileResource.java
...a/com/example/trial/profile/resource/ProfileResource.java
+15
-15
No files found.
src/main/java/com/example/trial/profile/resource/ProfileResource.java
View file @
d1a28cb5
...
@@ -71,13 +71,14 @@ public class ProfileResource {
...
@@ -71,13 +71,14 @@ public class ProfileResource {
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"{id}/updateAge"
)
@Path
(
"{id}/updateAge"
)
public
Response
updateAge
(
@PathParam
(
"id"
)
Long
id
,
Profile
p
)
{
public
Response
updateAge
(
@PathParam
(
"id"
)
Long
id
,
String
newAge
)
{
int
age
=
p
.
getAge
();
String
newAge2
=
newAge
.
replace
(
'"'
,
' '
);
int
newAge3
=
Integer
.
parseInt
(
newAge2
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
Profile
pBDD
=
optional
.
get
();
Profile
pBDD
=
optional
.
get
();
pBDD
.
setAge
(
age
);
pBDD
.
setAge
(
newAge3
);
profileRepository
.
save
(
pBDD
);
profileRepository
.
save
(
pBDD
);
return
Response
.
ok
(
pBDD
).
build
();
return
Response
.
ok
(
pBDD
).
build
();
}
else
{
}
else
{
...
@@ -107,13 +108,13 @@ public class ProfileResource {
...
@@ -107,13 +108,13 @@ public class ProfileResource {
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"{id}/updateGender"
)
@Path
(
"{id}/updateGender"
)
public
Response
updateGender
(
@PathParam
(
"id"
)
Long
id
,
Profile
p
)
{
public
Response
updateGender
(
@PathParam
(
"id"
)
Long
id
,
String
newGender
)
{
String
gender
=
p
.
getGender
(
);
String
newGender2
=
newGender
.
replace
(
'"'
,
' '
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
Profile
pBDD
=
optional
.
get
();
Profile
pBDD
=
optional
.
get
();
pBDD
.
setGender
(
gender
);
pBDD
.
setGender
(
newGender2
.
strip
()
);
profileRepository
.
save
(
pBDD
);
profileRepository
.
save
(
pBDD
);
return
Response
.
ok
(
pBDD
).
build
();
return
Response
.
ok
(
pBDD
).
build
();
}
else
{
}
else
{
...
@@ -125,13 +126,13 @@ public class ProfileResource {
...
@@ -125,13 +126,13 @@ public class ProfileResource {
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"{id}/updatePet"
)
@Path
(
"{id}/updatePet"
)
public
Response
updatePet
(
@PathParam
(
"id"
)
Long
id
,
Profile
p
)
{
public
Response
updatePet
(
@PathParam
(
"id"
)
Long
id
,
String
newPet
)
{
String
pet
=
p
.
getPet
(
);
String
newPet2
=
newPet
.
replace
(
'"'
,
' '
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
Profile
pBDD
=
optional
.
get
();
Profile
pBDD
=
optional
.
get
();
pBDD
.
setPet
(
pet
);
pBDD
.
setPet
(
newPet2
.
strip
()
);
profileRepository
.
save
(
pBDD
);
profileRepository
.
save
(
pBDD
);
return
Response
.
ok
(
pBDD
).
build
();
return
Response
.
ok
(
pBDD
).
build
();
}
else
{
}
else
{
...
@@ -143,13 +144,13 @@ public class ProfileResource {
...
@@ -143,13 +144,13 @@ public class ProfileResource {
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"{id}/updateContact"
)
@Path
(
"{id}/updateContact"
)
public
Response
updateContact
(
@PathParam
(
"id"
)
Long
id
,
Profile
p
)
{
public
Response
updateContact
(
@PathParam
(
"id"
)
Long
id
,
String
newContact
)
{
String
partner
=
p
.
getContact
(
);
String
newContact2
=
newContact
.
replace
(
'"'
,
' '
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
Profile
pBDD
=
optional
.
get
();
Profile
pBDD
=
optional
.
get
();
pBDD
.
setContact
(
partner
);
pBDD
.
setContact
(
newContact2
.
strip
()
);
profileRepository
.
save
(
pBDD
);
profileRepository
.
save
(
pBDD
);
return
Response
.
ok
(
pBDD
).
build
();
return
Response
.
ok
(
pBDD
).
build
();
}
else
{
}
else
{
...
@@ -161,13 +162,12 @@ public class ProfileResource {
...
@@ -161,13 +162,12 @@ public class ProfileResource {
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"{id}/updateLovers"
)
@Path
(
"{id}/updateLovers"
)
public
Response
updateLovers
(
@PathParam
(
"id"
)
Long
id
,
Profile
p
)
{
public
Response
updateLovers
(
@PathParam
(
"id"
)
Long
id
,
List
<
Lover
>
newLovers
)
{
List
<
Lover
>
lovers
=
p
.
getLovers
();
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
Optional
<
Profile
>
optional
=
profileRepository
.
findById
(
id
);
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
Profile
pBDD
=
optional
.
get
();
Profile
pBDD
=
optional
.
get
();
pBDD
.
setLovers
(
l
overs
);
pBDD
.
setLovers
(
newL
overs
);
profileRepository
.
save
(
pBDD
);
profileRepository
.
save
(
pBDD
);
return
Response
.
ok
(
pBDD
).
build
();
return
Response
.
ok
(
pBDD
).
build
();
}
else
{
}
else
{
...
...
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