Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
REST-SOAP Commentaire WebService
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hugo BAYOUD
REST-SOAP Commentaire WebService
Commits
d4747f0f
Commit
d4747f0f
authored
Feb 20, 2021
by
Hugo BAYOUD
Browse files
Options
Downloads
Patches
Plain Diff
change logic in update comment
parent
6782ba08
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+35
-36
35 additions, 36 deletions
README.md
src/commentaire/commentaire.service.ts
+14
-3
14 additions, 3 deletions
src/commentaire/commentaire.service.ts
with
49 additions
and
39 deletions
README.md
+
35
−
36
View file @
d4747f0f
...
...
@@ -124,12 +124,11 @@ Paramètres `id`
# Documentation API SOAP
Le fichier WSDL associé se trouve dans
`src/shared/ress`
Utiliser le logiciel SOAP UI pour obtenir toues les operations disponibles à partir du fichier WSDL.
Le fichier WSDL associé se trouve dans
à la racine du projet.
Utiliser le logiciel
`
SOAP UI
`
pour obtenir toues les operations disponibles à partir du fichier WSDL.
Exemple avec la création d'un commentaire :
##
Exemple avec la création d'un commentaire :
```
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://commentaires.cours.coffreo.com/">
<soapenv:Header/>
<soapenv:Body>
<com:create>
...
...
@@ -146,12 +145,10 @@ Exemple avec la création d'un commentaire :
</arg0>
</com:create>
</soapenv:Body>
</soapenv:Envelope>
```
La réponse sera alors :
```
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns="http://commentaires.cours.coffreo.com/">
<soap:Body>
<tns:createResponse>
<auteur>Georges Orwell</auteur>
...
...
@@ -160,13 +157,15 @@ La réponse sera alors :
<titre>Ceci est mon commentaire</titre>
</tns:createResponse>
</soap:Body>
</soap:Envelope>
```
*
La date de création en entrée est de type Date et est ensuite
pass
ée en string.
Si une date invalide est passé en entrée, le commentaire sera créé mais contiendra
*
La date de création en entrée est de type
`
Date
`
et est ensuite
transform
ée en
`
string
`
.
Si une date invalide est passé
e
en entrée, le commentaire sera créé mais contiendra
la date actuelle au moment de la création
```
<dateCreation>Wed Dec 23 2020 15:23:56 GMT+0100 (GMT+01:00)</dateCreation>
```
*
L'id a été généré à partir d'UUID car aucun id n'a été donné en entrée.
\ No newline at end of file
*
L'id a été généré à partir d'un UUID car aucun id n'a été donné en entrée.
```
<id>3c4679e8-fed3-45f4-98ce-00583a0e5847</id>
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/commentaire/commentaire.service.ts
+
14
−
3
View file @
d4747f0f
...
...
@@ -36,8 +36,7 @@ export class CommentaireService {
newComment
.
id
=
uuidv4
();
}
newComment
.
dateCreation
=
newComment
.
dateCreation
?.
toString
();
newComment
.
dateCreation
=
newComment
.
dateCreation
?.
toString
()
===
"
Invalid Date
"
?
(
new
Date
()).
toString
()
:
newComment
.
dateCreation
?.
toString
();
CommentaireService
.
commentaires
=
[...
CommentaireService
.
commentaires
,
newComment
];
return
newComment
;
...
...
@@ -70,9 +69,21 @@ export class CommentaireService {
throw
new
NotFoundException
();
}
let
date
:
string
;
if
(
comment
.
dateCreation
===
undefined
)
{
date
=
toUpdateComment
.
dateCreation
;
}
else
{
if
(
comment
.
dateCreation
.
toString
()
===
"
Invalid Date
"
)
{
date
=
(
new
Date
()).
toString
();
}
else
{
date
=
comment
.
dateCreation
.
toString
();
}
}
const
updatedComment
:
Commentaire
=
{
id
:
comment
.
id
?
comment
.
id
:
toUpdateComment
.
id
,
dateCreation
:
comment
.
dateCreation
?
comment
.
dateCreation
:
toUpdateComment
.
dateCreation
,
dateCreation
:
date
,
auteur
:
comment
.
auteur
?
comment
.
auteur
:
toUpdateComment
.
auteur
,
titre
:
comment
.
titre
?
comment
.
titre
:
toUpdateComment
.
titre
,
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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