码农笔录博客源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
815 B

пре 6 година
package controllers
import (
"github.com/astaxie/beego"
пре 6 година
"beeblog/service"
пре 6 година
)
type IndexController struct {
beego.Controller
}
пре 6 година
func (this *IndexController) Get() {
пре 6 година
blogService := service.BlogService{}
timeBlog, _ := blogService.IndexBlogs(12, 0)
пре 6 година
this.Data["TimeBlog"] = timeBlog
пре 6 година
browsBlog, _ := blogService.IndexBlogs(12, 1)
пре 6 година
this.Data["BrowsBlog"] = browsBlog
пре 6 година
likeBlog, _ := blogService.IndexBlogs(12, 2)
пре 6 година
this.Data["LikeBlog"] = likeBlog
пре 6 година
commentBlog, _ := blogService.IndexBlogs(12, 3)
пре 6 година
this.Data["CommBlog"] = commentBlog
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["IsHome"] = true
this.TplName = "index.html"
пре 6 година
return
пре 6 година
}