REFACTOR: Deleted Redundant Repo Interfaces
Build, Push and Deploy CMS / build-push-deploy (push) Successful in 2m46s
Build, Push and Deploy CMS / build-push-deploy (push) Successful in 2m46s
This commit is contained in:
@@ -8,17 +8,13 @@ import (
|
||||
"thamanyah/cms/v2/internal/models"
|
||||
)
|
||||
|
||||
type VideoRepository interface {
|
||||
CreateVideo(ctx context.Context, v models.Video) (models.Video, error)
|
||||
type VideoRepository struct {
|
||||
SQLDB *sql.DB
|
||||
}
|
||||
|
||||
var VideoRepo VideoRepository
|
||||
|
||||
type ConcreteVideoRepository struct {
|
||||
SQLDB *sql.DB
|
||||
}
|
||||
|
||||
func (svc ConcreteVideoRepository) CreateVideo(ctx context.Context, v models.Video) (models.Video, error) {
|
||||
func (svc VideoRepository) CreateVideo(ctx context.Context, v models.Video) (models.Video, error) {
|
||||
tx, err := svc.SQLDB.BeginTx(ctx, nil)
|
||||
if err != nil {
|
||||
return models.Video{}, err
|
||||
|
||||
Reference in New Issue
Block a user