Swagger
Controller Code
Service Code
All generic classes are under generic folder Product api example classes are under product folder
- Create an Entity (like Product) extends GenericEntity
- Create a DTO (like ProductDTO) extends GenericDTO
- Create a Mapper (like IProductMapper) extends IBaseMapper<YourEntity, YourDTO>
- Add below methods to mapper:
- YourEntity mapToEntity(YourDTO dto);
- YourDTO mapToDTO(YourEntity yourEntity);
- Create a Repository interface (like IProductRepository) extends IGenericRepository<YourEntity,Long>
- Create a Service interface (like IProductService) extends IGenericService<YourEntity, Long, YourDTO>
- Create a Service class (like ProductService) extends GenericService<YourEntity, Long, YourDTO, YourRepositoryInterface, YourMapper> implements YourInterface (like IProductService)
- Create a Controller class (like ProductController) extends GenericController<YourEntity, Long, YourDTO, YourServiceInterface>