backend moved to separate directory
backend: deleted the old structure
This commit is contained in:
21
go-backend/internal/repositories/consents_repository.go
Normal file
21
go-backend/internal/repositories/consents_repository.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package repositories
|
||||
|
||||
import (
|
||||
"GoMembership/internal/database"
|
||||
"GoMembership/internal/models"
|
||||
)
|
||||
|
||||
type ConsentRepositoryInterface interface {
|
||||
CreateConsent(consent *models.Consent) (uint, error)
|
||||
}
|
||||
|
||||
type ConsentRepository struct{}
|
||||
|
||||
func (repo *ConsentRepository) CreateConsent(consent *models.Consent) (uint, error) {
|
||||
result := database.DB.Create(consent)
|
||||
|
||||
if result.Error != nil {
|
||||
return 0, result.Error
|
||||
}
|
||||
return consent.ID, nil
|
||||
}
|
||||
Reference in New Issue
Block a user