yintai2/app/common/model/page.go

31 lines
580 B
Go

package model
import "time"
type Page struct {
ID int64
Name string
Page string
Pid int64
Path string
Weight int64
Content string
Tags string
CreateTime int64
UpdateTime int64
}
func (r *Page) Format() map[string]any {
res := make(map[string]any)
res["id"] = r.ID
res["name"] = r.Name
res["page"] = r.Page
res["pid"] = r.Pid
res["path"] = r.Path
res["weight"] = r.Weight
res["content"] = r.Content
res["tags"] = r.Tags
res["create_time"] = time.Unix(r.CreateTime, 0).Format("2006-01-02 15:04:05")
return res
}