From 794140c51e6bc4d32fe6e508f1781232a22240ca Mon Sep 17 00:00:00 2001 From: mayiming <1627832236@qq.com> Date: Sun, 10 Aug 2025 02:10:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=BF=94=E5=9B=9Ecode?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index c048119..6fae451 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,24 @@ package main -import "fmt" +import ( + "strconv" + "toutoukan/config" + "toutoukan/init/databaseInit" + "toutoukan/init/redisInit" + "toutoukan/router" +) func main() { - fmt.Println("hello world") + databaseInit.DbInit() + redisInit.RedisInit() + if err := config.Goinit(); err != nil { + panic(err) + } + r := router.SetupRouter() + err := r.Run(":" + strconv.Itoa(config.Conf.Port)) + if err != nil { + return + } + defer databaseInit.UserDB.Close() + defer redisInit.RedisClient.Close() }