site

package
v0.0.0-...-6cf3fe2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Seo

type Seo struct {
	gorm.Model
	SiteId string `json:"siteId,omitempty"`
	// 页面的 ID
	PageId string `json:"pageId,omitempty"`
	// 页面的 title
	Title string `json:"title,omitempty"`
	// 页面的 描述
	Desc string `json:"desc,omitempty"`
	// 页面的 关键字
	Keyword string `json:"keyword,omitempty"`
	// url 别名
	UrlAlias string `json:"urlAlias,omitempty"`
}

SEO 配置

type SeoRedirect

type SeoRedirect struct {
	gorm.Model
	SiteId string `json:"siteId,omitempty"`
	// 页面的 ID
	SourcePath string `json:"sourcePath,omitempty"`
	// 页面的 title
	Target string `json:"target,omitempty"`
	// 跳转码,301或者302
	Status int `json:"status,omitempty"`
}

SEO 配置

type Site

type Site struct {
	gorm.Model
	// 二级域名
	Subdomain string `json:"subdomain,omitempty"`
	// 顶级域名
	Domain string `json:"domain,omitempty"`
	// 用户Id
	UserId uint `json:"userId,omitempty"`
	// 站点名称
	Name string `json:"name,omitempty"`
	// 站点分类
	CategoryId string `json:"categoryId,omitempty"`
	// 站点版本
	Version int `json:"version,omitempty"`
	// 网站 favicon
	Favicon string `json:"favicon,omitempty"`
}

站点模型,前台和后台公用一个模型

func (*Site) InitSite

func (s *Site) InitSite() *Site

初始化站点

type SiteInstance

type SiteInstance struct {
	gorm.Model
	// 站点id
	SiteId string `json:"siteId,omitempty"`
	// 实例版本,保存一次就增加一次version
	Version int `json:"version,omitempty"`
	// 版本别名,用于支持用户自定义名称
	Alias string `json:"alias,omitempty"`

	// 页面实例
	Pages []SitePage `json:"pages,omitempty"`
	// 模板id
	TemplateId string `json:"templateId,omitempty"`
}

站点实例

type SitePage

type SitePage struct {
	gorm.Model
	SiteInstanceId string `json:"siteInstanceId,omitempty"`
	// 页面名称,一般用于系统页面
	PageName string `json:"pageName,omitempty"`
	// 页面标题
	PageTitle string `json:"pageTitle,omitempty"`
	// 页面主题
	Theme string `json:"theme,omitempty"`
	// 页面是否开启,默认开启,不开启相当于禁用页面,自动跳转会网站首页
	Enable bool `json:"enable,omitempty"`
	// 段落配置
	Segments []SitePageSegment `json:"segments,omitempty"`
}

站点页面实例

type SitePageComponent

type SitePageComponent struct {
	gorm.Model
	// 组件id
	ComponentId string `json:"componentId,omitempty"`
	/**
	匹配多个区域类型,如果是 * 则全匹配
	*/
	MatchRegionType []string `json:"type,omitempty"`
	// 自定义样式
	StyleData map[string]interface{} `json:"styleData,omitempty"`
	// 自定义数据
	Data map[string]interface{} `json:"data,omitempty"`
}

组件定义

type SitePageRegion

type SitePageRegion struct {
	// 列的序号,用于控制位置
	ColumnIndex int `json:"columnIndex,omitempty"`
	// 自定义样式
	StyleData map[string]interface{} `json:"styleData,omitempty"`
	//区块内的组件
	Components []SitePageComponent `json:"components,omitempty"`
}

站点段落内区域实例

type SitePageSegment

type SitePageSegment struct {
	/**
	段落类型,用于设置段落的布局,
	full-column 全屏
	center-column 通栏,比如说浏览器宽度是 1440,通栏就是1200像素并且居中的效果
	left-main-column 左右布局
	left-main-right-column 左中右布局
	main-right-column 中右布局
	*/
	Layout string `json:"layout,omitempty"`
	// 自定义样式
	StyleData map[string]interface{} `json:"styleData,omitempty"`
	//区块,每个
	Regions []SitePageSegment `json:"regions,omitempty"`
}

站点段落实例

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL