初步搭建02

This commit is contained in:
des
2026-01-13 13:02:27 +08:00
parent 0c68d57180
commit a289a90676
3 changed files with 45 additions and 19 deletions

View File

@@ -1,7 +1,6 @@
package main
import (
"fmt"
"net/http"
"github.com/labstack/echo"
@@ -10,15 +9,8 @@ import (
)
func main() {
client := common.GetDataBaseClient()
config, ero := client.DB()
if ero != nil {
fmt.Println("获取连接池失败")
panic(ero)
}
defer config.Close()
client, close := common.GetDataBaseClient()
defer close()
app := echo.New()
app.GET("/", func(ctx echo.Context) error {
return ctx.String(http.StatusOK, "Hello, World!")