examples_admin

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const I18nExampleKey i18n.ModuleKey = "I18nExampleKey"

@snippet_begin(I18nMessagesExample)

Variables

View Source
var Messages_en_US = &Messages{
	Admin:   "Admin",
	Welcome: "Welcome",
}
View Source
var Messages_ja_JP = &Messages{
	Admin:   "管理システム",
	Welcome: "ようこそ",
}
View Source
var Messages_ja_JP_ModelsI18nModuleKey = &Messages_ModelsI18nModuleKey{
	Homes:             "ホーム",
	Videos:            "ビデオ",
	VideosName:        "ビデオの名前",
	VideosDescription: "ビデオの説明",
}
View Source
var Messages_zh_CN = &Messages{
	Admin:   "管理系统",
	Welcome: "欢迎",
}
View Source
var Messages_zh_CN_ModelsI18nModuleKey = &Messages_ModelsI18nModuleKey{
	Homes:             "主页",
	Videos:            "视频",
	VideosName:        "视频名称",
	VideosDescription: "视频描述",
}
View Source
var Que = &mock.QueueMock{
	AddFunc: func(ctx context.Context, job worker.QueJobInterface) error {
		jobInfo, err := job.GetJobInfo()
		if err != nil {
			return err
		}
		if scheduler, ok := jobInfo.Argument.(worker.Scheduler); ok && scheduler.GetScheduleTime() != nil {
			job.SetStatus(worker.JobStatusScheduled)
			go func() {
				time.Sleep(scheduler.GetScheduleTime().Sub(time.Now()))
				ConsumeQueItem(job)
			}()
		} else {
			go func() {
				ConsumeQueItem(job)
			}()
		}
		return nil
	},
	KillFunc: func(ctx context.Context, job worker.QueJobInterface) error {
		return job.SetStatus(worker.JobStatusKilled)
	},
	ListenFunc: func(jobDefs []*worker.QorJobDefinition, getJob func(qorJobID uint) (worker.QueJobInterface, error)) error {
		return nil
	},
	RemoveFunc: func(ctx context.Context, job worker.QueJobInterface) error {
		return job.SetStatus(worker.JobStatusCancelled)
	},
}

Functions

func ActionWorkerExample

func ActionWorkerExample(b *presets.Builder, db *gorm.DB) http.Handler

func ActivityExample

func ActivityExample(b *presets.Builder, db *gorm.DB) http.Handler

func AutoCompleteBasicFilterExample added in v3.0.3

func AutoCompleteBasicFilterExample(b *presets.Builder, ab *autocomplete.Builder, db *gorm.DB) http.Handler

func AutoSyncExample added in v3.0.5

func AutoSyncExample(b *presets.Builder, db *gorm.DB) http.Handler

func ChangePasswordExample added in v3.0.3

func ChangePasswordExample(b *presets.Builder, db *gorm.DB) http.Handler

func ConsumeQueItem

func ConsumeQueItem(job worker.QueJobInterface) (err error)

func ExampleDB

func ExampleDB() (db *gorm.DB)

func InternationalizationExample

func InternationalizationExample(b *presets.Builder, db *gorm.DB) http.Handler

func LinkageSelectFilterItemRemoteExample added in v3.0.5

func LinkageSelectFilterItemRemoteExample(b *presets.Builder, mux examples.Muxer, db *gorm.DB) http.Handler

func ListingExample

func ListingExample(b *presets.Builder, db *gorm.DB) http.Handler

func LocalizationExample

func LocalizationExample(b *presets.Builder, db *gorm.DB) http.Handler

func MediaAllowTypesExample added in v3.0.5

func MediaAllowTypesExample(b *presets.Builder, db *gorm.DB) http.Handler

func MediaExample added in v3.0.2

func MediaExample(b *presets.Builder, db *gorm.DB) http.Handler

func MountActionWorker

func MountActionWorker(b *presets.Builder)

func MountWorker

func MountWorker(b *presets.Builder)

func Mux

func Mux(mux *http.ServeMux) http.Handler

