26 lines
535 B
Go
26 lines
535 B
Go
package repository
|
|
|
|
import (
|
|
"Blog/bootstrap"
|
|
"Blog/internal/consts"
|
|
"Blog/internal/model"
|
|
)
|
|
|
|
var ArticleRepository *articleRepository = newArticleRepository()
|
|
|
|
type articleRepository struct {
|
|
*baseRep[model.BlogArticle]
|
|
// DB *bootstrap.DB
|
|
}
|
|
|
|
func newArticleRepository() *articleRepository {
|
|
return &articleRepository{
|
|
&baseRep[model.BlogArticle]{
|
|
DB: bootstrap.BlogDB.Gorm,
|
|
Mutex: bootstrap.BlogDB.Mutex,
|
|
TableName: consts.TABLE_BLOG_ARTICLE,
|
|
},
|
|
}
|
|
// return &articleRepository{DB: bootstrap.BlogDB}
|
|
}
|