What is the recommended project structure for spring boot rest projects?

前端 未结 9 1669
迷失自我
迷失自我 2020-12-07 09:29

I\'m a beginner with spring boot. I\'m involved in the beginning of a project where we would build rest services using spring boot. Could you please advise the recommended d

相关标签:
9条回答
  • 2020-12-07 10:06

    config - class which will read from property files

    cache - caching mechanism class files

    constants - constant defined class

    controller - controller class

    exception - exception class

    model - pojos classes will be present

    security - security classes

    service - Impl classes

    util - utility classes

    validation - validators classes

    bootloader - main class

    0 讨论(0)
  • 2020-12-07 10:06

    Use Link-1 to generate a project. this a basic project for learning. you can understand the folder structure. Use Link-2 for creating a basic Spring boot project. 1: http://start.spring.io/ 2: https://projects.spring.io/spring-boot/

    Create a gradle/maven project Automatically src/main/java and src/main/test will be created. create controller/service/Repository package and start writing the code.

    -src/main/java(source folder) ---com.package.service(package) ---ServiceClass(Class) ---com.package.controller(package) ---ControllerClass(Class)

    0 讨论(0)
  • 2020-12-07 10:08

    Please use Spring Tool Suite (Eclipse-based development environment that is customized for developing Spring applications).
    Create a Spring Starter Project, it will create the directory structure for you with the spring boot maven dependencies.

    0 讨论(0)
提交回复
热议问题