@@ -0,0 +1,1500 @@
+package bg.car_wash.areas.car.controller;%0A%0Aimport bg.car_wash.areas.car.entity.Car;%0Aimport bg.car_wash.areas.car.models.viewModel.CarViewModel;%0Aimport bg.car_wash.areas.car.service.CarService;%0Aimport bg.car_wash.areas.customer.service.CustomerService;%0Aimport org.modelmapper.ModelMapper;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.http.ResponseEntity;%0Aimport org.springframework.web.bind.annotation.*;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0A@RestController%0A@RequestMapping(%22/json/car%22)%0Apublic class CarJsonController %7B%0A%0A%09private CarService carService;%0A%09private CustomerService customerService;%0A%09private ModelMapper modelMapper;%0A%0A%09@Autowired%0A%09public CarJsonController(CarService carService, CustomerService customerService, ModelMapper modelMapper) %7B%0A%09%09this.carService = carService;%0A%09%09this.customerService = customerService;%0A%09%09this.modelMapper = modelMapper;%0A%09%7D%0A%0A%09@GetMapping(%22/all%22)%0A%09@ResponseBody%0A%09public ResponseEntity%3CList%3CCarViewModel%3E%3E getAllCars() %7B%0A%09%09List%3CCarViewModel%3E carViewModels = new LinkedList%3C%3E();%0A%09%09List%3CCar%3E cars = this.carService.findAllCars();%0A%09%09for (Car car : cars) %7B%0A%09%09%09carViewModels.add(this.modelMapper.map(car, CarViewModel.class));%0A%09%09%7D%0A%0A%09%09if(carViewModels.isEmpty()) %7B%0A%09%09%09return new ResponseEntity(HttpStatus.NOT_FOUND);%0A%09%09%7D%0A%0A%09%09ResponseEntity%3CList%3CCarViewModel%3E%3E responseEntityCar = new ResponseEntity%3C%3E(carViewModels, HttpStatus.OK);%0A%09%09return responseEntityCar;%0A%09%7D%0A%0A%7D%0A

create car Json controller