diff --git a/app/controllers/agent.go b/app/controllers/agent.go index 3778802..89123b4 100644 --- a/app/controllers/agent.go +++ b/app/controllers/agent.go @@ -1,13 +1,13 @@ package controllers import ( + "../entity" + "../libs" + "../service" "errors" "fmt" "github.com/astaxie/beego" "github.com/astaxie/beego/validation" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" - "github.com/lisijie/gopub/app/service" "strconv" ) diff --git a/app/controllers/base.go b/app/controllers/base.go index 4538e67..866698f 100644 --- a/app/controllers/base.go +++ b/app/controllers/base.go @@ -1,10 +1,11 @@ package controllers import ( + "../service" "encoding/json" "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" "github.com/beego/i18n" - "github.com/lisijie/gopub/app/service" "io/ioutil" "strings" ) @@ -185,7 +186,7 @@ func (this *BaseController) jsonResult(out interface{}) { // 错误检查 func (this *BaseController) checkError(err error) { - if err != nil { + if err != nil && err != orm.ErrNoRows { this.showMsg(err.Error(), MSG_ERR) } } diff --git a/app/controllers/env.go b/app/controllers/env.go index 1a6e63a..a9c2d01 100644 --- a/app/controllers/env.go +++ b/app/controllers/env.go @@ -3,8 +3,8 @@ package controllers import ( "encoding/json" "github.com/astaxie/beego" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/service" + "../entity" + "../service" "strconv" ) diff --git a/app/controllers/mailtpl.go b/app/controllers/mailtpl.go index 8410378..8d31760 100644 --- a/app/controllers/mailtpl.go +++ b/app/controllers/mailtpl.go @@ -2,8 +2,8 @@ package controllers import ( "github.com/astaxie/beego" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/service" + "../entity" + "../service" ) type MailTplController struct { diff --git a/app/controllers/main.go b/app/controllers/main.go index 7f43dc9..be175ab 100644 --- a/app/controllers/main.go +++ b/app/controllers/main.go @@ -3,7 +3,7 @@ package controllers import ( "fmt" "github.com/astaxie/beego" - "github.com/lisijie/gopub/app/service" + "../service" "os" "runtime" "time" diff --git a/app/controllers/project.go b/app/controllers/project.go index eeb611f..8aa0f79 100644 --- a/app/controllers/project.go +++ b/app/controllers/project.go @@ -3,9 +3,9 @@ package controllers import ( "fmt" "github.com/astaxie/beego" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" - "github.com/lisijie/gopub/app/service" + "../entity" + "../libs" + "../service" "strconv" "strings" ) diff --git a/app/controllers/review.go b/app/controllers/review.go index 7ca4fa3..2cb9573 100644 --- a/app/controllers/review.go +++ b/app/controllers/review.go @@ -2,9 +2,9 @@ package controllers import ( "github.com/astaxie/beego" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" - "github.com/lisijie/gopub/app/service" + "../entity" + "../libs" + "../service" ) type ReviewController struct { diff --git a/app/controllers/role.go b/app/controllers/role.go index 4afdbc2..a8c037b 100644 --- a/app/controllers/role.go +++ b/app/controllers/role.go @@ -2,8 +2,8 @@ package controllers import ( "github.com/astaxie/beego" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/service" + "../entity" + "../service" "strings" ) diff --git a/app/controllers/server.go b/app/controllers/server.go index 3a0cb9b..c491868 100644 --- a/app/controllers/server.go +++ b/app/controllers/server.go @@ -2,10 +2,11 @@ package controllers import ( "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" "github.com/astaxie/beego/validation" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" - "github.com/lisijie/gopub/app/service" + "../entity" + "../libs" + "../service" "strconv" ) @@ -20,9 +21,13 @@ func (this *ServerController) List() { page = 1 } count, err := service.ServerService.GetTotal(service.SERVER_TYPE_NORMAL) - this.checkError(err) + if err != orm.ErrNoRows { + this.checkError(err) + } serverList, err := service.ServerService.GetServerList(page, this.pageSize) - this.checkError(err) + if err != orm.ErrNoRows { + this.checkError(err) + } this.Data["count"] = count this.Data["list"] = serverList diff --git a/app/controllers/task.go b/app/controllers/task.go index 32186d7..bfbd1bf 100644 --- a/app/controllers/task.go +++ b/app/controllers/task.go @@ -3,9 +3,9 @@ package controllers import ( "fmt" "github.com/astaxie/beego" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" - "github.com/lisijie/gopub/app/service" + "../entity" + "../libs" + "../service" ) type TaskController struct { diff --git a/app/controllers/user.go b/app/controllers/user.go index 9d02441..f861aec 100644 --- a/app/controllers/user.go +++ b/app/controllers/user.go @@ -6,8 +6,8 @@ import ( "fmt" "github.com/astaxie/beego" "github.com/astaxie/beego/validation" - "github.com/lisijie/gopub/app/libs" - "github.com/lisijie/gopub/app/service" + "../libs" + "../service" "regexp" "strconv" ) diff --git a/app/mail/mail.go b/app/mail/mail.go index 0d86646..fd89ef4 100644 --- a/app/mail/mail.go +++ b/app/mail/mail.go @@ -1,9 +1,9 @@ package mail import ( + "../libs" "github.com/astaxie/beego" - "github.com/lisijie/gomail" - "github.com/lisijie/gopub/app/libs" + "gopkg.in/gomail.v2" "strings" ) diff --git a/app/service/action.go b/app/service/action.go index 03d0a56..cb7ff67 100644 --- a/app/service/action.go +++ b/app/service/action.go @@ -2,7 +2,7 @@ package service import ( "fmt" - "github.com/lisijie/gopub/app/entity" + "../entity" ) // 系统动态 diff --git a/app/service/auth.go b/app/service/auth.go index 90d7205..42e6a8c 100644 --- a/app/service/auth.go +++ b/app/service/auth.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/astaxie/beego" "github.com/astaxie/beego/orm" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" + "../entity" + "../libs" "strconv" "strings" "time" diff --git a/app/service/deploy.go b/app/service/deploy.go index d9872d6..b1ad6b1 100644 --- a/app/service/deploy.go +++ b/app/service/deploy.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/astaxie/beego" "github.com/astaxie/beego/utils" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" - "github.com/lisijie/gopub/app/mail" + "../entity" + "../libs" + "../mail" "html" "os" "path/filepath" diff --git a/app/service/deploy_job.go b/app/service/deploy_job.go index 836ff41..5d6b9b2 100644 --- a/app/service/deploy_job.go +++ b/app/service/deploy_job.go @@ -3,8 +3,8 @@ package service import ( "fmt" "github.com/astaxie/beego" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" + "../entity" + "../libs" "os" "path/filepath" "strings" diff --git a/app/service/env.go b/app/service/env.go index 56bf4e3..827d8a0 100644 --- a/app/service/env.go +++ b/app/service/env.go @@ -2,7 +2,7 @@ package service import ( "github.com/astaxie/beego/orm" - "github.com/lisijie/gopub/app/entity" + "../entity" ) type envService struct{} diff --git a/app/service/init.go b/app/service/init.go index c0ba6ef..da2af3b 100644 --- a/app/service/init.go +++ b/app/service/init.go @@ -5,7 +5,7 @@ import ( "github.com/astaxie/beego" "github.com/astaxie/beego/orm" _ "github.com/go-sql-driver/mysql" - "github.com/lisijie/gopub/app/entity" + "../entity" "net/url" "os" ) diff --git a/app/service/mail.go b/app/service/mail.go index 7fe2abb..9865393 100644 --- a/app/service/mail.go +++ b/app/service/mail.go @@ -1,7 +1,7 @@ package service import ( - "github.com/lisijie/gopub/app/entity" + "../entity" ) type mailService struct{} diff --git a/app/service/project.go b/app/service/project.go index e3fe9c3..f93f8b5 100644 --- a/app/service/project.go +++ b/app/service/project.go @@ -1,7 +1,7 @@ package service import ( - "github.com/lisijie/gopub/app/entity" + "../entity" "os" ) diff --git a/app/service/repository.go b/app/service/repository.go index 45bea54..33d49c1 100644 --- a/app/service/repository.go +++ b/app/service/repository.go @@ -2,7 +2,7 @@ package service import ( "errors" - "github.com/lisijie/gopub/app/libs" + "../libs" "path/filepath" "sort" "strconv" diff --git a/app/service/role.go b/app/service/role.go index 09d1c87..9bae60b 100644 --- a/app/service/role.go +++ b/app/service/role.go @@ -2,7 +2,7 @@ package service import ( "errors" - "github.com/lisijie/gopub/app/entity" + "../entity" ) type roleService struct{} diff --git a/app/service/server.go b/app/service/server.go index d2f8288..01ae2bc 100644 --- a/app/service/server.go +++ b/app/service/server.go @@ -2,7 +2,7 @@ package service import ( "errors" - "github.com/lisijie/gopub/app/entity" + "../entity" ) const ( diff --git a/app/service/system.go b/app/service/system.go index ef78de4..07da730 100644 --- a/app/service/system.go +++ b/app/service/system.go @@ -1,7 +1,7 @@ package service import ( - "github.com/lisijie/gopub/app/entity" + "../entity" ) type systemService struct{} diff --git a/app/service/task.go b/app/service/task.go index 7666ee2..446a4cf 100644 --- a/app/service/task.go +++ b/app/service/task.go @@ -3,7 +3,7 @@ package service import ( "fmt" "github.com/astaxie/beego/orm" - "github.com/lisijie/gopub/app/entity" + "../entity" "os" "strconv" "time" diff --git a/app/service/user.go b/app/service/user.go index 20cdc48..7d3becb 100644 --- a/app/service/user.go +++ b/app/service/user.go @@ -3,8 +3,8 @@ package service import ( "errors" "github.com/astaxie/beego/utils" - "github.com/lisijie/gopub/app/entity" - "github.com/lisijie/gopub/app/libs" + "../entity" + "../libs" ) type userService struct{} diff --git a/main.go b/main.go index 60bbdd8..ec1dbeb 100644 --- a/main.go +++ b/main.go @@ -1,12 +1,12 @@ package main import ( + "./app/controllers" + _ "./app/mail" + "./app/service" "fmt" "github.com/astaxie/beego" "github.com/beego/i18n" - "github.com/lisijie/gopub/app/controllers" - _ "github.com/lisijie/gopub/app/mail" - "github.com/lisijie/gopub/app/service" "time" ) diff --git a/pack.sh b/pack.sh old mode 100644 new mode 100755 diff --git a/service.sh b/service.sh old mode 100644 new mode 100755