Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
ge-mange
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
joel.cavat
ge-mange
Commits
1515cd80
Commit
1515cd80
authored
6 years ago
by
michael.ramusi
Browse files
Options
Downloads
Patches
Plain Diff
credit an account
parent
bd66ebd7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
services/src/main/java/ch/hepia/order/http.java
+9
-0
9 additions, 0 deletions
services/src/main/java/ch/hepia/order/http.java
services/src/main/resources/static/demo.html
+2
-1
2 additions, 1 deletion
services/src/main/resources/static/demo.html
with
11 additions
and
1 deletion
services/src/main/java/ch/hepia/order/http.java
+
9
−
0
View file @
1515cd80
...
@@ -60,6 +60,15 @@ public class http {
...
@@ -60,6 +60,15 @@ public class http {
return
name
;
return
name
;
}
}
@RequestMapping
(
"/creditAccount"
)
public
String
createAccount
(
@RequestParam
(
value
=
"idAccount"
,
defaultValue
=
"1"
)
int
idAccount
,
@RequestParam
(
value
=
"amount"
,
defaultValue
=
"1"
)
double
amount
)
{
accountService
.
send
(
new
EventCreditAnAccount
(
5
,
"Crediting account"
,
idAccount
,
amount
));
return
null
;
}
@RequestMapping
(
"/createProduct"
)
@RequestMapping
(
"/createProduct"
)
public
Product
createProduct
(
@RequestParam
(
value
=
"name"
,
defaultValue
=
"poire"
)
String
name
,
public
Product
createProduct
(
@RequestParam
(
value
=
"name"
,
defaultValue
=
"poire"
)
String
name
,
@RequestParam
(
value
=
"price"
,
defaultValue
=
"1"
)
double
price
)
{
@RequestParam
(
value
=
"price"
,
defaultValue
=
"1"
)
double
price
)
{
...
...
This diff is collapsed.
Click to expand it.
services/src/main/resources/static/demo.html
+
2
−
1
View file @
1515cd80
...
@@ -18,8 +18,9 @@
...
@@ -18,8 +18,9 @@
<p>
Create a product that is an apple that costs 1.3
<a
href=
"/createProduct?name=apple&price=1.3"
>
/createProduct?name=apple
&
price=1.3
</a></p>
<p>
Create a product that is an apple that costs 1.3
<a
href=
"/createProduct?name=apple&price=1.3"
>
/createProduct?name=apple
&
price=1.3
</a></p>
<h2>
Accounts
</h2>
<h2>
Accounts
</h2>
<p>
Create an account with default value
s
<a
href=
"/createAccount"
>
/createAccount
</a></p>
<p>
Create an account with default value
(name=Orphée)
<a
href=
"/createAccount"
>
/createAccount
</a></p>
<p>
Create an account with name Ovide
<a
href=
"/createAccount?name=Ovide"
>
/createAccount?name=Ovide
</a></p>
<p>
Create an account with name Ovide
<a
href=
"/createAccount?name=Ovide"
>
/createAccount?name=Ovide
</a></p>
<p>
Credit 50.- to account with id 1
<a
href=
"/creditAccount?idAccount=1&amount=50"
>
/creditAccount?idAccount=1
&
amount=50
</a></p>
<h2>
Orders
</h2>
<h2>
Orders
</h2>
<!-- <p>Order 2 units of product with id = 1 <a href="/order?idProduct=1&quantity=2">/order?idProduct=1&quantity=2</a></p> -->
<!-- <p>Order 2 units of product with id = 1 <a href="/order?idProduct=1&quantity=2">/order?idProduct=1&quantity=2</a></p> -->
...
...
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