func PageBuilderExample

func PageBuilderExample(b *presets.Builder, db *gorm.DB) http.Handler

func ProfileExample added in v3.0.3

func ProfileExample(b *presets.Builder, db *gorm.DB) http.Handler

func PublishExample

func PublishExample(b *presets.Builder, db *gorm.DB) http.Handler

@snippet_end

func SEOExampleBasic

func SEOExampleBasic(b *presets.Builder, db *gorm.DB) http.Handler

func SamplesHandler

func SamplesHandler(mux webexamples.Muxer)

func SingletonExample added in v3.0.4

func SingletonExample(b *presets.Builder, db *gorm.DB) http.Handler

func TestHandler

func TestHandler(pageBuilder *pagebuilder.Builder, b *presets.Builder) http.Handler

func WorkerExample

func WorkerExample(b *presets.Builder, db *gorm.DB) http.Handler

Types

type AutoCompletePost added in v3.0.3

type AutoCompletePost struct {
	gorm.Model
	Title  string
	Body   string
	Status string
}

type Campaign

type Campaign struct {
	gorm.Model
	Title string
	publish.Status
	publish.Schedule
	publish.Version
}

models

func (*Campaign) GetTitle

func (b *Campaign) GetTitle() string

func (*Campaign) PrimaryColumnValuesBySlug

func (p *Campaign) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*Campaign) PrimarySlug

func (p *Campaign) PrimarySlug() string

func (*Campaign) PublishUrl added in v3.0.2

func (b *Campaign) PublishUrl(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (s string)

func (*Campaign) WrapPublishActions added in v3.0.2

func (b *Campaign) WrapPublishActions(in publish.PublishActionsFunc) publish.PublishActionsFunc

type CampaignContent

type CampaignContent struct {
	ID     uint
	Title  string
	Banner string
	Image  media_library.MediaBox
}

containers

type CampaignProduct added in v3.0.2

type CampaignProduct struct {
	gorm.Model
	Name string
	publish.Status
	publish.Schedule
	publish.Version
}

models

func (*CampaignProduct) GetTitle added in v3.0.2

func (b *CampaignProduct) GetTitle() string

func (*CampaignProduct) PrimaryColumnValuesBySlug added in v3.0.2

func (p *CampaignProduct) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*CampaignProduct) PrimarySlug added in v3.0.2

func (p *CampaignProduct) PrimarySlug() string

func (*CampaignProduct) PublishUrl added in v3.0.2

func (b *CampaignProduct) PublishUrl(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (s string)

type CampaignProductTemplate added in v3.0.5

type CampaignProductTemplate struct {
	gorm.Model
	Title string
	Desc  string
}

templates

func (*CampaignProductTemplate) GetDescription added in v3.0.5

func (b *CampaignProductTemplate) GetDescription(ctx *web.EventContext) string

func (*CampaignProductTemplate) GetName added in v3.0.5

func (b *CampaignProductTemplate) GetName(ctx *web.EventContext) string

func (*CampaignProductTemplate) PrimaryColumnValuesBySlug added in v3.0.5

func (p *CampaignProductTemplate) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*CampaignProductTemplate) PrimarySlug added in v3.0.5

func (p *CampaignProductTemplate) PrimarySlug() string

type CampaignTemplate added in v3.0.5

type CampaignTemplate struct {
	gorm.Model
	Name        string
	Description string
}

templates

func (*CampaignTemplate) PrimaryColumnValuesBySlug added in v3.0.5

func (p *CampaignTemplate) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*CampaignTemplate) PrimarySlug added in v3.0.5

func (p *CampaignTemplate) PrimarySlug() string

type Category

type Category struct {
	ID   uint
	Name string

	UpdatedAt time.Time
	CreatedAt time.Time
}

type ExampleResource

type ExampleResource struct {
	gorm.Model
	Name string
}

type Item added in v3.0.5

type Item struct {
	ID       string `json:"ID"`
	Name     string `json:"Name"`
	Level    int    `json:"level"`
	ParentID string `json:"-"`
	Parent   *Item  `json:"parent"`
}

