Documentation
¶
Index ¶
- Variables
- type Article
- type ModelArticle
- func (m *ModelArticle) CreateArticle(ctx context.Context, article *Article) error
- func (m *ModelArticle) CreateTag(ctx context.Context, tag *Tag) error
- func (m *ModelArticle) DeleteArticleByID(ctx context.Context, articleId string) error
- func (m *ModelArticle) DeleteTagByName(ctx context.Context, tagName string) error
- func (m *ModelArticle) QueryArticleByID(ctx context.Context, article *Article, articleId string) error
- func (m *ModelArticle) QueryArticleList(c *gin.Context, list *[]Article, pageNo int, pageSize int, tagNames []string, ...) error
- func (m *ModelArticle) QueryTagByName(ctx context.Context, tag *Tag, tagName string) error
- func (m *ModelArticle) QueryTags(c *gin.Context, tags *[]Tag) error
- func (m *ModelArticle) UpdateArticleByID(ctx context.Context, article *Article, articleId string) error
- func (m *ModelArticle) UpdateArticleLikeByID(ctx context.Context, article *Article) error
- func (m *ModelArticle) UpdateArticleViewByID(ctx context.Context, article *Article) error
- func (m *ModelArticle) UpdateTagByName(ctx context.Context, tag *Tag, tagName string) error
- type Tag
Constants ¶
This section is empty.
Variables ¶
View Source
var ModelArticleSet = wire.NewSet(wire.Struct(new(ModelArticle), "*"))
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
gorm.Model
Id string `gorm:"primarykey;index:idx_id;unique;varchar(20);not null;"`
Title string `gorm:"index:idx_title;unique;varchar(150);not null;"`
Author string `gorm:"varchar(30);not null;default:'马克西'"`
Reference string `gorm:"varchar(300);"`
Link string `gorm:"varchar(300);"`
View uint `gorm:"number;not null;default:0;"`
Like uint `gorm:"number;not null;default:0;"`
Cover string `gorm:"varchar(300);"`
Content string `gorm:"text;"`
Tags []Tag `gorm:"many2many:article_tag;"`
}
type ModelArticle ¶
func (*ModelArticle) CreateArticle ¶
func (m *ModelArticle) CreateArticle(ctx context.Context, article *Article) error
func (*ModelArticle) CreateTag ¶
func (m *ModelArticle) CreateTag(ctx context.Context, tag *Tag) error
func (*ModelArticle) DeleteArticleByID ¶
func (m *ModelArticle) DeleteArticleByID(ctx context.Context, articleId string) error
func (*ModelArticle) DeleteTagByName ¶
func (m *ModelArticle) DeleteTagByName(ctx context.Context, tagName string) error
func (*ModelArticle) QueryArticleByID ¶
func (*ModelArticle) QueryArticleList ¶
func (*ModelArticle) QueryTagByName ¶
func (*ModelArticle) QueryTags ¶
func (m *ModelArticle) QueryTags(c *gin.Context, tags *[]Tag) error
func (*ModelArticle) UpdateArticleByID ¶
func (*ModelArticle) UpdateArticleLikeByID ¶
func (m *ModelArticle) UpdateArticleLikeByID(ctx context.Context, article *Article) error
func (*ModelArticle) UpdateArticleViewByID ¶
func (m *ModelArticle) UpdateArticleViewByID(ctx context.Context, article *Article) error
func (*ModelArticle) UpdateTagByName ¶
Click to show internal directories.
Click to hide internal directories.