Check this out

Feature Based

├── com.app
    └── company
        ├── Company
        ├── CompanyController
        ├── CompanyRepository        
        └── CompanyService
    └── product
        ├── Product   
        ├── ProductController
        ├── ProductRepository
        └── ProductService
    └── util
    └── user
        ├── User   
        ├── UserController
        ├── UserRepository
        └── UserService
    |__ common
	    |- Middleware 
		    |- Exception
		    |- Logger
		    |- Response Handler
	└── core 
		├── base/
            ├── BaseService.java
            ├── BaseRepository.java
            └── BaseEntity.java
	    └── config/
	│       └── AppConfig.java

Layer Based

├── com.app
    └── controller
        ├── CompanyController
        ├── ProductController
        └── UserController
    └── model
        ├── Company   
        ├── Product
        └── User
    └── repository
        ├── CompanyRepository   
        ├── ProductRepository
        └── UserRepository
    └── service
        ├── CompanyService
        ├── ProductService
        └── UserService
    └── util