diff --git a/src/main/java/ArchitectureTest/CompanyRest.java b/src/main/java/ArchitectureTest/CompanyRest.java index 995d2c5..bf0cac0 100644 --- a/src/main/java/ArchitectureTest/CompanyRest.java +++ b/src/main/java/ArchitectureTest/CompanyRest.java @@ -22,10 +22,16 @@ Companies.getInstance().getCompanies().put(name, new Company(address)); System.out.println(Companies.getInstance().getCompanies()); } - - @Path("/{company}") + + @Path("/{companyId}/address") + @GET + public void getAddress(@PathParam("companyId") String company) { + Companies.getInstance().getCompanies().get(company).getAddress(); + } + + @Path("/{companyId}/address") @PUT - public void updateAddress(@PathParam("company") String company, @FormParam("address")String address) { + public void updateAddress(@PathParam("companyId") String company, @FormParam("address") String address) { Companies.getInstance().getCompanies().get(company).setAddress(address); } }