Documentation
¶
Index ¶
- Constants
- func Art2TextPoint(a *Article) *string
- func Gist2TextPoint(g *Gist) *string
- type Article
- type ArticleContent
- type ArticleTags
- type Attachment
- type BaseModel
- type Comment
- type Gist
- type GistFts
- type GistOutput
- type LoginRecord
- type Pagination
- type SearchURLParams
- type Settings
- type Tag
- type User
Constants ¶
View Source
const ( ArticleStatusDraft = 0 ArticleStatusPublished = 1 )
Variables ¶
This section is empty.
Functions ¶
func Art2TextPoint ¶
func Gist2TextPoint ¶
Types ¶
type Article ¶
type Article struct {
BaseModel
Title string `gorm:"type:varchar(255);notnull;" json:"title"`
Status uint `gorm:"type:tinyint;notnull;comment:0=draft,1=published,2=hidden-不在列表显示" json:"status"`
Rune uint `gorm:"type:smallint;notnull;comment:不合范式的冗余字段" json:"rune"`
Image string `gorm:"type:varchar(255);notnull" json:"image"`
Summary string `gorm:"type:varchar(2000);notnull" json:"summary"`
ArticleContent *ArticleContent `json:"content"`
Tags []Tag `gorm:"many2many:article_tags" json:"tags"`
}
type ArticleContent ¶
type ArticleTags ¶
type Attachment ¶
type BaseModel ¶
type BaseModel struct {
ID uint `json:"id"`
Created uint `gorm:"notnull;autoCreateTime" json:"created"`
Updated uint `gorm:"notnull;autoUpdateTime" json:"updated"`
IsDel soft_delete.DeletedAt `gorm:"type:tinyint(1);notnull;softDelete:flag" json:"-"`
}
type Comment ¶
type Comment struct {
BaseModel
Name string `gorm:"type:varchar(255);notnull" validate:"min=1,max=50" json:"name"`
Email string `gorm:"type:varchar(255);notnull" validate:"email,max=100" json:"email"`
Link string `gorm:"type:varchar(255);notnull" json:"link" validate:"omitempty,custom_url,max=255"`
Content string `gorm:"type:varchar(1000);notnull" validate:"min=1,max=1000" json:"content"`
ArticleID uint `gorm:"notnull" json:"article_id"`
ReplyCommentID uint `gorm:"notnull" json:"reply_comment_id"`
RootCommentID uint `gorm:"notnull" json:"root_comment_id"`
}
type Gist ¶
type Gist struct {
BaseModel
Title string `gorm:"type:varchar(255);notnull" json:"title"`
Lang string `gorm:"type:varchar(20);notnull" json:"lang"`
Content string `gorm:"type:text;notnull" json:"content"`
GistOutput *GistOutput `json:"output"`
}
type GistFts ¶
type GistFts struct {
ID uint `json:"id"`
Title string `json:"title"`
Lang string `json:"lang"`
Content string `json:"content"`
}
func Text2ArtGistFts ¶
type GistOutput ¶
type LoginRecord ¶
type LoginRecord struct {
ID uint `gorm:"primaryKey" json:"id"`
Created uint `gorm:"notnull;autoCreateTime" json:"created"`
//IP uint `json:"ip"`
IP string `gorm:"type:varchar(39);notnull" json:"ip"`
IsFailed bool `gorm:"default:false" json:"is_failed"`
}
TODO duckDB
type Pagination ¶
type SearchURLParams ¶
Click to show internal directories.
Click to hide internal directories.