@@ -0,0 +1,2075 @@
+package com.instinctools.padlaboris.controller;%0A%0Aimport com.instinctools.padlaboris.dto.PatientDto;%0Aimport com.instinctools.padlaboris.model.Patient;%0Aimport com.instinctools.padlaboris.service.PatientService;%0Aimport lombok.RequiredArgsConstructor;%0Aimport org.dozer.DozerBeanMapper;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.http.ResponseEntity;%0Aimport org.springframework.web.bind.annotation.*;%0A%0A@RestController%0A@RequiredArgsConstructor(onConstructor = @__(@Autowired))%0Apublic class PatientController %7B%0A%0A    private final PatientService patientService;%0A%0A    private final DozerBeanMapper dozerBeanMapper;%0A%0A    @RequestMapping(value = %22/patients%22, method = RequestMethod.POST)%0A    public ResponseEntity createPatient(@RequestBody PatientDto patientDto) %7B%0A        final Patient patient = dozerBeanMapper.map(patientDto, Patient.class);%0A%0A        return ResponseEntity.ok().body(patientService.create(patient));%0A    %7D%0A%0A    @RequestMapping(value = %22/patients/%7Bid%7D%22, method = RequestMethod.PUT)%0A    public ResponseEntity updatePatient(@RequestBody PatientDto patientDto, @PathVariable(%22id%22) Integer id) %7B%0A%0A%0A        final Patient patient = dozerBeanMapper.map(patientDto, Patient.class);%0A        patient.setId(patientService.read(id).getId());%0A%0A        return ResponseEntity.ok().body(patientService.update(patient));%0A%0A    %7D%0A%0A    @RequestMapping(value = %22/patients/%7Bid%7D%22, method = RequestMethod.GET)%0A    public ResponseEntity fetchPatient(@PathVariable(%22id%22) Integer id) %7B%0A        return ResponseEntity.ok().body(patientService.read(id));%0A    %7D%0A%0A    @RequestMapping(value = %22/patients/%7Bid%7D%22, method = RequestMethod.DELETE)%0A    public ResponseEntity deletePatient(@PathVariable(%22id%22) Integer id) %7B%0A        final Patient patient = patientService.read(id);%0A        patientService.delete(id);%0A        return ResponseEntity.ok().body(patient);%0A    %7D%0A%0A    @RequestMapping(value = %22/patients%22, method = RequestMethod.GET)%0A    public ResponseEntity fetchAll() %7B%0A        return ResponseEntity.ok().body(patientService.listPatients());%0A    %7D%0A%7D%0A

add PatientController