diff --git a/controllers/UserController.go b/controllers/UserController.go index 9051e07..1c0e394 100644 --- a/controllers/UserController.go +++ b/controllers/UserController.go @@ -88,82 +88,6 @@ func (this *UserController) PersonBlog() { this.Data["User"] = user this.TplName = "ublogs.html" } - -func (this *UserController) PersonNote() { - userService := service.UserService{} - noteService := service.NoteService{} - uid := this.GetSession("userid") - if uid == nil { - this.Redirect("/login", 302) - return - } - notColl, err := noteService.GetNoteColl(uid.(int64)) - if err == nil { - if len(notColl) > 0 { - for i := 0; i < len(notColl); i++ { - count, _ := noteService.CountNote(notColl[i].Id) - notColl[i].Count = count - } - } - } else { - notColl = make([]*models.NoteColl, 0) - } - if err != nil { - this.Redirect("/404", 302) - return - } - user, uerr := userService.GetUser(uid.(int64)) - if uerr != nil { - if uid == nil { - this.Redirect("/404", 302) - return - } - } - this.Data["UserId"] = this.GetSession("userid") - this.Data["HeadImg"] = this.GetSession("headimg") - this.Data["NickName"] = this.GetSession("nickname") - this.Data["IsLogin"] = this.GetSession("nickname") != nil - this.Data["Note"] = notColl - this.Data["IsMeNote"] = true - this.Data["User"] = user - this.TplName = "unote.html" -} - -func (this *UserController) PersonLike() { - userService := service.UserService{} - likeService := service.LikeService{} - uid := this.GetSession("userid") - if uid == nil { - this.Redirect("/login", 302) - return - } - size := 15 - num, _ := this.GetInt("num") - if num <= 0 { - num = 1 - } - page, err := likeService.MeLikes(num, size, uid.(int64)) - if err != nil { - this.Redirect("/404", 302) - return - } - user, uerr := userService.GetUser(uid.(int64)) - if uerr != nil { - if uid == nil { - this.Redirect("/404", 302) - return - } - } - this.Data["UserId"] = this.GetSession("userid") - this.Data["HeadImg"] = this.GetSession("headimg") - this.Data["NickName"] = this.GetSession("nickname") - this.Data["IsLogin"] = this.GetSession("nickname") != nil - this.Data["Page"] = page - this.Data["IsMeLike"] = true - this.Data["User"] = user - this.TplName = "ulike.html" -} - func (this *UserController) PersonInfo() { userService := service.UserService{} uid := this.GetSession("userid") diff --git a/routers/UserRouter.go b/routers/UserRouter.go index 7059155..1efff76 100644 --- a/routers/UserRouter.go +++ b/routers/UserRouter.go @@ -17,7 +17,5 @@ func init() { beego.Router("/api/login", &controllers.UserController{}, "post:Login") beego.Router("/api/regist", &controllers.UserController{}, "post:Regist") beego.Router("/me/blog", &controllers.UserController{}, "get:PersonBlog") - beego.Router("/me/note", &controllers.UserController{}, "get:PersonNote") - beego.Router("/me/like", &controllers.UserController{}, "get:PersonLike") beego.Router("/me/info", &controllers.UserController{}, "get:PersonInfo") } diff --git a/views/T.nav.tpl b/views/T.nav.tpl index 03a2790..6105611 100644 --- a/views/T.nav.tpl +++ b/views/T.nav.tpl @@ -9,9 +9,6 @@