Package dev.akif.crud.simpler
Class SimplerController<I extends Serializable,E extends SimplerEntity<I,E>,M extends SimplerModel<I,E,M>,R extends SimplerRepository<I,E>,S extends SimplerService<I,E,M,R>>
java.lang.Object
dev.akif.crud.CRUDController<I,E,M,M,M,M,M,M,R,S>
dev.akif.crud.simpler.SimplerController<I,E,M,R,S>
- Type Parameters:
I
- Id type of the dataE
- Entity type of the data which is aSimplerEntity
M
- Model type of the data which is aSimplerModel
R
- Repository type of the data which is aSimplerRepository
S
- Service type of the data which is aSimplerService
public abstract class SimplerController<I extends Serializable,E extends SimplerEntity<I,E>,M extends SimplerModel<I,E,M>,R extends SimplerRepository<I,E>,S extends SimplerService<I,E,M,R>>
extends CRUDController<I,E,M,M,M,M,M,M,R,S>
Simpler variant of
CRUDController
where create/update models and DTOs are just models
This is meant to be extended from a @RestController
class,
ideally also with a @RequestMapping
with some path prefix for the endpoints.
-
Field Summary
Fields inherited from class dev.akif.crud.CRUDController
service, type
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SimplerController
(String type, S service) Constructor to provide type name and dependencies to this controller -
Method Summary
-
Constructor Details
-
SimplerController
Constructor to provide type name and dependencies to this controller- Parameters:
type
- Type name of the data this controller managesservice
- Service dependency of this controller
-
-
Method Details
-
toDTO
Description copied from class:CRUDController
Mapper to convert from model to DTO- Specified by:
toDTO
in classCRUDController<I extends Serializable,
E extends SimplerEntity<I, E>, M extends SimplerModel<I, E, M>, M extends SimplerModel<I, E, M>, M extends SimplerModel<I, E, M>, M extends SimplerModel<I, E, M>, M extends SimplerModel<I, E, M>, M extends SimplerModel<I, E, M>, R extends SimplerRepository<I, E>, S extends SimplerService<I, E, M, R>> - Parameters:
model
- Model to convert- Returns:
- DTO built from given model
-