models

package
v0.0.0-...-9b663ca Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	base.Model
	ID        string         `gorm:"column:id;size:36;NOT NULL;PRIMARY_KEY"`
	UID       int64          `gorm:"NOT NULL;"`
	Title     string         `gorm:"size:50;NOT NULL;"`
	Content   string         `gorm:"NOT NULL"`
	Tags      pq.StringArray `gorm:"type:varchar(10)[]"`
	Excerpt   string         `gorm:"size:200;NOT NULL"`
	Top       int8
	TopTime   time.Time
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewArticle

func NewArticle() *Article

NewArticle ..

func NewArticleFromPB

func NewArticleFromPB(in *pb.PublishArticleRequest) *Article

NewArticleFromPB ...

func (*Article) TableName

func (m *Article) TableName() string

TableName ..

func (*Article) ToArticlePB

func (m *Article) ToArticlePB(Article *Article) *pb.Article

func (*Article) ToArticlePBs

func (m *Article) ToArticlePBs(data []*Article) []*pb.Article

ToArticlePBs ..

type ArticleIndex

type ArticleIndex struct {
	ID             uint           `json:"id"`
	Title          string         `json:"title"`
	Desc           string         `json:"desc"`
	PubDate        int64          `json:"pub_date"`
	Cover          string         `json:"cover"`
	TotalNum       int32          `json:"total_num"`
	Tags           pq.StringArray `json:"tags"`
	EpisodeID      uint           `json:"episode_id"`
	IsShow         bool           `json:"is_show"`
	IsHideOnMobile bool           `json:"is_hide_on_mobile"`
	SeriesID       uint           `json:"series_id"`
	SeriesName     string         `json:"series_name"`
	SeriesAlias    string         `json:"series_alias"`
	SeriesNum      uint           `json:"series_num"`
}

ArticleIndex 文章索引

Jump to

Keyboard shortcuts

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