Change method name
This commit is contained in:
@@ -25,12 +25,12 @@ public class MeterController {
|
|||||||
private MeterRepository meterRepository;
|
private MeterRepository meterRepository;
|
||||||
|
|
||||||
@RequestMapping(value = "/meters", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "/meters", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public List<Meter> getAllEmployees() {
|
public List<Meter> getAllMeters() {
|
||||||
return meterRepository.findAll();
|
return meterRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/meters/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "/meters/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<Meter> getEmployeeById(@PathVariable(value = "id") long meterId)
|
public ResponseEntity<Meter> getMeterById(@PathVariable(value = "id") long meterId)
|
||||||
throws ResourceNotFoundException {
|
throws ResourceNotFoundException {
|
||||||
Meter meter = meterRepository.findById(meterId)
|
Meter meter = meterRepository.findById(meterId)
|
||||||
.orElseThrow(() -> new ResourceNotFoundException("Meter not found for this id :: " + meterId));
|
.orElseThrow(() -> new ResourceNotFoundException("Meter not found for this id :: " + meterId));
|
||||||
|
|||||||
Reference in New Issue
Block a user