remove debug , modify line route
This commit is contained in:
parent
386a24affb
commit
07436cd8df
3
main.go
3
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 {
|
||||
|
@ -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)
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user