npm install venus-init
Just type the code below and follow the notice until finish the initialization.
venus init
Or you can type like this.
venus i
You need to copy all the files in the project that createad by cli into another project
Below is the structure of a demo project that created by the cli.
.
βββ LICENSE
βββ README.md
βββ api
βΒ Β βββ pom.xml
βΒ Β βββ src
βΒ Β βββ main
βΒ Β βββ java
βΒ Β βΒ Β βββ com
βΒ Β βΒ Β βββ detectivehlh
βΒ Β βΒ Β βββ demo
βΒ Β βΒ Β βββ api
βΒ Β βΒ Β βββ Application.java
βΒ Β βΒ Β βββ config
βΒ Β βΒ Β βΒ Β βββ DbConfig.java
βΒ Β βΒ Β βΒ Β βββ SwaggerConfig.java
βΒ Β βΒ Β βββ controller
βΒ Β βΒ Β βΒ Β βββ HelloController.java
βΒ Β βΒ Β βββ dao
βΒ Β βΒ Β βΒ Β βββ HelloMapper.java
βΒ Β βΒ Β βββ dto
βΒ Β βΒ Β βΒ Β βββ HelloDTO.java
βΒ Β βΒ Β βββ entity
βΒ Β βΒ Β βΒ Β βββ Hello.java
βΒ Β βΒ Β βββ service
βΒ Β βΒ Β βββ HelloService.java
βΒ Β βΒ Β βββ impl
βΒ Β βΒ Β βββ HelloServiceImpl.java
βΒ Β βββ resources
βΒ Β βββ application.yml
βΒ Β βββ mapper
βΒ Β βββ HelloMapper.xml
βββ pom.xml
Inside the project, we have a unit named Hello to help you understand this project more efficiently
when you start the project successfully. Visit http://localhost:8080/helloοΌwhen you see the message below, congratulations! It worked.
{
"message": "Hello world",
"createdAt": "current_timestamp"
}
You can visit http://localhost:8080/swagger-ui.html to see your api documentation that generate automatically by swagger.