Import sql into mysql before you start.
Enter the Sponge UI interface, click on the left menu bar 【SQL】→【Create web project】, fill in some parameters to generate the complete project code for the web service.
The web service code is mainly composed of commonly used libraries such as gin, gorm, go-redis, and also includes swagger documentation, test code, common service governance function code, build deployment scripts, etc.
Switch to the web directory and run the command:
# Generate swagger documentation
make docs
# Compile and start the web service
make runOpen http://localhost:8080/swagger/index.html in your browser to perform CRUD operations on the table.
Enter the Sponge UI interface, click on the left menu bar 【Public】→【Generate handler CRUD code】, select any number of tables to generate code, then move the generated CRUD code to the web service directory to complete batch addition of CURD interfaces in the web service without changing any code.
Switch to the web directory and run the command:
# Generate swagger documentation
make docs
# Compile and start the web service
make runOpen http://localhost:8080/swagger/index.html in your browser to see the newly added CRUD interfaces.
More detailed development web documentation https://go-sponge.com/web-development-mysql


