Skip to content

Commit

Permalink
Create method to search patients by name in service
Browse files Browse the repository at this point in the history
Relate to issue #4

Signed-off-by: Flavio Costa <[email protected]>
Signed-off-by: Antonio Carvalho <[email protected]>
Signed-off-by: Varley Silva <[email protected]>
  • Loading branch information
flaviocostap committed Apr 16, 2017
1 parent 7b47c20 commit 6b51bc2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/br/com/bovdog/service/PatientService.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import br.com.bovdog.bean.Owner;
import br.com.bovdog.bean.Patient;
import br.com.bovdog.dao.OwnerDAO;
import br.com.bovdog.dao.PatientDAO;

// create Patient service
Expand Down Expand Up @@ -67,6 +69,16 @@ public Patient getPatientById(@PathParam("id") int patientId) {

}

// create method to search patients by name
@POST
@Path("/findbyname")
@Consumes("application/x-www-form-urlencoded")
@Produces("application/json")
public List<Patient> findPatientByName(@FormParam(value = "insertedName") String insertedName){
PatientDAO dao = new PatientDAO();
return dao.findPatientByName(insertedName);
}

// create a method to update the information of an existing patient
@PUT
@Path("/{id:[0-9]+}")
Expand Down

0 comments on commit 6b51bc2

Please sign in to comment.