Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeHistory ¶
type ChangeHistory struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty"` //bson是用来创建后返回,omitempty是可选 PageID primitive.ObjectID `json:"page_id" bson:"page_id"` Title string `json:"title" bson:"title,omitempty"` //网站名 TDK title Keywords string `json:"keywords" bson:"keywords,omitempty"` //关键字 TDK keywords Description string `json:"description" bson:"description,omitempty"` //描述 TDK description URL string `json:"url" bson:"url,omitempty"` //网站地址 Components []component.Component `json:"components" bson:"components,omitempty"` //包含组件 Status int `json:"status" bson:"status,omitempty"` //状态:0不可用,1可用 CreatedAt time.Time `json:"created_at" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at,omitempty"` }
ChangeHistory 修改历史,便于回滚
type Page ¶
type Page struct { ID primitive.ObjectID `json:"_id" bson:"_id,omitempty"` //bson是用来创建后返回,omitempty是可选 WebsiteID primitive.ObjectID `json:"website_id" bson:"website_id,omitempty"` Title string `json:"title" bson:"title,omitempty"` //网站名 TDK title Keywords string `json:"keywords" bson:"keywords,omitempty"` //关键字 TDK keywords Description string `json:"description" bson:"description,omitempty"` //描述 TDK description URL string `json:"url" bson:"url,omitempty"` //网站地址 Components []component.Component `json:"components" bson:"components,omitempty"` //包含组件 Status int `json:"status" bson:"status,omitempty"` //状态:0不可用,1可用 CreatedAt time.Time `json:"created_at" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at,omitempty"` }
Page 页面数据结构
type PageService ¶
type PageService interface { GetPageList(offset, limit int64, search Page) (page []Page, count int64, err error) GetPage(url string) (page Page, err error) CreatePage(page *Page) (err error) UpdatePage(page *Page) (err error) DeletePage(pageID primitive.ObjectID) (err error) GetPageComponents(pageID primitive.ObjectID) (components []component.Component, err error) UpdatePageComponents(id primitive.ObjectID, pageComponents []component.Component) error CopyPage(id primitive.ObjectID, url string) error }
func NewService ¶
func NewService(mongo *mongo.Database) PageService
Click to show internal directories.
Click to hide internal directories.