使用Golang快速开发web应用

 

1. 打开命令终端安装dolphin(一个集合Golang, web开发的工具)

go get -u github.com/2637309949/dolphin/cmd/dolphin

2. 初始化项目

mkdir hello && cd hello && dolphin init && dolphin build && go run main.go

生成doc会有点慢, 需要等一下

3. 打开hello/app.properties

db.dataSource=root:111111@/dolphin?charset=utf8&parseTime=True&loc=Local

修改数据库配置

4. 运行

[double@manjaro hello]$ go run main.go 
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /static/*filepath         --> github.com/2637309949/dolphin/packages/gin.(*RouterGroup).createStaticHandler.func1 (2 handlers)
[GIN-debug] HEAD   /static/*filepath         --> github.com/2637309949/dolphin/packages/gin.(*RouterGroup).createStaticHandler.func1 (2 handlers)
[GIN-debug] POST   /api/sys/app/fun/add      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/app/fun/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/app/fun/del      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/app/fun/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/app/fun/update   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/app/fun/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/app/fun/page     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/app/fun/tree     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/app/fun/get      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/area/add         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/area/batch_add   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/area/del         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/area/batch_del   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/area/update      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/area/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/area/page        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/area/get         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/attachment/add   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/attachment/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/attachment/upload --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/attachment/export --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] DELETE /api/sys/attachment/del   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/attachment/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/attachment/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/attachment/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/attachment/page  --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/attachment/get   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/cas/login        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] GET    /api/sys/cas/logout       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] POST   /api/sys/cas/affirm       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] GET    /api/sys/cas/authorize    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] POST   /api/sys/cas/token        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] GET    /api/sys/cas/url          --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] GET    /api/sys/cas/oauth2       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] GET    /api/sys/cas/refresh      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] GET    /api/sys/cas/check        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] GET    /api/sys/cas/profile      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/cas/qrcode       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] POST   /api/sys/client/add       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/client/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/client/del       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/client/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/client/update    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/client/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/client/page      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/client/get       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/comment/add      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/comment/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/comment/del      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/comment/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/comment/update   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/comment/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/comment/page     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/comment/get      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/data/permission/add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/data/permission/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/data/permission/del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/data/permission/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/data/permission/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/data/permission/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/data/permission/page --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/data/permission/get --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /debug/pprof/             --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/heap         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/goroutine    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/allocs       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/block        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/threadcreate --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/cmdline      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/profile      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/symbol       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] POST   /debug/pprof/symbol       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/trace        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /debug/pprof/mutex        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /api/sys/dingtalk/oauth2  --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] POST   /api/sys/domain/add       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/domain/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/domain/del       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/domain/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/domain/update    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/domain/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/domain/page      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/domain/get       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/menu/add         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/menu/batch_add   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/menu/del         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/menu/batch_del   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/menu/update      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/menu/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/menu/sidebar     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/menu/page        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/menu/tree        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/menu/get         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/notification/add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/notification/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/notification/del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/notification/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/notification/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/notification/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/notification/page --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/notification/get --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/optionset/add    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/optionset/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/optionset/del    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/optionset/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/optionset/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/optionset/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/optionset/page   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/optionset/get    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/org/add          --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/org/batch_add    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/org/del          --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/org/batch_del    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/org/update       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/org/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/org/page         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/org/tree         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/org/get          --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/permission/add   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/permission/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/permission/del   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/permission/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/permission/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/permission/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/permission/page  --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/permission/get   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/role/add         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/role/batch_add   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/role/del         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/role/batch_del   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/role/update      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/role/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/role/page        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/role/role_menu_tree --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/role/role_app_fun_tree --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/role/get         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/role/menu/add    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/role/menu/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/role/menu/del    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/role/menu/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/role/menu/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/role/menu/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/role/menu/page   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/role/menu/get    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/schedule/add     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/schedule/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/schedule/del     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/schedule/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/schedule/update  --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/schedule/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/schedule/page    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/schedule/get     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/schedule/history/page --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/scheduling/add   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/scheduling/del   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/scheduling/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/scheduling/page  --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/scheduling/get   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/setting/add      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/setting/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/setting/del      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/setting/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/setting/update   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/setting/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/setting/page     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/setting/get      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/table/add        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/table/batch_add  --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/table/del        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/table/batch_del  --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/table/update     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/table/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/table/page       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/table/get        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/table/column/add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/table/column/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/table/column/del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/table/column/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/table/column/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/table/column/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/table/column/page --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/table/column/get --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/tag/add          --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/tag/batch_add    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/tag/del          --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/tag/batch_del    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/tag/update       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/tag/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/tag/page         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/tag/get          --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/tag/group/add    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/tag/group/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/tag/group/del    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/tag/group/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/tag/group/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/tag/group/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/tag/group/page   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/tag/group/get    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/tracker/page     --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/tracker/get      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/user/add         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] POST   /api/sys/user/batch_add   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] DELETE /api/sys/user/del         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] DELETE /api/sys/user/batch_del   --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] PUT    /api/sys/user/update      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] PUT    /api/sys/user/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (7 handlers)
[GIN-debug] GET    /api/sys/user/page        --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/user/get         --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/user/login       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] GET    /api/sys/user/logout      --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/user/template/add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/user/template/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/user/template/del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/user/template/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/user/template/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/user/template/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/user/template/page --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/user/template/get --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/user/template/detail/add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] POST   /api/sys/user/template/detail/batch_add --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/user/template/detail/del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] DELETE /api/sys/user/template/detail/batch_del --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/user/template/detail/update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] PUT    /api/sys/user/template/detail/batch_update --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/user/template/detail/page --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/user/template/detail/get --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/wechat/oauth2    --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (5 handlers)
[GIN-debug] POST   /api/sys/worker/add       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
[GIN-debug] GET    /api/sys/worker/get       --> github.com/2637309949/dolphin/platform/app.(*Engine).HandlerFunc.func1 (6 handlers)
time="25/12 11:09:51" level=warning msg="Redis::@localhost:6379/0 connect failed"
time="25/12 11:09:51" level=info msg="mysql root:111111@/dolphin?charset=utf8&parseTime=True&loc=Local"
[xorm] [info]  2020/12/25 11:09:51.873466 PING DATABASE mysql
time="25/12 11:09:51" level=info msg="grpc listen on port:9081"
time="25/12 11:09:51" level=info msg="http listen on port:8081"

5.使用配置生成CRUD

hello/xml/controller/article.xml
<controller name="article" desc="Article controller">
    <api name="add" func="add" table="article" desc="Add article" method="post">
        <param name="article" type="$article" desc="Article info" />
        <return>
            <success type="$success"/>
            <failure type="$fail"/>
        </return>
    </api>
    <api name="batch_add" func="add" table="article" desc="Add article" method="post">
        <param name="article" type="[]$article" desc="Article info" />
        <return>
            <success type="$success"/>
            <failure type="$fail"/>
        </return>
    </api>
    <api name="del" func="delete" table="article" desc="Delete article" method="delete">
        <param name="article" type="$article" desc="article" />
        <return>
            <success type="$success"/>
            <failure type="$fail"/>
        </return>
    </api>
    <api name="batch_del" func="delete" table="article" desc="Delete article" method="delete">
        <param name="article" type="[]$article" desc="article" />
        <return>
            <success type="$success"/>
            <failure type="$fail"/>
        </return>
    </api>
    <api name="update" func="update" table="article" desc="Update article" method="put">
        <param name="article" type="$article" desc="Article info" />
        <return>
            <success type="$success"/>
            <failure type="$fail"/>
        </return>
    </api>
    <api name="batch_update" func="update" table="article" desc="Update article" method="put">
        <param name="article" type="[]$article" desc="Article info" />
        <return>
            <success type="$success"/>
            <failure type="$fail"/>
        </return>
    </api>
    <api name="page" func="page" table="article" desc="Article page query" method="get">
        <param name="page" type="int" desc="Page number" value="1"/>
        <param name="size" type="int" desc="Page size" value="15" />
        <return>
            <success type="$success"/>
            <failure type="$fail"/>
        </return>
    </api>
    <api name="get" desc="Get article info" func="one" table="article" method="get">
        <param name="id" type="string" desc="Article id" />
        <return>
            <success type="$success"/>
            <failure type="$fail"/>
        </return>
    </api>
</controller>
dolphin build

 

这样一个增删该查的功能就实现了, 更多详细的内容可以访问https://github.com/2637309949/dolphin

 


版权声明:本文为u013571243原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。