remove debug , modify line route

This commit is contained in:
Jay 2018-09-20 22:42:22 +08:00
parent 386a24affb
commit 07436cd8df
3 changed files with 1 additions and 4 deletions

View File

@ -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 {

View File

@ -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)

View File

@ -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))