type L10nModel

type L10nModel struct {
	gorm.Model
	Title string

	l10n.Locale
}

@snippet_begin(L10nModelExample)

func (*L10nModel) PrimaryColumnValuesBySlug

func (lm *L10nModel) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*L10nModel) PrimarySlug

func (lm *L10nModel) PrimarySlug() string

type LinkageSelectFilterItemRemoteServer added in v3.0.5

type LinkageSelectFilterItemRemoteServer struct{}

func (*LinkageSelectFilterItemRemoteServer) ServeHTTP added in v3.0.5

type MediaRole added in v3.0.4

type MediaRole struct {
	gorm.Model
	RoleName string
	MediaID  uint
}

type Messages

type Messages struct {
	Admin   string
	Welcome string
}

type Messages_ModelsI18nModuleKey

type Messages_ModelsI18nModuleKey struct {
	Homes             string
	Videos            string
	VideosName        string
	VideosDescription string
}

type MyContent

type MyContent struct {
	ID    uint
	Text  string
	Color string
}

containers

type PageProduct added in v3.0.5

type PageProduct struct {
	gorm.Model
	Name string
	publish.Status
	publish.Schedule
	publish.Version
}

models

func (*PageProduct) GetTitle added in v3.0.5

func (b *PageProduct) GetTitle() string

func (*PageProduct) PrimaryColumnValuesBySlug added in v3.0.5

func (p *PageProduct) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*PageProduct) PrimarySlug added in v3.0.5

func (p *PageProduct) PrimarySlug() string

func (*PageProduct) PublishUrl added in v3.0.5

func (b *PageProduct) PublishUrl(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (s string)

type PagesContent added in v3.0.3

type PagesContent struct {
	ID    uint
	Text  string
	Color string
}

containers

type PaginatedResponse added in v3.0.5

type PaginatedResponse struct {
	Data    []Item `json:"data"`
	Total   int    `json:"total"`
	Pages   int    `json:"pages"`
	Current int    `json:"current"`
}

type Post

type Post struct {
	ID        uint
	Title     string
	Body      string
	UpdatedAt time.Time
	CreatedAt time.Time
	Disabled  bool

	Status string

	CategoryID uint
}

type ProductContent

type ProductContent struct {
	ID   uint
	Name string
}

containers

type ProfileUser added in v3.0.3

type ProfileUser struct {
	gorm.Model
	Email   string
	Name    string
	Avatar  string
	Role    string
	Status  string
	Company string
}

type QueryParams added in v3.0.5

type QueryParams struct {
	Page     int    `form:"page"`
	PageSize int    `form:"pageSize"`
	Level    int    `form:"level"`
	Search   string `form:"search"`
	ParentID string `form:"parentID"`
}

type SEOPost

type SEOPost struct {
	gorm.Model
	Title string
	SEO   seo.Setting
}

type User

type User struct {
	gorm.Model

	Name    string
	Address string

	login.UserPass
	login.OAuthInfo
	login.SessionSecure
}

type WithPublishProduct

type WithPublishProduct struct {
	gorm.Model

	Name  string
	Price int

	publish.Status
	publish.Schedule
	publish.Version
}

@snippet_begin(PublishInjectModules)

func (*WithPublishProduct) GetPublishActions

func (p *WithPublishProduct) GetPublishActions(ctx context.Context, db *gorm.DB, storage oss.StorageInterface) (actions []*publish.PublishAction, err error)

func (*WithPublishProduct) GetUnPublishActions

func (p *WithPublishProduct) GetUnPublishActions(ctx context.Context, db *gorm.DB, storage oss.StorageInterface) (actions []*publish.PublishAction, err error)

func (*WithPublishProduct) PrimaryColumnValuesBySlug

func (p *WithPublishProduct) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*WithPublishProduct) PrimarySlug

func (p *WithPublishProduct) PrimarySlug() string

type WithSingletenProduct added in v3.0.4

type WithSingletenProduct struct {
	gorm.Model
	Title string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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