Skip to content

Latest commit

 

History

History

README.md

web-gin-CRUD 中文说明


Import sql into mysql before you start.


Quickly create a web project

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.

web-http

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 run

Open http://localhost:8080/swagger/index.html in your browser to perform CRUD operations on the table.

web-http-swagger


Batch add CRUD code embedded in web service

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.

web-http-handler

Switch to the web directory and run the command:

# Generate swagger documentation
make docs

# Compile and start the web service
make run

Open 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