diff --git a/main.go b/main.go index cc600d8..d9f13c4 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,6 @@ import ( "encoding/gob" "errors" "flag" - "fmt" "log" "os" "path" @@ -43,8 +42,6 @@ func main() { log.Fatal(err) } - fmt.Println("load config ::::", config.GetConf()) - // connect to database db, err := model.NewDB() if err != nil { diff --git a/model/model.go b/model/model.go index b811d0e..ca20d80 100644 --- a/model/model.go +++ b/model/model.go @@ -20,7 +20,6 @@ func NewDB() (*sqlx.DB, error) { userPassStr += ":" + conf.Database.Pass } connStr := fmt.Sprintf("postgres://%s@%s/%s?sslmode=disable", userPassStr, conf.Database.Host, conf.Database.DB) - // connStr := fmt.Sprintf("user=%s password=%s host=%s sslmode=disable dbname=%s port=%d", conf.Database.User, conf.Database.Pass, conf.Database.Host, conf.Database.DB, conf.Database.Port) x, err = sqlx.Connect("postgres", connStr) if err != nil { log.Fatal(err) diff --git a/router/routes/routes.go b/router/routes/routes.go index f38bf72..e13b249 100644 --- a/router/routes/routes.go +++ b/router/routes/routes.go @@ -76,6 +76,7 @@ func SetRoutes(r *gin.Engine) { } + r.POST("/line", context.PatchCtx(line.GetRawBody), context.PatchCtx(line.VerifyLine), context.PatchCtx(line.GetLineMessage)) lineApis := r.Group("/line") { lineApis.POST("/", context.PatchCtx(line.GetRawBody), context.PatchCtx(line.VerifyLine), context.PatchCtx(line.GetLineMessage))