Skip to content

Commit

Permalink
Updated controller code examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin Raverkar committed Oct 25, 2023
1 parent 20a980d commit 9d51cfa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

@RestController
@RequestMapping("/departments")
public class DepartmentController {
Expand All @@ -18,7 +16,7 @@ public class DepartmentController {
@Qualifier(value = "core")
private Department core;

@GetMapping(value = "{id}", produces = APPLICATION_JSON_VALUE)
@GetMapping(value = "{id}")
public Department getDepartmentById(@PathVariable("id") final Long id) {
return core;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

@RestController
@RequestMapping("/employees")
public class EmployeeController {
Expand All @@ -18,7 +16,7 @@ public class EmployeeController {
@Qualifier(value = "founder")
private Employee founder;

@GetMapping(value = "{id}", produces = APPLICATION_JSON_VALUE)
@GetMapping(value = "{id}")
public Employee getEmployeeById(@PathVariable("id") final Long id) {
return founder;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

@RestController
@RequestMapping("/organizations")
public class OrganizationController {
Expand All @@ -18,7 +16,7 @@ public class OrganizationController {
@Qualifier(value = "acme")
private Organization acme;

@GetMapping(value = "{id}", produces = APPLICATION_JSON_VALUE)
@GetMapping(value = "{id}")
public Organization getOrganizationById(@PathVariable("id") final Long id) {
return acme;
}
Expand Down

0 comments on commit 9d51cfa

Please sign in to comment.