1
0
mirror of https://github.com/beego/bee.git synced 2025-06-11 03:10:40 +00:00

using beego to rerwite all commands

This commit is contained in:
Ming Deng
2020-11-05 23:52:08 +08:00
parent fa7aee4d01
commit f2a93c8c75
13 changed files with 161 additions and 45 deletions

View File

@ -76,7 +76,7 @@ var apiMaingo = `package main
import (
_ "{{.Appname}}/routers"
"github.com/astaxie/beego"
beego "github.com/astaxie/beego/server/web"
)
func main() {
@ -93,8 +93,8 @@ var apiMainconngo = `package main
import (
_ "{{.Appname}}/routers"
"github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
beego "github.com/astaxie/beego/server/web"
"github.com/astaxie/beego/client/orm"
{{.DriverPkg}}
)
@ -129,7 +129,7 @@ package routers
import (
"{{.Appname}}/controllers"
"github.com/astaxie/beego"
beego "github.com/astaxie/beego/server/web"
)
func init() {
@ -298,7 +298,7 @@ import (
"{{.Appname}}/models"
"encoding/json"
"github.com/astaxie/beego"
beego "github.com/astaxie/beego/server/web"
)
// Operations about object
@ -391,7 +391,7 @@ import (
"{{.Appname}}/models"
"encoding/json"
"github.com/astaxie/beego"
beego "github.com/astaxie/beego/server/web"
)
// Operations about Users
@ -516,7 +516,8 @@ import (
"path/filepath"
_ "{{.Appname}}/routers"
"github.com/astaxie/beego"
beego "github.com/astaxie/beego/server/web"
"github.com/astaxie/beego/core/logs"
. "github.com/smartystreets/goconvey/convey"
)
@ -532,7 +533,7 @@ func TestGet(t *testing.T) {
w := httptest.NewRecorder()
beego.BeeApp.Handlers.ServeHTTP(w, r)
beego.Trace("testing", "TestGet", "Code[%d]\n%s", w.Code, w.Body.String())
logs.Info("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() {