- first runnable ver.

This commit is contained in:
gazebo
2018-05-31 11:08:57 +08:00
parent e59373b033
commit 8d1c22229b
7 changed files with 23 additions and 17 deletions

5
.gitignore vendored
View File

@@ -0,0 +1,5 @@
jx-callback
*.tmp
commentsRouter_*
swagger/
debug

View File

@@ -4,3 +4,4 @@ runmode = dev
autorender = false
copyrequestbody = true
EnableDocs = true
RouterCaseSensitive = true

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
package main
import (
_ "jx-callback/routers"
_ "git.rosy.net.cn/jx-callback/routers"
"github.com/astaxie/beego"
)

View File

@@ -8,7 +8,7 @@
package routers
import (
"jx-callback/controllers"
"git.rosy.net.cn/jx-callback/controllers"
"github.com/astaxie/beego"
)

View File

@@ -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)
}
@@ -35,4 +36,3 @@ func TestGet(t *testing.T) {
})
})
}