diff --git a/.gitignore b/.gitignore index e69de29bb..853248244 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,5 @@ +jx-callback +*.tmp +commentsRouter_* +swagger/ +debug diff --git a/conf/app.conf b/conf/app.conf index 0960f2b9c..88b94ef23 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -4,3 +4,4 @@ runmode = dev autorender = false copyrequestbody = true EnableDocs = true +RouterCaseSensitive = true diff --git a/controllers/object.go b/controllers/object.go index 0ae49811f..014ea0f5c 100644 --- a/controllers/object.go +++ b/controllers/object.go @@ -1,9 +1,10 @@ package controllers import ( - "jx-callback/models" "encoding/json" + "git.rosy.net.cn/jx-callback/models" + "github.com/astaxie/beego" ) @@ -89,4 +90,3 @@ func (o *ObjectController) Delete() { o.Data["json"] = "delete success!" o.ServeJSON() } - diff --git a/controllers/user.go b/controllers/user.go index 39ca42b15..b9d178c6e 100644 --- a/controllers/user.go +++ b/controllers/user.go @@ -1,9 +1,10 @@ package controllers import ( - "jx-callback/models" "encoding/json" + "git.rosy.net.cn/jx-callback/models" + "github.com/astaxie/beego" ) @@ -116,4 +117,3 @@ func (u *UserController) Logout() { u.Data["json"] = "logout success" u.ServeJSON() } - diff --git a/main.go b/main.go index 368cd12b2..712b5996c 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - _ "jx-callback/routers" + _ "git.rosy.net.cn/jx-callback/routers" "github.com/astaxie/beego" ) diff --git a/routers/router.go b/routers/router.go index d0859810c..392dafa3a 100644 --- a/routers/router.go +++ b/routers/router.go @@ -8,7 +8,7 @@ package routers import ( - "jx-callback/controllers" + "git.rosy.net.cn/jx-callback/controllers" "github.com/astaxie/beego" ) diff --git a/tests/default_test.go b/tests/default_test.go index fb2a996f6..8db665775 100644 --- a/tests/default_test.go +++ b/tests/default_test.go @@ -3,10 +3,11 @@ package test import ( "net/http" "net/http/httptest" - "testing" - "runtime" "path/filepath" - _ "jx-callback/routers" + "runtime" + "testing" + + _ "git.rosy.net.cn/jx-callback/routers" "github.com/astaxie/beego" . "github.com/smartystreets/goconvey/convey" @@ -14,7 +15,7 @@ import ( func init() { _, file, _, _ := runtime.Caller(1) - apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator)))) + apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator)))) beego.TestBeegoInit(apppath) } @@ -27,12 +28,11 @@ func TestGet(t *testing.T) { beego.Trace("testing", "TestGet", "Code[%d]\n%s", w.Code, w.Body.String()) Convey("Subject: Test Station Endpoint\n", t, func() { - Convey("Status Code Should Be 200", func() { - So(w.Code, ShouldEqual, 200) - }) - Convey("The Result Should Not Be Empty", func() { - So(w.Body.Len(), ShouldBeGreaterThan, 0) - }) + Convey("Status Code Should Be 200", func() { + So(w.Code, ShouldEqual, 200) + }) + Convey("The Result Should Not Be Empty", func() { + So(w.Body.Len(), ShouldBeGreaterThan, 0) + }) }) } -