Skip to content

Commit 4402d4f

Browse files
author
Reza Rahman
committed
Cleanup
1 parent ef4ac93 commit 4402d4f

3 files changed

Lines changed: 24 additions & 65 deletions

File tree

actionbazaar/pom.xml

Lines changed: 14 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@
4444
<version>2.5.1</version>
4545
<scope>compile</scope>
4646
</dependency>
47-
<dependency>
48-
<groupId>org.glassfish.jersey.containers</groupId>
49-
<artifactId>jersey-container-servlet-core</artifactId>
50-
<version>2.0</version>
51-
<type>jar</type>
52-
<scope>provided</scope>
53-
</dependency>
54-
<dependency>
55-
<groupId>org.glassfish.jersey.media</groupId>
56-
<artifactId>jersey-media-moxy</artifactId>
57-
<version>2.0</version>
58-
<type>jar</type>
59-
<scope>provided</scope>
60-
</dependency>
47+
<dependency>
48+
<groupId>org.glassfish.jersey.containers</groupId>
49+
<artifactId>jersey-container-servlet-core</artifactId>
50+
<version>2.0</version>
51+
<type>jar</type>
52+
<scope>provided</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.glassfish.jersey.media</groupId>
56+
<artifactId>jersey-media-moxy</artifactId>
57+
<version>2.0</version>
58+
<type>jar</type>
59+
<scope>provided</scope>
60+
</dependency>
6161
<dependency>
6262
<groupId>junit</groupId>
6363
<artifactId>junit</artifactId>
@@ -86,47 +86,6 @@
8686
<artifactId>jsfunit-arquillian</artifactId>
8787
<version>2.0.0.Beta3-SNAPSHOT</version>
8888
</dependency>
89-
<dependency>
90-
<groupId>httpunit</groupId>
91-
<artifactId>httpunit</artifactId>
92-
<version>1.7</version>
93-
<scope>test</scope>
94-
<exclusions>
95-
<exclusion>
96-
<groupId>javax.servlet</groupId>
97-
<artifactId>servlet-api</artifactId>
98-
</exclusion>
99-
<exclusion>
100-
<groupId>junit</groupId>
101-
<artifactId>junit</artifactId>
102-
</exclusion>
103-
<exclusion>
104-
<groupId>javax.mail</groupId>
105-
<artifactId>mail</artifactId>
106-
</exclusion>
107-
<exclusion>
108-
<groupId>jtidy</groupId>
109-
<artifactId>jtidy</artifactId>
110-
</exclusion>
111-
</exclusions>
112-
</dependency>
113-
<dependency>
114-
<groupId>rhino</groupId>
115-
<artifactId>js</artifactId>
116-
<version>1.7R2</version>
117-
<scope>test</scope>
118-
</dependency>
119-
<dependency>
120-
<groupId>nekohtml</groupId>
121-
<artifactId>nekohtml</artifactId>
122-
<version>0.9.5</version>
123-
<exclusions>
124-
<exclusion>
125-
<groupId>xerces</groupId>
126-
<artifactId>xercesImpl</artifactId>
127-
</exclusion>
128-
</exclusions>
129-
</dependency>
13089
</dependencies>
13190
<build>
13291
<finalName>actionbazaar</finalName>

actionbazaar/src/main/java/com/actionbazaar/interfaces/rest/BidRestService.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import javax.ws.rs.POST;
99
import javax.ws.rs.PUT;
1010
import javax.ws.rs.Path;
11+
import javax.ws.rs.PathParam;
1112
import javax.ws.rs.Produces;
12-
import javax.ws.rs.QueryParam;
1313

1414
import com.actionbazaar.application.BidService;
1515
import com.actionbazaar.domain.Bid;
@@ -23,25 +23,28 @@ public class BidRestService {
2323

2424
@POST
2525
@Consumes("application/json")
26-
public void addBid(Bid bid) {
27-
bidService.addBid(bid);
26+
@Produces("application/json")
27+
public Bid addBid(Bid bid) {
28+
return bidService.addBid(bid);
2829
}
2930

3031
@GET
32+
@Path("{id}")
3133
@Produces("application/json")
32-
33-
public Bid getBid(@QueryParam("id") Long id) {
34+
public Bid getBid(@PathParam("id") Long id) {
3435
return bidService.getBid(id);
3536
}
3637

3738
@PUT
39+
@Path("{id}")
3840
@Consumes("application/json")
39-
public void updateBid(@QueryParam("id") Long id, Bid bid) {
41+
public void updateBid(@PathParam("id") Long id, Bid bid) {
4042
bidService.updateBid(bid);
4143
}
4244

4345
@DELETE
44-
public void deleteBid(@QueryParam("id") Long id) {
46+
@Path("{id}")
47+
public void deleteBid(@PathParam("id") Long id) {
4548
Bid bid = bidService.getBid(id);
4649
bidService.deleteBid(bid);
4750
}

actionbazaar/src/main/java/com/actionbazaar/interfaces/rest/RestConfiguration.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import org.glassfish.jersey.moxy.json.MoxyJsonFeature;
66
import org.glassfish.jersey.server.ResourceConfig;
7-
import org.glassfish.jersey.server.ServerProperties;
87

98
/**
109
* JAX-RS configuration.
@@ -15,8 +14,6 @@ public class RestConfiguration extends ResourceConfig {
1514
public RestConfiguration() {
1615
// Resources
1716
packages(new String[] { BidRestService.class.getPackage().getName() });
18-
// Enable Bean Validation error messages.
19-
property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
2017
// Providers - JSON.
2118
register(new MoxyJsonFeature());
2219
register(new JsonMoxyConfigurationContextResolver()); // TODO See if

0 commit comments

Comments
 (0)