You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
371 B
20 lines
371 B
1 year ago
|
package repositories
|
||
|
|
||
|
import (
|
||
|
"gorm.io/gorm"
|
||
|
"sorbet/internal/entities"
|
||
|
"sorbet/pkg/db"
|
||
|
)
|
||
|
|
||
|
type ResourceRepository struct {
|
||
|
*db.Repository[entities.Resource]
|
||
|
}
|
||
|
|
||
|
// NewResourceRepository 创建资源仓库
|
||
|
func NewResourceRepository(orm *gorm.DB) *ResourceRepository {
|
||
|
return &ResourceRepository{
|
||
|
db.NewRepositoryWith[entities.Resource](orm, "id"),
|
||
|
}
|
||
|
}
|
||
|
|