码农笔录博客源码
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 rivejä
833 B

6 vuotta sitten
package controllers
import (
6 vuotta sitten
"beeblog/service"
4 vuotta sitten
beego "github.com/beego/beego/v2/server/web"
6 vuotta sitten
)
type IndexController struct {
beego.Controller
}
6 vuotta sitten
func (this *IndexController) Get() {
6 vuotta sitten
blogService := service.BlogService{}
timeBlog, _ := blogService.IndexBlogs(12, 0)
6 vuotta sitten
this.Data["TimeBlog"] = timeBlog
6 vuotta sitten
browsBlog, _ := blogService.IndexBlogs(12, 1)
6 vuotta sitten
this.Data["BrowsBlog"] = browsBlog
6 vuotta sitten
likeBlog, _ := blogService.IndexBlogs(12, 2)
6 vuotta sitten
this.Data["LikeBlog"] = likeBlog
6 vuotta sitten
commentBlog, _ := blogService.IndexBlogs(12, 3)
6 vuotta sitten
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 vuotta sitten
return
6 vuotta sitten
}