码农笔录博客源码
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 years ago
package controllers
import (
"github.com/astaxie/beego"
6 years ago
"beeblog/service"
6 years ago
)
type IndexController struct {
beego.Controller
}
6 years ago
func (this *IndexController) Get() {
6 years ago
blogService := service.BlogService{}
timeBlog, _ := blogService.IndexBlogs(12, 0)
6 years ago
this.Data["TimeBlog"] = timeBlog
6 years ago
browsBlog, _ := blogService.IndexBlogs(12, 1)
6 years ago
this.Data["BrowsBlog"] = browsBlog
6 years ago
likeBlog, _ := blogService.IndexBlogs(12, 2)
6 years ago
this.Data["LikeBlog"] = likeBlog
6 years ago
commentBlog, _ := blogService.IndexBlogs(12, 3)
6 years ago
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 years ago
return
6 years ago
}