Documentation
¶
Index ¶
- Constants
- Variables
- func CreateOrSave(entity *Entity) int64
- func GetConfigByPageType[T any](pageType string, defaultValue T) T
- func GetConfigByPageTypeE[T any](pageType string, defaultValue T) (T, error)
- type AnnouncementConfig
- type Entity
- type FooterConfig
- type FooterGroup
- type FooterItem
- type FriendLinksGroup
- type LinkItem
- type MailSettingsConfig
- type PItem
- type SiteSettingsConfig
- type SponsorItem
- type Sponsors
- type SponsorsConfig
- type UserSponsor
- type WebSettingsConfig
Constants ¶
View Source
const ( FriendShipLinks = `friendShipLinks` WebSettings = `webSettings` SponsorsPage = `sponsors` SiteSettings = `siteSettings` EmailSettings = `emailSetting` Announcement = `announcement` )
Variables ¶
View Source
var PageTypeList = []string{ FriendShipLinks, WebSettings, FooterLinks, SponsorsPage, SiteSettings, EmailSettings, Announcement, }
Functions ¶
func CreateOrSave ¶
func GetConfigByPageType ¶ added in v0.0.5
func GetConfigByPageTypeE ¶ added in v0.0.8
Types ¶
type AnnouncementConfig ¶ added in v0.0.9
type AnnouncementConfig struct {
Enabled bool `json:"enabled"` // 是否启用公告
Title string `json:"title"` // 公告标题
Content string `json:"content"` // 公告内容
Link string `json:"link,omitempty"` // 公告链接
}
AnnouncementConfig 公告设置配置
type Entity ¶
type Entity struct {
Id uint64 `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"` // 主键
PageType string `gorm:"column:page_type;uniqueIndex;type:varchar(128);not null;default:'';" json:"pageType"` // 页面类型
Config string `gorm:"column:config;type:text;" json:"content"` //
CreatedAt time.Time `gorm:"column:created_at;index;autoCreateTime;<-:create;" json:"createdAt"` //
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}
func GetByPageType ¶
type FooterConfig ¶ added in v0.0.8
type FooterConfig struct {
}
type FooterGroup ¶ added in v0.0.8
type FooterGroup struct {
}
type FooterItem ¶ added in v0.0.8
type FooterItem struct {
}
type FriendLinksGroup ¶ added in v0.0.5
type MailSettingsConfig ¶ added in v0.0.8
type MailSettingsConfig struct {
// SMTP服务器设置
EnableMail bool `json:"enableMail"`
SmtpHost string `json:"smtpHost"`
SmtpPort int `json:"smtpPort"`
UseSSL bool `json:"useSSL"`
SmtpUsername string `json:"smtpUsername"`
SmtpPassword string `json:"smtpPassword"`
FromName string `json:"fromName"`
FromEmail string `json:"fromEmail"`
}
MailSettingsConfig 邮件设置配置
type SiteSettingsConfig ¶ added in v0.0.8
type SiteSettingsConfig struct {
// 站点基本信息
SiteName string `json:"siteName"`
SiteLogo string `json:"siteLogo"`
SiteDescription string `json:"siteDescription"`
SiteKeywords string `json:"siteKeywords"`
SiteUrl string `json:"siteUrl"`
SiteEmail string `json:"siteEmail"`
}
SiteSettingsConfig 站点设置配置
type SponsorItem ¶ added in v0.0.8
type SponsorItem struct {
Name string `json:"name"`
Logo string `json:"logo"`
Info string `json:"info"`
Url string `json:"url"`
Tag []string `json:"tag"`
}
SponsorItem 赞助商相关数据结构
type Sponsors ¶ added in v0.0.8
type Sponsors struct {
Level0 []SponsorItem `json:"level0"`
Level1 []SponsorItem `json:"level1"`
Level2 []SponsorItem `json:"level2"`
Level3 []SponsorItem `json:"level3"`
}
type SponsorsConfig ¶ added in v0.0.8
type SponsorsConfig struct {
Sponsors Sponsors `json:"sponsors"`
Users []UserSponsor `json:"users"`
}
type UserSponsor ¶ added in v0.0.8
type WebSettingsConfig ¶ added in v0.0.5
Click to show internal directories.
Click to hide internal directories.