class DetectorController {

    @GetMapping(path = "/findByCreatedBy", produces = "application/json")
    @ResponseStatus(HttpStatus.OK)
    public List<Detector> findByCreatedBy(@RequestParam String user) {
        List<Detector> detectors = service.findByCreatedBy(user);
        if (detectors == null || detectors.isEmpty()) {
            throw new RecordNotFoundException("Invalid user: " + user);
        }

        return detectors;
    }

}