Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20230403
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
20230403
Commits
df748dc0
Commit
df748dc0
authored
May 24, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adnotacje J-WS
parent
a678e048
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
Sklep.java
PC31-SoapSerwer/src/main/java/sklep/soap/Sklep.java
+14
-6
No files found.
PC31-SoapSerwer/src/main/java/sklep/soap/Sklep.java
View file @
df748dc0
...
...
@@ -3,6 +3,8 @@ package sklep.soap;
import
java.math.BigDecimal
;
import
java.util.List
;
import
jakarta.jws.WebParam
;
import
jakarta.jws.WebResult
;
import
jakarta.jws.WebService
;
import
sklep.db.CustomerDAO
;
import
sklep.db.DBConnection
;
...
...
@@ -16,7 +18,7 @@ import sklep.model.Product;
@WebService
public
class
Sklep
{
@WebResult
(
name
=
"product"
)
public
List
<
Product
>
wszystkieProdukty
()
throws
DBException
{
try
(
DBConnection
db
=
DBConnection
.
open
())
{
ProductDAO
productDAO
=
db
.
productDAO
();
...
...
@@ -24,21 +26,25 @@ public class Sklep {
}
}
public
Product
produktWgId
(
int
productId
)
throws
DBException
,
RecordNotFound
{
@WebResult
(
name
=
"product"
)
public
Product
produktWgId
(
@WebParam
(
name
=
"id"
)
int
productId
)
throws
DBException
,
RecordNotFound
{
try
(
DBConnection
db
=
DBConnection
.
open
())
{
ProductDAO
productDAO
=
db
.
productDAO
();
return
productDAO
.
findById
(
productId
);
}
}
public
List
<
Product
>
produktyWgCen
(
BigDecimal
minPrice
,
BigDecimal
maxPrice
)
throws
DBException
{
@WebResult
(
name
=
"product"
)
public
List
<
Product
>
produktyWgCen
(
@WebParam
(
name
=
"min"
)
BigDecimal
minPrice
,
@WebParam
(
name
=
"max"
)
BigDecimal
maxPrice
)
throws
DBException
{
try
(
DBConnection
db
=
DBConnection
.
open
())
{
ProductDAO
productDAO
=
db
.
productDAO
();
return
productDAO
.
findByPrice
(
minPrice
,
maxPrice
);
}
}
public
void
zapiszProdukt
(
Product
product
)
throws
DBException
{
public
void
zapiszProdukt
(
@WebParam
(
name
=
"product"
)
Product
product
)
throws
DBException
{
try
(
DBConnection
db
=
DBConnection
.
open
())
{
ProductDAO
productDAO
=
db
.
productDAO
();
productDAO
.
save
(
product
);
...
...
@@ -46,14 +52,16 @@ public class Sklep {
}
}
public
Order
zamowienieWgId
(
int
orderId
)
throws
DBException
,
RecordNotFound
{
@WebResult
(
name
=
"order"
)
public
Order
zamowienieWgId
(
@WebParam
(
name
=
"id"
)
int
orderId
)
throws
DBException
,
RecordNotFound
{
try
(
DBConnection
db
=
DBConnection
.
open
())
{
OrderDAO
orderDAO
=
db
.
orderDAO
();
return
orderDAO
.
findById
(
orderId
);
}
}
public
Customer
klient
(
String
email
)
throws
DBException
,
RecordNotFound
{
@WebResult
(
name
=
"customer"
)
public
Customer
klient
(
@WebParam
(
name
=
"email"
)
String
email
)
throws
DBException
,
RecordNotFound
{
try
(
DBConnection
db
=
DBConnection
.
open
())
{
CustomerDAO
customerDAO
=
db
.
customerDAO
();
return
customerDAO
.
findByEmail
(
email
);
...
...
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