package com.jmb.springfactory.controller;

import java.io.Serializable;
import java.util.List;

import javax.validation.Valid;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.jmb.springfactory.exceptions.NotFoundException;
import com.jmb.springfactory.exceptions.ServiceLayerException;
import com.jmb.springfactory.model.dto.BaseDto;
import com.jmb.springfactory.service.GenericService;

public abstract class GenericControllerImpl<D extends BaseDto, I extends Serializable> extends BaseController
    implements GenericController<D, I> {
  
  public abstract GenericService<D, I> genericService();

  @Override
  @PostMapping
  public D create(@Valid @RequestBody D dto) throws ServiceLayerException {
    return genericService().save(dto);
  }

  @Override
  @PutMapping("/{id}")
  public void update(@Valid @RequestBody D dto, @PathVariable("id") I id) throws ServiceLayerException {
    genericService().update(dto, id);
  }

  @Override
  @DeleteMapping("/{id}")
  public void delete(@PathVariable("id") I id) {
    genericService().delete(id);
  }

  @Override
  @GetMapping
  public List<D> findAll() {
    return genericService().findAll();
  }

  @Override
  @GetMapping("/{id}")
  public D findOne(@PathVariable("id") I id) throws NotFoundException {
    return genericService().findOne(id);
  }

}

@@ -750,12 +750,8 @@
 ller
-Impl
 %3CD e
@@ -789,16 +789,18 @@
 lizable%3E
+%0A 
  extends
@@ -818,47 +818,8 @@
 ller
-%0A    implements GenericController%3CD, I%3E
  %7B%0A 
@@ -878,28 +878,16 @@
 ice();%0A%0A
-  @Override%0A
   @PostM
@@ -1013,28 +1013,16 @@
 );%0A  %7D%0A%0A
-  @Override%0A
   @PutMa
@@ -1184,28 +1184,16 @@
 );%0A  %7D%0A%0A
-  @Override%0A
   @Delet
@@ -1293,36 +1293,24 @@
 e(id);%0A  %7D%0A%0A
-  @Override%0A
   @GetMappin
@@ -1388,20 +1388,8 @@
  %7D%0A%0A
-  @Override%0A
   @G

Delete the generic controller interface, it's not necesary. We can use the genericController class directly if it is necesary