package repository import ( "Blog/internal/client" "Blog/internal/consts" "Blog/internal/model" ) var articleRep *articleRepository func ArticleRepository() *articleRepository { if articleRep == nil { articleRep = &articleRepository{ &BaseRep[model.BlogArticle]{ DB: client.BlogGormClient(), TableName: consts.TABLE_BLOG_ARTICLE, }, } } return articleRep } type articleRepository struct { *BaseRep[model.BlogArticle] }