pageConfig

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FriendShipLinks = `friendShipLinks`
	WebSettings     = `webSettings`
)

Variables

View Source
var PageTypeList = []string{
	FriendShipLinks,
	WebSettings,
}

Functions

func CreateOrSave

func CreateOrSave(entity *Entity) int64

func GetConfigByPageType added in v0.0.5

func GetConfigByPageType[T any](pageType string, defaultValue T) T

Types

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 Get

func Get(id any) (entity Entity)

func GetByPageType

func GetByPageType(pageType string) (entity Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

type FriendLinksGroup added in v0.0.5

type FriendLinksGroup struct {
	Name  string     `json:"name,omitempty"`
	Links []LinkItem `json:"links,omitempty"`
}

type LinkItem added in v0.0.5

type LinkItem struct {
	Name    string `json:"name"`
	Desc    string `json:"desc"`
	Url     string `json:"url"`
	LogoUrl string `json:"logoUrl"`
}

type WebSettingsConfig added in v0.0.5

type WebSettingsConfig struct {
	ExternalLinks string `json:"externalLinks,omitempty"`
	CustomJS      string `json:"customJS,omitempty"`
	Favicon       string `json:"favicon,omitempty"`
}

Jump to

Keyboard shortcuts

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