Files
lti-api/tools/templates/repository.tmpl
T
2025-09-25 10:47:28 +07:00

23 lines
677 B
Cheetah

{{define "repository"}}package repository
import (
model "github.com/hafizhproject45/Golang-Boilerplate.git/internal/modules/{{Kebab .FeatName}}s/models"
"github.com/hafizhproject45/Golang-Boilerplate.git/internal/repository"
"gorm.io/gorm"
)
type {{Pascal .Entity}}Repository interface {
repository.BaseRepository[model.{{Pascal .Entity}}]
}
type {{Pascal .Entity}}RepositoryImpl struct {
*repository.BaseRepositoryImpl[model.{{Pascal .Entity}}]
}
func New{{Pascal .Entity}}Repository(db *gorm.DB) {{Pascal .Entity}}Repository {
return &{{Pascal .Entity}}RepositoryImpl{
BaseRepositoryImpl: repository.NewBaseRepository[model.{{Pascal .Entity}}](db),
}
}
{{end}}